BlogApache Spark

Apache Spark

Releases, tutorials, and deep dives on Apache Spark from maintainers and practitioners across the open data ecosystem.

All Apache Spark posts

14 posts

Cover image for blog post: An Idiot's Guide to UDFs and UDTFs in Spark
Apache Spark

An Idiot's Guide to UDFs and UDTFs in Spark

UDFs in Spark are extremely complicated. In this blog I break down scalar, aggregate and table functions in PySpark, SQL, Scala and Java, elucidating some of the concepts in a way that is hopefully, somewhat of a digestible entry point.

Lisa Cao
Cover image for blog post: Apache Spark Metric Views: One Definition for Every Dashboard, Application, and AI Agent
Apache Spark

Apache Spark Metric Views: One Definition for Every Dashboard, Application, and AI Agent

Spark 4.2 made it a whole lot easier to define metrics once and query them consistently across an organization, including from dashboards, agents, and applications. They are already dead easy to use; in this blog I review metric views in Spark end to end for SQL lovers.

Lisa Cao
Apache Spark

The Top 10 Data Engines in 2026, and What Each One Is Actually For

A ranked guide to the ten data engines that matter in 2026 (Apache Spark, Flink, DuckDB, Trino, DataFusion, Polars, ClickHouse, StarRocks, Ray and Velox), what each is best at, where it falls short, and how to choose.

Lisa Cao
Cover image for blog post: Introducing Real-time Mode's Stateful Queries on Spark
Apache Spark

Introducing Real-time Mode's Stateful Queries on Spark

A walkthrough of Structured Streaming and the stateful queries Spark 4.3 adds to Real-time Mode, using a bookshop that re-ranks its recommendations on every click and measures latency in both micro-batch and Real-time execution.

Lisa Cao
Cover image for blog post: The Ultimate Guide to Apache Spark 4.3
Apache Spark

The Ultimate Guide to Apache Spark 4.3

Everything new in Apache Spark 4.3 and full feature breakdowns for stateful Real-time Mode, SCD Type 2 in Auto CDC, Project Feather, Spark Connect operation IDs and REST endpoints, DataFrame.zip and Python UDF transpilation, ASOF JOIN, JSON_TABLE, VARIANT edits, nanosecond timestamps and more.

Lisa Cao
Cover image for blog post: Spark Connect from Rust: Pull Spark outputs into DuckDB and Polars
Apache Spark

Spark Connect from Rust: Pull Spark outputs into DuckDB and Polars

A guide to using the Apache Spark Connect client for Rust to integrate spark with DuckDB and Polars: start a Spark 4.2 server, get a result out as Arrow, hand it to DuckDB 2.0 for an ASOF join and to Polars for a rolling window, and write the answer back to Spark.

Lisa Cao
Cover image for blog post: Building a Spark Connect Client in OCaml
Apache Spark

Building a Spark Connect Client in OCaml

How to build a Spark Connect client from the protocol up, in OCaml: compile the spark/connect protos, speak gRPC over HTTP/2 (ExecutePlan, AnalyzePlan, grpc-status-details-bin), build Relation and Expression plan trees with plan_id, decode the Arrow IPC batches each response carries, write Arrow for LocalRelation, and surface Spark error classes and SQLSTATEs. Includes the ocaml-protoc encoding bug behind 'Invalid protobuf byte sequence', a protocol coverage table tested on Spark 4.1.3, 4.2.0 and 4.3.0-rc1, and what the client still can't do.

Lisa Cao
Cover image for blog post: An Idiot's Guide to Spark Connect Clients
Apache Spark

An Idiot's Guide to Spark Connect Clients

Everything you need to go from "what is Spark?" to running jobs on a Spark Connect server from Python, Scala, Go, Rust or Swift, and working out what went wrong when it doesn't work.

Lisa Cao