Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public String call(Row row) {
// Register this DataFrame as a table.
peopleFromJsonFile.registerTempTable("people");

// SQL statements can be run by using the sql methods provided by sqlContext.
// SQL statements can be run by using the sql methods provided by spark (SparkSession object).
Copy link
Member Author

@HyukjinKwon HyukjinKwon May 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am less sure if spark (SparkSession object) is correct.
(It was a variable name (sqlContext) but for now I add (SparkSession object) with the variable name because it seems the name spark is confusing.)

Copy link
Contributor

@andrewor14 andrewor14 May 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just say provided by spark

Dataset<Row> teenagers3 = spark.sql("SELECT name FROM people WHERE age >= 13 AND age <= 19");

// The results of SQL queries are DataFrame and support all the normal RDD operations.
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/python/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# Register this DataFrame as a temporary table.
people.registerTempTable("people")

# SQL statements can be run by using the sql methods provided by sqlContext
# SQL statements can be run by using the sql methods provided by spark (SparkSession object).
teenagers = spark.sql("SELECT name FROM people WHERE age >= 13 AND age <= 19")

for each in teenagers.collect():
Expand Down