0PricingLogin
Scala for Backend Engineering & Functional Programming · Lesson

Spark SQL

Query data.

What Is Spark SQL?

Spark SQL lets you query distributed data with standard SQL or a typed DataFrame API. Both go through the same Catalyst optimizer, so they perform identically.

Temporary Views

To run SQL against a DataFrame, register it as a view. createOrReplaceTempView makes it queryable by name for the current session.

val df = Seq(("Alice", 30), ("Bob", 25)).toDF("name", "age")
df.createOrReplaceTempView("people")

All lessons in this course

  1. RDDs and DataFrames
  2. Transformations and Actions
  3. Spark SQL
  4. Aggregations
← Back to Scala for Backend Engineering & Functional Programming