Skip to main content

What is Spark SQL?

How Spark SQL lets you query structured data with familiar SQL while leveraging Spark's performance, scalability, and data ecosystem integration

4 Personas Analytics AIBI 3c

Summary

  • Learn how Spark SQL brings native SQL support to Apache Spark so you can analyze large structured datasets with familiar queries​
  • See how Spark SQL uses DataFrames, cost-based optimization and columnar storage to deliver high-performance queries at scale​
  • Discover how Spark SQL integrates with machine learning and the Databricks lakehouse to power end-to-end analytics workloads

Many data scientists, analysts, and general business intelligence users rely on interactive SQL queries for exploring data. Spark SQL is a Spark module for structured data processing. It provides a programming abstraction called DataFrames and can also act as a distributed SQL query engine. It enables unmodified Hadoop Hive queries to run up to 100x faster on existing deployments and data. It also provides powerful integration with the rest of the Spark ecosystem (e.g., integrating SQL query processing with machine learning).

What is Apache Spark SQL?

Spark SQL brings native support for SQL to Spark and streamlines the process of querying data stored both in RDDs (Spark’s distributed datasets) and in external sources. Spark SQL conveniently blurs the lines between RDDs and relational tables. Unifying these powerful abstractions makes it easy for developers to intermix SQL commands querying external data with complex analytics, all within in a single application. Concretely, Spark SQL will allow developers to:

  • Import relational data from Parquet files and Hive tables
  • Run SQL queries over imported data and existing RDDs
  • Easily write RDDs out to Hive tables or Parquet files

Spark SQL also includes a cost-based optimizer, columnar storage, and code generation to make queries fast. At the same time, it scales to thousands of nodes and multi-hour queries using the Spark engine, which provides full mid-query fault tolerance, without having to worry about using a different engine for historical data.  

A 5X LEADER

Gartner®: Databricks Cloud Database Leader

Additional Resources

Never miss a Databricks post

Subscribe to our blog and get the latest posts delivered to your inbox