Apache Spark
| Developer | Apache Software Foundation |
|---|---|
| Initial release | 2010 (open sourced) |
| Latest release | 4.3.0 (2026-10-30) |
| Written in | Scala, Java, Python |
| Type | Distributed data processing engine |
| License | Apache License 2.0 |
| Website | spark.apache.org |
| Repository | github.com/apache/spark |
| Related | Spark Connect, Spark Declarative Pipelines, Structured Streaming, Apache Iceberg, Delta Lake |
Apache Spark is an open source, distributed engine for large-scale data processing, with high-level APIs in Java, Scala, Python and R and an optimized engine that runs general execution graphs.[1] Spark runs batch queries, SQL, stream processing and machine learning on one engine, on a single machine or on a cluster. In an open lakehouse, Spark is one of the engines that reads and writes open table formats such as Apache Iceberg and Delta Lake through a shared data catalog.
Architecture
A Spark application runs as a set of independent processes on a cluster. The driver program holds the SparkContext (wrapped by SparkSession in the DataFrame API) and plans the work. The driver connects to a cluster manager, which allocates resources, and then obtains executors: processes on worker nodes that run computations and store data for the application. The driver sends application code and then tasks to the executors.[2]
Each Spark application gets its own executor processes, which stay up for the whole application. This isolates applications from one another, but it also means two Spark applications cannot share in-memory data without writing it to external storage.[2]
Execution model
Spark evaluates transformations lazily. A transformation such as a filter or a join only records how a dataset is derived; Spark computes it when an action, such as collect or a write, needs a result. The Spark documentation explains that this lets Spark run more efficiently, for example by returning only the result of a final aggregation to the driver instead of a large intermediate dataset.[3]
A Spark job is a parallel computation that Spark starts in response to an action. Spark divides each job into stages, sets of tasks that depend on one another in a similar way to the map and reduce stages of MapReduce, and sends each task to one executor.[2]
The deploy mode sets where the driver runs. In cluster mode, the driver is launched inside the cluster; in client mode, the process that submits the application runs the driver outside the cluster.[2]
Cluster managers
Spark 4.3 supports three cluster managers: Spark's own standalone manager, Hadoop YARN and Kubernetes. Applications are submitted to any of them with the spark-submit script. Each driver also serves a web UI, by default on port 4040.[2] The project also maintains a separate Spark Kubernetes Operator for running Spark applications and clusters through Kubernetes custom resources.[1]
APIs and libraries
Spark exposes several libraries on top of its core engine:[1]
- Spark SQL and DataFrames: structured data processing through SQL or the DataFrame and Dataset APIs, optimized by the Catalyst query optimizer.[4][5]
- Structured Streaming: stream processing built on the Spark SQL engine, using the same DataFrame operations as batch queries.
- MLlib: a library of machine learning algorithms and pipelines.[6]
- pandas API on Spark: a pandas-compatible API that runs on Spark. It was added in Spark 3.2.0.[7]
- GraphX: graph processing.[1]
The R API (SparkR) is marked as deprecated in the Spark 4.3 documentation. Spark 4.3 runs on Java 17, 21 or 25, Scala 2.13 and Python 3.11 or later.[1]
A short PySpark example that reads a table and aggregates it:
from pyspark.sql import SparkSession
from pyspark.sql import functions as F
spark = SparkSession.builder.appName("example").getOrCreate()
orders = spark.read.table("sales.orders")
daily = orders.groupBy("order_date").agg(F.sum("amount").alias("revenue"))
daily.write.mode("overwrite").saveAsTable("sales.daily_revenue")
Spark Connect
Spark Connect is a client-server protocol, introduced in Spark 3.4, in which a thin client sends unresolved logical plans to a Spark server over gRPC and receives results as Apache Arrow batches.[8] The client does not run inside the driver process, so applications can run in IDEs, notebooks and services away from the cluster. Besides the Python and Scala clients in the main repository, the Spark project maintains separate Spark Connect clients for Go, Rust and Swift.[9][10][11] Spark 4.0 added a lightweight Python client package (pyspark-client) and the spark.api.mode setting, which lets a classic application switch to Spark Connect.[12]
Spark Declarative Pipelines
Spark Declarative Pipelines (SDP), added in Spark 4.1.0, is a framework in which a user declares datasets (streaming tables, materialized views and temporary views) and the flows that fill them, and Spark works out the dependency order, parallelism, checkpoints and retries.[13] Pipelines are run with the spark-pipelines command line tool.[14]
History
Spark started in 2009 as a research project at the AMPLab of the University of California, Berkeley, and was open sourced in early 2010. The project moved to the Apache Software Foundation in 2013.[15] The ASF announced on 27 February 2014 that Spark had graduated from the Apache Incubator to become a top-level project.[16]
| Version | Announced | Selected changes |
|---|---|---|
| 1.0.0 | 2014-05-30 | First release of the 1.x line[17] |
| 2.0.0 | 2016-07-26 | First, experimental release of Structured Streaming[17][4] |
| 3.0.0 | 2020-06-18 | First release of the 3.x line; adaptive query execution, dynamic partition pruning[17][18] |
| 3.4.0 | 2023-04-13 | Python client for Spark Connect[17][19] |
| 4.0.0 | 2025-05-23 | First release of the 4.x line; VARIANT type, SQL user-defined functions, pipe syntax, Arbitrary State API v2 (transformWithState)[17][12]
|
| 4.1.0 | 2025-12-16 | Spark Declarative Pipelines; Real-time Mode in Structured Streaming; SQL scripting and VARIANT enabled by default[17][13] |
| 4.2.0 | 2026-07-14 | SQL CHANGES clause for change data capture; Auto CDC in Declarative Pipelines[17][20]
|
| 4.3.0 | 2026-10-30 | Stateful queries in Real-time Mode; SCD Type 2 Auto CDC; start of a quarterly feature-release cadence[17][21] |
Older release lines continue to receive maintenance releases; Spark 4.2.1, 4.1.4 and 4.0.5 were announced on 27 October 2026, three days before 4.3.0.[22]
Use in an open lakehouse
Spark reads and writes lakehouse tables through table format connectors and its catalog plugin API. A catalog is registered by setting Spark properties under spark.sql.catalog.<name>; the Apache Iceberg documentation, for example, shows a catalog of type rest that talks to an Iceberg REST catalog.[23] Delta Lake is enabled with the io.delta.sql.DeltaSparkSessionExtension SQL extension and the DeltaCatalog session catalog.[24]
Because the table data sits in open formats such as Apache Parquet and the metadata sits in a catalog such as Unity Catalog or Apache Polaris, the same tables Spark writes can be queried by other engines, for example Trino or DuckDB. Spark is commonly used for the ingestion and transformation layers of a medallion architecture, with Apache Airflow or Spark Declarative Pipelines deciding when each step runs.
See also
- Spark Connect
- Spark Declarative Pipelines
- Structured Streaming
- Open lakehouse
- Apache Iceberg
- Delta Lake
- Apache Airflow
References
- ↑ 1.0 1.1 1.2 1.3 1.4 Spark Overview (Spark 4.3.0 documentation). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 2.0 2.1 2.2 2.3 2.4 Cluster Mode Overview (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ RDD Programming Guide (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 4.0 4.1 Spark Release 2.0.0. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark SQL, DataFrames and Datasets Guide (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ MLlib: Main Guide (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark Release 3.2.0. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark Connect Overview (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ apache/spark-connect-go. GitHub.Retrieved 2026-11-22.
- ↑ apache/spark-connect-rust. GitHub.Retrieved 2026-11-22.
- ↑ apache/spark-connect-swift. GitHub.Retrieved 2026-11-22.
- ↑ 12.0 12.1 Spark Release 4.0.0. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 13.0 13.1 Spark Release 4.1.0. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark Declarative Pipelines Programming Guide (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ History. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ The Apache Software Foundation Announces Apache Spark as a Top-Level Project. The ASF Blog, 2014-02-27.Retrieved 2026-11-22.
- ↑ 17.0 17.1 17.2 17.3 17.4 17.5 17.6 17.7 spark-website news posts. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark Release 3.0.0. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark Release 3.4.0. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark Release 4.2.0. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark Release 4.3.0. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark News. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark Configuration. Apache Iceberg.Retrieved 2026-11-22.
- ↑ Quickstart. Delta Lake.Retrieved 2026-11-22.