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: sc <- sparkR.init() sqlContext <- sparkRSQL.init(sc) path <- "path/to/file.json" df <- read.json(sqlContext, path) registerTempTable(df, "table") new_df <- sql(sqlContext, "SELECT * FROM table") ## End(Not run)