Skip to content

feat: size Iceberg scans from pruned file work - #787

Open
alexanderbianchi wants to merge 4 commits into
feat/iceberg-eager-file-planningfrom
alex.bianchi/iceberg-pruned-task-count
Open

alexanderbianchi wants to merge 4 commits into
feat/iceberg-eager-file-planningfrom
alex.bianchi/iceberg-pruned-task-count

Conversation

@alexanderbianchi

@alexanderbianchi alexanderbianchi commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

For opt-in eager Iceberg file planning, retain selected file bytes, optional row counts, and whether a predicate or delete files can change output cardinality. Use those planned-file statistics rather than whole-snapshot totals and cap the desired distributed scan task count by available file work. Empty plans report exact zero rows; filtered or delete-bearing scans do not claim exact row counts. With eager planning off, existing snapshot-based estimation remains unchanged.

This is the file-statistics/task-sizing portion of DataDog#30 that was intentionally excluded from upstream #773. It does not introduce byte-balanced assignment, column-byte join costing, or worker routing.

Stack

Based on #773, then #786, then upstream main. Review only the base-to-head diff.

Validation

  • cargo fmt --all -- --check
  • cargo test -p datafusion-distributed-iceberg --features integration
  • cargo clippy -p datafusion-distributed-iceberg --features integration --all-targets -- -D warnings

Tests cover manifest totals when snapshot summaries are missing, filtered/inexact statistics, selected-file counts and bounded task sizing. No performance claim. Developed with AI assistance.

@alexanderbianchi
alexanderbianchi added this pull request to stack #791 October 20, 2026 14:58
@alexanderbianchi
alexanderbianchi force-pushed the alex.bianchi/iceberg-pruned-task-count branch from f75ccd2 to c5f96f5 Compare October 20, 2026 23:22
@alexanderbianchi
alexanderbianchi removed this pull request from stack #791 October 21, 2026 00:17
@alexanderbianchi
alexanderbianchi force-pushed the alex.bianchi/iceberg-pruned-task-count branch from c5f96f5 to cbefc78 Compare October 21, 2026 00:17
@alexanderbianchi
alexanderbianchi added this pull request to stack #794 October 21, 2026 00:18
@alexanderbianchi
alexanderbianchi force-pushed the alex.bianchi/iceberg-pruned-task-count branch from cbefc78 to 09db90e Compare October 21, 2026 00:20
@alexanderbianchi
alexanderbianchi marked this pull request as ready for review October 21, 2026 05:08
@alexanderbianchi
alexanderbianchi force-pushed the alex.bianchi/iceberg-pruned-task-count branch from 6f68dad to 3c25b55 Compare October 21, 2026 05:28

@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.

👍 nice!

.map(|count| {
let count = node
.planned_file_count()
.map_or(count, |files| count.min(files as f64));

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.

🤔 So we cannot byte-range split files here no?

It'd be great if somehow at some point we could use native DataFusion parquet reads for Iceberg.

Comment on lines +46 to +57
.configure_session(|mut state| {
let mut config = IcebergConfig::default();
config.eager_file_planning = true;
state
.config()
.get_or_insert_default()
.options_mut()
.extensions
.insert(config);
Ok(state)
})?
.build()

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.

This occupies a fair amount of real-state, but the only important bit for a test reviewer is:

                config.eager_file_planning = true;

Maybe we can add one more helper that says:

.iceberg_config_mut(|&mut iceberg_cfg| { ... })

Or something like:

.with_eager_file_planning()

This branch has not been deployed

No deployments
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