Skip to content

perf: share Iceberg ArrowReader across scan partitions - #817

Merged
alexanderbianchi merged 1 commit into
datafusion-contrib:mainfrom
alexanderbianchi:codex/share-iceberg-arrow-reader
Oct 30, 2026
Merged

alexanderbianchi merged 1 commit into
datafusion-contrib:mainfrom
alexanderbianchi:codex/share-iceberg-arrow-reader

Conversation

@alexanderbianchi

Copy link
Copy Markdown
Collaborator

Iceberg scans currently build a new ArrowReader for every output partition, giving each partition a separate delete-file cache. Retain a reader in the shared scan configuration and clone it when opening partitions, so eager and lazy scans reuse loaded deletes within a process.

Reader settings are captured from the context when planning or reconstructing a scan. Worker decoding still constructs its own reader with worker-local FileIO, runtime, and settings. Source clones and regrouped eager scans share that reader; the wire format is unchanged.

Validation:

  • Added a regression test with two data files sharing a position-delete file. After the first partition loads the deletes, the test removes the delete file and verifies the second partition still applies its deletion. Confirmed this fails with per-partition reader construction.
  • Iceberg crate tests with the integration feature, including distributed eager/lazy execution.
  • Formatting and Clippy with warnings denied.

Draft pending performance qualification; no end-to-end speedup is claimed.

@alexanderbianchi
alexanderbianchi marked this pull request as ready for review October 28, 2026 23:56
}

/// Two data files, each with its first row removed by one shared delete file.
fn files_with_shared_deletes(directory: &TempDir) -> Result<DeleteFixture, Box<dyn Error>> {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabotechs this should be easier with your new harness

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Yeah, I think this is a good opportunity to add support for delete files in the harness, I see it's still not done here.

@gabotechs gabotechs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good. I'd give it a try to add support for building delete files in the harness, but otherwise looks good.

@alexanderbianchi
alexanderbianchi force-pushed the codex/share-iceberg-arrow-reader branch from 0f0835e to 0092688 Compare October 30, 2026 18:13
@alexanderbianchi
alexanderbianchi merged commit ba454c0 into datafusion-contrib:main Oct 30, 2026
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants