sql {SparkR} | R Documentation |
Executes a SQL query using Spark, returning the result as a SparkDataFrame.
sql(sqlContext, sqlQuery)
sqlContext |
SQLContext to use |
sqlQuery |
A character vector containing the SQL query |
SparkDataFrame
## 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 <- sql(sqlContext, "SELECT * FROM table")
## End(Not run)