Session

What’s New in Apache Spark™ 4.1?

Overview

ExperienceIn Person
TrackData Engineering & Streaming
IndustryEnterprise Technology
TechnologiesDatabricks SQL
Skill LevelIntermediate
DOWNLOAD SESSION SLIDES

Explore the exciting new features of Apache Spark 4.1 with major new capabilities for both data engineering and analytics workflows. We introduce Spark Declarative Pipelines (SDP) to let users define what their data pipelines should accomplish while Spark orchestrates execution, dependencies, parallelism and retries, an official Real-Time Mode in Structured Streaming for sub-second, continuous low-latency processing, and extensive improvements to the PySpark ecosystem with Arrow-native UDFs/UDTFs, Python Data Source filter pushdown, and better Python worker logging. The release also brings Spark Connect enhancements including GA support for Spark ML on the Python client and increased stability for large workloads, and expands SQL support with GA SQL Scripting, the VARIANT type with shredding optimizations, support for recursive CTEs, and new approximate data sketch functions. Spark 4.1 prioritizes higher-level abstractions, real-time performance, richer Python support, and more.

Session Speakers

Daniel Tenedorio

/Sr. Staff Software Engineer
Databricks

Wenchen Fan

/Senior Staff Software Engineer
Databricks

Full Summary

What's new in Apache Spark 4.1: declarative pipelines, real-time streaming, and SQL upgrades

Apache Spark turns 12 with a release that tightens its promise of one unified engine across batch, streaming, and ML. Version 4.1 ships meaningful upgrades in four areas: declarative pipelines, a new real-time mode for Structured Streaming, substantial SQL language and type enhancements, and production hardening for Spark Connect and PySpark.

FAQ


No. Real-time mode is an opt-in trigger for millisecond latency scenarios. Micro-batch remains appropriate for most ETL and analytics streaming jobs. Both run on the same Spark engine and API.

The 4.1 release supports the Scala API, stateless operators, and Kafka integration. Python APIs and stateful operator support are planned for the next two releases.

Change the streaming trigger to the new real-time trigger and provide a batch duration. The rest of your Structured Streaming code remains the same.

Use variant for JSON or other semi-structured data with evolving or per-record schemas. If your schema is stable and well defined, traditional structured columns are simpler and typically more efficient.

Sketches trade a small, bounded error for predictable memory and speed. They produce mergeable buffers that you can store and combine later, enabling incremental rollups for top-K, quantiles, and distinct counts over very large datasets.