SparkR (version 2.1.2)

tableToDF: Create a SparkDataFrame from a SparkSQL Table

Description

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

Usage

tableToDF(tableName)

Arguments

tableName

The SparkSQL Table to convert to a SparkDataFrame.

Value

SparkDataFrame

Examples

Run this code
# NOT RUN {
sparkR.session()
path <- "path/to/file.json"
df <- read.json(path)
createOrReplaceTempView(df, "table")
new_df <- tableToDF("table")
# }

Run the code above in your browser using DataLab