tableToDF {SparkR}R Documentation

Create a SparkDataFrame from a SparkSQL table or view

Description

Returns the specified table or view as a SparkDataFrame. The table or view must already exist or have already been registered in the SparkSession.

Usage

tableToDF(tableName)

Arguments

tableName

the qualified or unqualified name that designates a table or view. If a database is specified, it identifies the table/view from the database. Otherwise, it first attempts to find a temporary view with the given name and then match the table/view from the current database.

Value

SparkDataFrame

Note

tableToDF since 2.0.0

Examples

## Not run: 
##D sparkR.session()
##D path <- "path/to/file.json"
##D df <- read.json(path)
##D createOrReplaceTempView(df, "table")
##D new_df <- tableToDF("table")
## End(Not run)

[Package SparkR version 3.0.0 Index]