Spark 4.x features by release: what shipped from 4.0 to 4.3 and what it costs
The Spark 4 line has shipped four minor releases in seventeen months. This is the overview: what each release brought, in a picture per release, with a deep-dive post for each. Releases are listed newest first.
- Three shifts behind the features
- The features, release by release
- Installing each release
- When these features bite
- Release cadence, support and connectors
- Which upgrades are worth it
- Frequently Asked Questions
- References
- Trademarks
TL;DR
- Four minor releases in about seventeen months, each with its own centre of gravity: a break with the past and a far more expressive SQL (4.0), pipelines and procedural SQL (4.1), new data types and joins (4.2), stateful low-latency streaming and history tracking (4.3).
- Newest release first, with one picture of every feature for each release and a line on what needs a flag or a connector. Every release has a deep-dive post with the syntax, the code before and with the release, and an illustration for each feature.
- Several headline features are off by default or need a connector. The text names the exact setting rather than implying they work out of the box.
- Removals, default changes and upgrade risks are in the release history post.
A Spark release note lists hundreds of tickets, and most of them have nothing to do with the job you run on Monday. Below are the features a data engineer meets in daily work across 4.0 to 4.3, one line each, with a link to a deep-dive post for the syntax and the before-and-after code.
Dates, tickets resolved and headline features of each release, and the days between releases.
4.0, 4.1 and 4.2 went through two, four and five preview builds. 4.3.0 had none (no 4.3.0-preview exists on Maven
Central or the Apache archive), so it has had the least outside testing, and the
patch releases that follow it are where the first corrections will land.
The deep-dive posts hold the code. Each feature there shows how you’d have written it before the release and how you write it with the release, and every code block links to a runnable file in the examples repo. Each post also has its own install steps for the release it covers.
Three shifts behind the features
Read the four release notes in order and they look like four unrelated lists. Read them as one line and three decisions run through all of them, which is also why some features arrive in pieces over two or three releases.
Each lane is one shift; each box is what that release added to it.
SQL becomes the main surface again
For a decade the work went into the DataFrame API. The fourth line turns back to SQL and adds constructs that other SQL engines have and Spark did not.
| Capability | 4.0 | 4.1 | 4.2 | 4.3 |
|---|---|---|---|---|
| New query syntax | Pipe syntax (SPARK-49555) | Recursive CTEs (SPARK-24497), query parameter markers anywhere (SPARK-53573) | QUALIFY (SPARK-31561), NEAREST BY join (SPARK-56395) |
ASOF JOIN (SPARK-58092), JSON_TABLE (SPARK-58366), UNNEST in FROM (SPARK-58419) |
| Procedural SQL | Session variables (SPARK-42849), SQL user-defined functions (SPARK-46057) | SQL scripting, enabled by default (SPARK-54499) | Cursors in scripting (SPARK-54759) | none in the headlines |
| Data types | VARIANT (SPARK-45827), string collations (SPARK-46830) |
VARIANT generally available (SPARK-54454) |
GEOMETRY and GEOGRAPHY (SPARK-51658) |
VARIANT editing functions (SPARK-57804), nanosecond timestamps in preview (SPARK-56876) |
| Name resolution | none | none | SET PATH and CURRENT_PATH() (SPARK-54806, behind a flag) |
none |
Teams used to write logic in Python or Scala because SQL could not express it, and paid for it in code analysts could not read and the optimiser could not see through. Putting the constructs into the language fixes that. The cost is that each one is another thing the parser, analyzer and optimiser must keep correct, and several arrive behind a flag first.
Batch and streaming converge on one declarative layer
Streaming and batch meet in one declarative layer, and the streaming side gets a second, lower-latency mode.
| Capability | 4.0 | 4.1 | 4.2 | 4.3 |
|---|---|---|---|---|
| Pipelines | none | Spark Declarative Pipelines (SPARK-51727) | Auto CDC, SCD Type 1 (SPARK-56249) | Auto CDC, SCD Type 2 (SPARK-58321 and others) |
| Change data | none | none | CHANGES clause and DataFrame APIs for row-level changes (SPARK-55668) |
consumed by Auto CDC SCD Type 2 |
| Streaming latency | Arbitrary state API v2, state data source | Real-time mode, stateless (SPARK-53736) | none in the headlines | Real-time mode with state: aggregation, dropDuplicates, transformWithState (SPARK-58635 and others) |
| Writes | none | stored procedures API for catalogs (SPARK-44167) | Data Source V2 transaction management (SPARK-55855) | dynamic table options for UPDATE, MERGE, DELETE |
A pipeline used to need an orchestrator for ordering, a streaming job for freshness and hand-written merge logic for change data, written in different dialects by different teams. Declaring the datasets and letting Spark derive the graph removes that, and the cost is that you hand the execution graph to the framework: when a run behaves oddly, the schedule is not code you wrote. An external orchestrator with micro-batch triggers is still the better fit for pipelines that mix many engines.
Python and Connect move off the JVM path
The client and the Python runtime change along with the API.
| Capability | 4.0 | 4.1 | 4.2 | 4.3 |
|---|---|---|---|---|
| Spark Connect | A lightweight Python client, ML over Connect | JDBC driver for Connect (SPARK-53484), ML on Connect generally available for Python (SPARK-51236) | RDD API compatibility (SPARK-55227) | REST endpoints for sessions and operations (SPARK-57941), more complete JDBC driver |
| Python UDFs | Polymorphic UDTFs, unified UDF profiling | Arrow-native UDF and UDTF decorators (SPARK-52214, SPARK-52979) | Arrow-optimized UDFs and Arrow IPC on by default (SPARK-54555) | Experimental transpiling of simple UDFs (SPARK-55206) |
| Python data | Python Data Source API (SPARK-44076), plotting API (SPARK-49530) | filter pushdown for Python data sources | grouped-aggregation UDFs in Arrow and pandas | none in the headlines |
| Small data | none | none | none | opt-in single-task execution and Arrow-native caching (SPARK-57851, SPARK-57268) |
Python was the most used language and the slowest path through Spark, because every
row crossed the JVM boundary through pickling, and a client that only talks to a
server still needed a full PySpark install. The fix is Arrow end to end, a thin
client (4.0 added a 1.5 MB pyspark-client), and a server reachable by JDBC and
REST. A default that changes how data crosses the boundary changes behaviour at the
edges, in types, nulls and timestamps, which is why 4.2 is the release to test on
your own UDFs.
The features, release by release
Each release below has one picture of every feature, what it replaces and what you write now, a line on what needs a flag or a connector, and a link to its deep-dive post.
Connectors are the usual surprise. A feature that exists in Spark SQL
does not exist for your table until the connector for that table supports it, which
is true of change data capture, data source transactions and several INSERT
extensions.
The code for every feature is in ranga-spark4-examples, organised by release: spark-4.0/, spark-4.1/, spark-4.2/ and spark-4.3/. Each deep-dive post links the file behind each code block.
Spark 4.3: stateful real-time mode, semi-structured SQL, and history tracking
Everything in Spark 4.3.
Stateful queries move onto the real-time trigger, SQL gains standard answers for JSON, time series and history tracking, and several new types sit behind flags. 4.3.0 shipped without preview builds, so a cautious team waits for the first patch release.
Deep dive: What’s new in Apache Spark 4.3, with the syntax, the code before and with the release, and an illustration for each feature.
Flags and connectors. ASOF JOIN, BIN BY, TIME(p), nanosecond timestamps (a preview), single-task execution, the Arrow-native cache, the archive reader and experimental Python UDF transpiling are off until you set their flags. Auto CDC with SCD Type 2 needs a connector with row-level operations. Stateful real-time mode needs a free task slot for every task. JSON_TABLE works in its flat form only. Everything else works as is.
Also in 4.3, listed in the release notes:
- Project Feather: opt-in shuffle-free single-task execution and Arrow-native caching for small data (the two flags are in the 4.3 settings table)
- Items that need a connector:
@time travel on table names (SPARK-57421,SPARK-58012) and dynamic table options forUPDATE,MERGEandDELETE - Spark Connect REST endpoints (
SPARK-57941), operation IDs for tracing, and a JDBC driver that returnsARRAY,MAPandSTRUCT timestamp_nanosandunix_nanos, andVARIANTfield-extraction pushdown for aggregate, sort and join queries- Default whole-stage code generation for eligible
UNIONs, opt-in null join key spreading for outer and anti joins, and pruning of unused fields inside arrays of structs
Spark 4.2: new types, new joins, and a clearer SQL surface
Everything in Spark 4.2.
Spatial types, vector distance functions and a top-K join arrive in the engine, alongside SQL for filtering windows, resolving names and defining metrics once. Three of the headline items, change data capture, INSERT ... WITH SCHEMA EVOLUTION and Data Source V2 transactions, are defined by the engine but implemented by a connector, so built-in sources cannot show them.
Deep dive: What’s new in Apache Spark 4.2, with the syntax, the code before and with the release, and an illustration for each feature.
Flags and connectors. SET PATH is off until spark.sql.path.enabled is set, and cursors need two internal flags. The CHANGES clause needs a connector that implements change data capture. NEAREST BY is brute force today, and the geospatial types come with five functions. Everything else works as is.
Also in 4.2, listed in the release notes:
- Items that need a connector: the
CHANGESclause and CDC APIs (SPARK-55668),INSERT ... WITH SCHEMA EVOLUTIONandREPLACE ON/USING(SPARK-54971,SPARK-56001), and Data Source V2 transactions (SPARK-55855) - Tuple sketches, and broader
TIMEsupport across file formats SYSTEM.BUILTINandSYSTEM.SESSIONqualification for built-in functions and temporary views- Arrow-optimized Python UDFs on by default (
SPARK-54555), so test your own UDFs before trusting it, and zero-copy hand-off of DataFrames to Polars or DuckDB through the Arrow C Data Interface - Auto CDC with SCD Type 1 (
SPARK-56249), and stateless PySpark queries in real-time mode - Spark Connect: RDD API compatibility, YARN cluster mode, and DataFrame inputs to
spark.read.* - Faster
MERGE INTO, operation summaries forUPDATEandDELETE, a web UI rebuilt on Bootstrap 5 with dark mode, heterogeneous Kubernetes executors, Spark History Server scalability, and JDK 25 support
Spark 4.1: pipelines, procedural SQL, and real-time mode
Everything in Spark 4.1.
Pipelines become declarative, SQL gains scripts and recursion, and Structured Streaming gets a real-time trigger for stateless Scala queries on Kafka.
Deep dive: What’s new in Apache Spark 4.1, with the syntax, the code before and with the release, and an illustration for each feature.
Flags and connectors. None of the headline features needs a flag, and only CONTINUE handlers in scripting sit behind an internal one. Declarative Pipelines run through the spark-pipelines CLI and its Python packages, Arrow-native UDFs need pyarrow, and real-time mode is stateless and Scala only.
Also in 4.1, listed in the release notes:
CONTINUE HANDLERand multi-variableDECLAREin SQL scripting, and shredding for fasterVARIANTreads- Spark ML on Connect generally available for Python, zstd compression for protobuf plans, chunked Arrow result streaming, and no 2 GB limit on local relations
python_worker_logs()to query Python worker logs, and filter pushdown for Python data sources throughpushFilters- A JDBC driver for Spark Connect (
SPARK-53484)
Spark 4.0: the break, and a far more expressive SQL
Everything in Spark 4.0.
Scala 2.13 and Java 17 become the baseline, ANSI mode turns on by default, and SQL gains a type for JSON, functions, variables, collations and a top-to-bottom syntax.
Deep dive: What’s new in Apache Spark 4.0, with the syntax, the code before and with the release, and an illustration for each feature.
Flags and connectors. None of the headline features needs a flag. Some need a package or a state store instead: the Python Data Source API and UDTFs need pyarrow, and transformWithState needs the RocksDB state store and protobuf. VARIANT becomes generally available in 4.1.
Also in 4.0, listed in the release notes:
transformWithStatefor custom stateful processing in Scala, Java and Python, the state data source reader, and state store improvements such as SST file reuse- Polymorphic Python UDTFs whose output schema is decided at call time
- Named and unnamed parameter markers for parameterized queries
- Structured JSON logging
- A 1.5 MB lightweight Python client,
spark.api.modeto switch Connect on, and community Spark Connect clients for Go, Swift and Rust - Native Plotly-based plotting on PySpark DataFrames (
SPARK-49530) - Java 21 support, the Spark Kubernetes operator (
SPARK-45923), Spark ML on Connect, and unified PySpark UDF profiling
Installing each release
Each deep-dive post opens with the install steps for its own release, by pip and from the release tarball, with the Java and Python versions it needs. The Python floor moves up as the line goes on, so check it before you pick a release.
| Line | Latest patch | Python for PySpark | Install steps |
|---|---|---|---|
| 4.0 | 4.0.5 | 3.9 or newer | 4.0 post |
| 4.1 | 4.1.4 | 3.10 or newer | 4.1 post |
| 4.2 | 4.2.1 | 3.10 or newer | 4.2 post |
| 4.3 | 4.3.0 | 3.11 or newer | 4.3 post |
A machine with Python 3.9 can run the SQL and Scala examples on all four releases, and the PySpark examples on 4.0 only.
When these features bite
Almost every failure in this line falls into five shapes: a stricter default, a feature that parses and then does nothing, a feature that is off until you switch it on, a Python environment that is not ready, and real-time mode with no free slots. Each deep-dive post lists the failures for its release, with the text each one prints, the cause and the fix, so you can search for it: 4.0, 4.1, 4.2 and 4.3. The same posts list the settings that gate each feature and what to budget for under Settings and costs.
Release cadence, support and connectors
Cadence. The versioning policy makes 4.3.0 the first quarterly feature release: feature releases come every three months and majors annually. Its maintenance windows are 6 months for a major or feature release and 18 months for a long-term-support (LTS) release. The 4.x LTS is planned as 4.5.0, and the policy keeps the existing 18-month commitment for 4.2.x. It lists a 4.4 branch cut on 16 November 2026 with a first release candidate by 7 December 2026, and a tentative 4.5 in February 2027, all subject to discussion on the dev list. Patch releases have run longer than the stated windows, for example 4.1.4 on 27 October 2026, ten months after 4.1.0, so read a window as a minimum.
Connectors. Connector jars are built per Spark minor version and Scala version, so check that every artifact in your spark.jars.packages has a build for the release you want before you upgrade. Each deep-dive post has a small script that asks Maven Central, in its upgrade checklist, for example the 4.1 one.
Which upgrades are worth it
Upgrade by upgrade
These are judgement calls, not measurements.
- To 4.0. Not optional once you leave 3.x, because Scala 2.13 and Java 17 are the baseline. The work is dependency and ANSI-mode testing, and the language gains (pipe syntax, SQL functions, session variables, collations) come with it.
- 4.0 to 4.1. Worth it for SQL scripting, recursive CTEs and
VARIANTcolon paths if you have logic living in driver code. Declarative Pipelines is worth a trial on one pipeline, withdry-run, before you commit a team to it. - 4.1 to 4.2.
QUALIFYand metric views pay back quickly for analysts. The geospatial types are a start rather than a finished toolkit: five functions today, no distance or containment. - 4.2 to 4.3.
JSON_TABLE,UNNESTand theVARIANTediting functions help any pipeline that handles nested documents. Stateful real-time mode is for the few queries that need sub-second latency and a Kafka source. 4.3.0 shipped without preview builds, so a cautious team waits for the first patch release.
Before you upgrade
- Test in this order: ANSI errors on your real data first, then the gating settings listed in each release’s post for anything a job relies on, then the Python environment.
- Pin the interpreter and the packages with the release. The Python floor moved from 3.9 to 3.11 across the four releases.
- Switch on one flag at a time, in the session that uses it rather than cluster-wide, so a failure points at the feature.
- Check the connector before the engine. For Auto CDC,
CHANGES, schema evolution and transactions, the connector decides whether the feature exists for your table. - Print
spark.versionat the top of every run. It is the cheapest check against running the wrong install. - Read the migration guides. The official SQL and PySpark guides list far more default changes than any release post, each with the setting that restores the old behaviour.
The versioning policy now plans a feature release every three months, so treat the pictures and tables here as a snapshot, re-check each feature against the release note of the version you deploy, and keep the example files in the examples repo as a test you can rerun on the next release.
Frequently Asked Questions
Which Spark 4 release should I move to first?
Move to 4.0 first if you’re on 3.x, because Scala 2.13, Java 17 and ANSI mode change there and everything later builds on it. After that, 4.1 is the usual next step. Use the latest patch of whichever line you pick.
What are the biggest changes between Spark 4.0 and 4.3?
4.0 sets the baseline and the SQL building blocks, 4.1 adds pipelines, scripting and recursion, 4.2 adds new types, joins and change data capture, and 4.3 adds stateful real-time mode and more standard SQL such as JSON_TABLE and ASOF JOIN.
Which features need a flag or a connector?
Most are in 4.2 and 4.3. The headline features of 4.0 and 4.1 need no flag, apart from CONTINUE handlers in 4.1 scripting, though some need a package or a state store. The deep-dive post for each release lists the exact setting or the connector requirement for every feature, in its “Features at a glance” table and its settings section.
What Python version do I need?
3.9 or newer for 4.0, 3.10 or newer for 4.1 and 4.2, and 3.11 or newer for 4.3.
Where is the code for each feature?
Every deep-dive post links a runnable file for each code block, all in the examples repo.
Does 4.3 have patch releases yet?
Not at the time of writing. 4.3.0 shipped without preview builds, so a cautious team waits for the first patch release.
References
- ranga-spark4-examples with the runnable examples for each release
- Spark 4.0.0 release notes, 4.1.0, 4.2.0 and 4.3.0 for the feature lists and ticket numbers used throughout
- Every Apache Spark release, and the problem each one was built to solve for removals, changed defaults and upgrade risks
- Spark Connect: the driver becomes a server for the client and server split behind the thin client and the pipelines CLI
- Structured Streaming internals for state and checkpoints behind real-time mode
- JOIN syntax, including
NEAREST BY,QUALIFYandSET PATHin the 4.2.1 documentation JSON_TABLE,ASOF JOINandUNNESTin the 4.3.0 documentation- Spark Declarative Pipelines programming guide for the project spec, the CLI, and Auto CDC with its target requirements
RealTimeModeAllowlist.scalafor the sources, sinks and operators real-time mode accepts- Apache Spark downloads and archive for the release tarballs and their checksums
- SQL migration guide and PySpark migration guide, the source of the behaviour-change tables in the release posts
- Apache Spark versioning policy, for the quarterly cadence and the maintenance windows
Trademarks
Apache Spark, Apache Kafka, Apache Parquet, Apache Arrow and Apache are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
Found this useful?
These posts and tools are free. If one saved you an afternoon, you can buy me a coffee.
Comments
Questions, corrections and reviews are welcome. Sign in with GitHub to post; comments are stored in this site's public GitHub Discussions.