registerTempTable {SparkR}R Documentation

Register Temporary Table

Description

Registers a DataFrame as a Temporary Table in the SQLContext

Usage

## S4 method for signature 'DataFrame,character'
registerTempTable(x, tableName)

registerTempTable(x, tableName)

Arguments

x

A SparkSQL DataFrame

tableName

A character vector containing the name of the table

Examples

## Not run: 
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D path <- "path/to/file.json"
##D df <- jsonFile(sqlContext, path)
##D registerTempTable(df, "json_df")
##D new_df <- sql(sqlContext, "SELECT * FROM json_df")
## End(Not run)

[Package SparkR version 1.5.1 Index]