World Congress 2025 Aug 20, 2025 Session details

Let's Get Aggregated: Custom UDAFs in Spark

Nikolai Nikolaev

Stop letting expensive data shuffles bottleneck your Spark workflows. Custom UDAFs pre-aggregate data locally, condensing complex analytics into a single highly performant shuffle.

Pause
Mute Enter Fullscreen
#1 about 3 min

Motivations for custom aggregation functions in large datasets

Standard aggregation functions often fall short when processing complex analytical workloads across billion-row datasets.

#2 about 2 min

Defining the core methods of user-defined aggregator functions

Custom aggregations require implementing zero, reduce, merge, and finish functions alongside appropriate encoders.

#3 about 2 min

Understanding distributed execution and the necessity of pre-aggregation

Executing custom aggregations in a distributed framework minimizes network data shuffling by pre-aggregating data locally on executors.

#4 about 3 min

Analyzing baseline performance issues in standard word count techniques

Standard approaches to grouping and windowing functions generate multiple expensive data shuffles within the execution plan.

#5 about 4 min

Designing custom aggregation workflows for efficient frequency mapping

Defining specialized types and mapping logic allows for streamlined reduction and merging phases without repetitive native queries.

#6 about 3 min

Implementing core zero, reduce, merge, and finish functions

Developing each stage involves tracking frequencies in mapped structures and handling null checks within encoders.

#7 about 2 min

Comparing execution plans to benchmark reduced data shuffling

Executing the user-defined aggregation produces an optimized execution plan featuring only a single data shuffle operation.

#8 about 2 min

Leveraging complex data structures in production aggregation workflows

Utilizing case classes as buffers and output values enables calculating multiple metrics reliably within a single operation.

#9 about 3 min

Optimal scenarios for deploying custom defined aggregator functions

Custom functions optimize complex aggregation performance, enable code reusability across teams, and integrate seamlessly with Spark SQL APIs.

Matching moments

3:33 min

Refactoring data science workflows using Rapids QDF and Pandas

Paul Graham Paul Graham · LIVE

3:49 min

Understanding RDDs, DataFrames, and Datasets in Spark

Ayon Roy · LIVE

2:04 min

Comparing offline data analytics with online stream processing

Artem Volk Artem Volk +1 · WWC 2024

4:06 min

Pre-calculating data aggregates using event-driven methodologies

Luka Samaržija +1 · LIVE

2:34 min

Capabilities of the Apache Spark processing engine

Ayon Roy · LIVE

1:21 min

Summary of decoupling analytical compute and storage

Matthias Niehoff Matthias Niehoff · WWC Europe 2026

Upcoming sessions on this topic

Open session

World Congress 2026 North America

Ship 10x Faster: AI-Powered Development with Claude Code and MCP Tools

Viktoria Semaan

Principal Technical Evangelist at Databricks

Viktoria Semaan
Open session

World Congress 2026 North America

AI Agents are Only as Smart as their Context: Building a Real-Time Context Engine at Intuit

Bharat Patel

Lead Software Engineer at Intuit

Bharat Patel
Open session

World Congress 2026 North America

The spectrum of agentic coding: From vibe coding to high-quality software engineering

YK Sugi

Developer Experience Manager at Eventual

YK Sugi
Open session

World Congress 2026 North America

From Guesswork to Governance: Data Contracts Bring API Discipline to Apache Kafka

Sandon Jacobs

Senior Developer Advocate at IBM

Sandon Jacobs
Open session

World Congress 2026 North America

public void saveMoney(AI): The Developer's Guide to Unit Economics

Hrushikesh Pokala

Senior Software Engineer Lead at Equifax

Hrushikesh Pokala
Open session

World Congress 2026 North America

Compute for your AI model: GPUs, LPUs, TPUs and beyond..

Kushaagra Goyal

Tech Lead at Rubrik, ex-CTO at Gan.AI, ex-Databricks

Kushaagra Goyal