Description Usage Arguments Value Note Examples
Executes a SQL query using Spark, returning the result as a SparkDataFrame.
1 | sql(sqlQuery)
|
sqlQuery |
A character vector containing the SQL query |
SparkDataFrame
sql since 1.4.0
1 2 3 4 5 6 7 8 | ## Not run:
sparkR.session()
path <- "path/to/file.json"
df <- read.json(path)
createOrReplaceTempView(df, "table")
new_df <- sql("SELECT * FROM table")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.