sql {SparkR}R Documentation

SQL Query

Description

Executes a SQL query using Spark, returning the result as a SparkDataFrame.

Usage

sql(sqlQuery)

Arguments

sqlQuery

A character vector containing the SQL query

Value

SparkDataFrame

Note

sql since 1.4.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 <- sql("SELECT * FROM table")
## End(Not run)

[Package SparkR version 3.0.0 Index]