sql {SparkR} | R Documentation |
Executes a SQL query using Spark, returning the result as a DataFrame.
sql(sqlContext, sqlQuery)
sqlContext |
SQLContext to use |
sqlQuery |
A character vector containing the SQL query |
DataFrame
## 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)