Skip to content

feat: Scan planning counters - #3732

Open
DerGut wants to merge 1 commit into
apache:mainfrom
DerGut:scan-planning-counters
Open

DerGut wants to merge 1 commit into
apache:mainfrom
DerGut:scan-planning-counters

Conversation

@DerGut

@DerGut DerGut commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Works toward #1466 to implement Metrics Reporting for Rust clients:

flowchart LR
    A["#3709: Reporter API"] --> C["#3736: Scan reporting"]
    B["This PR: Planning counters"] --> C
    C --> D["Follow-ups"]

    click A href "https://github.com/apache/iceberg-rust/pull/3709" _blank
    click C href "https://github.com/apache/iceberg-rust/pull/3736" _blank
Loading

What changes are included in this PR?

Implements scan metrics for the simple case. This means it instruments the number of manifest, data and delete files read/ skipped, the number of bytes selected and more (16 counters - the one's that Java also sends for parity).

There are some edge-cases about early stops in scan planning that I'm deliberately leaving out of this PR to keep it small. Will follow-up on it. Also, the wiring into the public API from #3709 will come in a follow-up.
The full scan reporting implementation is a bunch of code unfortunately and I think this break-down allows for independently reviewable & independently verifiable chunks.

Are these changes tested?

This has been validated and is already running in our infrastructure.

In addition, the separate Java-comparison branch contains a harness that runs 39 test scenarios against this implementation and Java's and compares their reported scan metrics:

This PR deliberately focuses on the first 35. Follow-ups can close the gaps.

AI Disclosure

Yep, used AI for implementing and testing this.

Instrument normal and copy-on-write planning with private, invocation-scoped
manifest, data-file, delete-file and deletion-vector counters. Count repeated
delete attachments separately from indexed deletes and use DV content sizes
for attached bytes. Cover pruning, empty/error paths and independent calls.

Production collects and discards these counters until a reporting-integration
change consumes them using the result types introduced by PR apache#3709.
PlanningCounts is a test-only assertion snapshot; production integration can
construct the public result types directly. Duration and stable finalization
after early termination remain follow-up work.

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.

1 participant