tableToDF {SparkR}R Documentation

Create a SparkDataFrame from a SparkSQL Table

Description

Returns the specified Table as a SparkDataFrame. The Table must have already been registered in the SQLContext.

Usage

tableToDF(sqlContext, tableName)

Arguments

sqlContext

SQLContext to use

tableName

The SparkSQL Table to convert to a SparkDataFrame.

Value

SparkDataFrame

Examples

## Not run: 
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D path <- "path/to/file.json"
##D df <- read.json(sqlContext, path)
##D registerTempTable(df, "table")
##D new_df <- tableToDF(sqlContext, "table")
## End(Not run)

[Package SparkR version 2.0.0 Index]