datafusion-ballista icon indicating copy to clipboard operation
datafusion-ballista copied to clipboard

[EPIC] Production-grade Apache Iceberg scans

Open andygrove opened this issue 4 months ago • 11 comments

Goal

Make Apache Iceberg scans a first-class Ballista workload: correct across the client, scheduler, and executors; parallel on a real cluster; efficient for large and skewed tables; and observable and testable enough to prevent performance regressions.

This supersedes the narrower request in #890 for tracking purposes. The broader policy discussion for open table formats remains in #1241.

Current status

Draft PR #2217 adds an iceberg-ballista integration with logical and physical extension codecs, table/catalog reconstruction, and distributed integration tests. It is currently blocked on upstream iceberg-datafusion work and still notes that reads are not split across executors because the scan exposes a single output partition.

Upstream work:

  • apache/iceberg-rust#2671 / apache/iceberg-rust#2220: opt-in eager file planning and multiple DataFusion output partitions
  • apache/iceberg-rust#2962: size-aware grouping of scan tasks
  • apache/iceberg-rust#2963: reuse planning results across equivalent scans
  • apache/iceberg-rust#1604: prior row-group/sub-file parallelism design (closed as not planned, retained as design context)

Workstreams

1. Integration foundation

  • [ ] Land the standalone Iceberg integration and codec support in #2217
  • [ ] Support a real scheduler with multiple executors, not only in-process execution
  • [ ] Document how to register a table/catalog and run distributed Iceberg queries
  • [ ] Keep the integration isolated from Ballista's core release/dependency graph as agreed in this issue's discussion

2. Distributed scan planning

  • [ ] Consume upstream multi-partition scan support from apache/iceberg-rust#2671
  • [ ] Propagate the Iceberg scan's output partitioning through Ballista without collapsing it to one task
  • [ ] Verify that work is distributed across multiple executors
  • [ ] Balance partitions by estimated bytes rather than file count (apache/iceberg-rust#2962)
  • [ ] Define the path for sub-file/row-group parallelism so tables with a few large files can still use the cluster effectively

3. Pruning and planning efficiency

  • [ ] Preserve projection and filter pushdown across Ballista plan serialization
  • [ ] Verify snapshot, manifest, partition, file, and row-group pruning with scan metrics
  • [ ] Preserve delete-file association and Iceberg correctness semantics in every partition
  • [ ] Avoid repeated manifest/file planning for equivalent scans (apache/iceberg-rust#2963)
  • [ ] Ensure metadata planning does not become a scheduler bottleneck for tables with many manifests/files

4. Correctness and resilience

  • [ ] Test partitioned and unpartitioned tables
  • [ ] Test schema evolution and time travel
  • [ ] Test position and equality deletes where supported upstream
  • [ ] Test empty scans, limits, selective filters, and scans with fewer files than target partitions
  • [ ] Test executor loss/retry without duplicate, missing, or inconsistent results
  • [ ] Keep Iceberg extension codecs composable with other Ballista extensions

5. Production object-store access

  • [ ] Support the credential flows needed by REST catalogs and vended, short-lived, or path-scoped S3 credentials; coordinate with #2532
  • [ ] Ensure credentials and catalog properties are redacted from logs and debug output
  • [ ] Exercise a REST catalog and S3-compatible object store in end-to-end tests

6. Performance and observability

  • [ ] Add reproducible multi-executor scan benchmarks covering many small files, balanced large files, skewed files, and highly selective filters
  • [ ] Compare direct DataFusion/Iceberg execution with Ballista to isolate distribution overhead
  • [ ] Report scan partitions, planned files/bytes, pruned files/bytes, manifest-planning time, and per-partition read time
  • [ ] Add a regression baseline and document expected scaling as executors are added

Acceptance criteria

This epic is complete when:

  1. A multi-file Iceberg scan fans out across multiple Ballista executors and returns the same results as direct DataFusion/Iceberg execution.
  2. Projection, filter, snapshot/time-travel, partition pruning, and delete semantics survive client-to-scheduler-to-executor plan transport.
  3. Scan task assignment is size-aware, and no single output partition becomes a major straggler solely because file sizes differ.
  4. Equivalent scans do not repeatedly perform avoidable manifest/file planning.
  5. End-to-end tests cover a REST catalog plus an S3-compatible store, including executor retry.
  6. Benchmarks and scan metrics make correctness, pruning effectiveness, planning cost, distribution, and scaling visible.
  7. User documentation provides a supported setup and a complete distributed-read example.

Non-goals

  • Making Iceberg a dependency of Ballista's core crates
  • Tracking distributed Iceberg writes in this epic, except where shared codec or correctness work is required for scans
  • Reimplementing Iceberg scan planning inside Ballista when the capability belongs in iceberg-rust / iceberg-datafusion

Background

The original request was to bring the Ballista integration proposed in apache/iceberg-rust#2613 into the Ballista ecosystem with a separate crate and release cadence. That remains the intended integration boundary.

andygrove avatar Jul 24 '26 18:07 andygrove

@milenkovicm I was thinking we could add a separate crate (not part of main workspace) and have independent release cycle so that it doesn't impact current Ballista release cycle

andygrove avatar Jul 24 '26 18:07 andygrove

Same like python support, good idea

milenkovicm avatar Jul 24 '26 19:07 milenkovicm

Sounds good to me. I can close my PR on iceberg-rust and re-open it here if that works with everyone? We can merge it in once I get the necessary iceberg-datafusion changes in. ** Given that the changes are tightly coupled to the Iceberg-Datafusion changes, I'm going to migrate the PR once those get merged in as it is more convenient.

NoahKusaba avatar Jul 25 '26 15:07 NoahKusaba

+1

martin-g avatar Jul 25 '26 20:07 martin-g

+1 Would like to contribute and then test Ballista on my current workloads :)

sandugood avatar Jul 26 '26 13:07 sandugood

This makes sense to me!

phillipleblanc avatar Jul 27 '26 00:07 phillipleblanc

Opened the PR at https://github.com/apache/datafusion-ballista/pull/2217 It's slow going getting the iceberg-datafusion changes merged in, so currently it's pointed to my iceberg-rust branch.

NoahKusaba avatar Aug 01 '26 21:08 NoahKusaba

@andygrove can we also look to moving the iceberg-datafusion crate out of iceberg-rust? It seems their team is interested in doing so as well. Currently getting PR's merged in is an extremely slow process due to lack of reviewers. Not sure where it would end up living.

NoahKusaba avatar Aug 05 '26 17:08 NoahKusaba

@andygrove datafusion-distributed is also looking to get iceberg-datafusion out of iceberg-rust, or to fork and maintain their own copy. https://github.com/datafusion-contrib/datafusion-distributed/issues/533 I think it's extremely important that we move it to datafusion-contrib, so we don't end up with a bunch of forks of this library.

NoahKusaba avatar Aug 10 '26 11:08 NoahKusaba

https://github.com/apache/iceberg-rust/discussions/2992

Discussion you might be interested in

milenkovicm avatar Aug 12 '26 19:08 milenkovicm

Off the top of my head, with https://github.com/apache/datafusion-iceberg/pull/20 merging, nothing is blocking standalone table scans now. I'm opting to wait for https://github.com/apache/datafusion-iceberg/pull/48, which is waiting on some other repo-wide refactors that are in progress, as I'll have to refactor after the fact anyway.

I'll look to split out the standalone table-scan PR for iceberg in the coming weeks, which also sets the skeleton for table appends too.

NoahKusaba avatar Oct 10 '26 04:10 NoahKusaba