Created
June 6, 2021 06:09
-
-
Save AdroitAnandAI/25978c9728a49b78f707dafca54819d4 to your computer and use it in GitHub Desktop.
Spark SQL Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spark is an existing SparkSession | |
df = spark.read.json("./people.json") | |
# Register the DataFrame as a SQL temporary view | |
df.createOrReplaceTempView("people") | |
sqlDF = spark.sql("SELECT * FROM people") | |
sqlDF.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment