Skip to content

feat: Scan Reporting (PR 1/3) - #3667

Closed
DerGut wants to merge 3 commits into
apache:mainfrom
DerGut:scan-reports-1-collection
Closed

DerGut wants to merge 3 commits into
apache:mainfrom
DerGut:scan-reports-1-collection

Conversation

@DerGut

@DerGut DerGut commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

This PR is another attempt at closing #1466 by implementing Iceberg's Metrics Reporting, starting with scan reports. It supersedes my original #1496 and is the first of three planned PRs. The idea of what's to come:

  1. (this PR): Scan report collection and lifecycle, with a logging consumer
  2. feat: Scan Reporting (PR 2/3) #3687: Public reporter API and configuration
  3. REST catalog scan reporting

What changes are included in this PR?

This first PR implements the collection of metrics relevant for scan reports. It counts metrics such as number of manifests, data files, total bytes, used during planning.
It adds a (for now private) reporter trait to capture the counts in tests. A follow-up PR will work on its public API.

Reports describe work planned per invocation, including partial and failed scans. They do not indicate success. Planning doesn't wait for reports to be submitted.

Planning also now propagates unused delete-index failures and skips dead-only manifests, matching Java's behavior.

The commits are ordered for independent review:

  1. 9d03a810a — planner behavior
  2. 9f7bc1a78 — counting
  3. a6725c8ac — reporting

Are these changes tested?

68% of the changes are unit and integration tests, but more interestingly is the separate harness comparing scan metrics to Java's scan metrics!
The branch scan-reports-1-validation runs both implementations against the same physical table files and compares file/delete plans, report fields and counters.
The test branch is not meant to be merged because of it's setup that doesn't fit well into the repo's existing integration test suite.

35/39 fixtures match all compared fields and plans. Four retain explained differences: equality-delete predicate pruning, equality-delete association, and close after one task in normal and copy-on-write planning.
The first two expose existing planner differences: Rust attaches deletes that Java can exclude using column bounds, and the counters reflect those different plans. The latter two reflect scheduling-dependent read-ahead: Rust can (sometimes) plan buffered tasks that Java has not yet visited.

AI Disclosure

AI assisted implementation and validation.

@DerGut
DerGut force-pushed the scan-reports-1-collection branch 16 times, most recently from 04fac57 to a6725c8 Compare November 13, 2026 12:36
@DerGut
DerGut marked this pull request as ready for review November 13, 2026 12:39
@DerGut
DerGut force-pushed the scan-reports-1-collection branch from a6725c8 to 3b3504c Compare November 13, 2026 13:04
@DerGut
DerGut force-pushed the scan-reports-1-collection branch 2 times, most recently from cd15088 to 48dcb35 Compare November 17, 2026 11:41
@DerGut
DerGut force-pushed the scan-reports-1-collection branch from 48dcb35 to 7fdfcfd Compare November 17, 2026 15:40
None
};

if skipped {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The description says manifests containing only deleted entries are skipped, but skipped is only set by predicate evaluation here.

I reproduced this with one data manifest containing only DELETED entries, with both added_files_count and existing_files_count equal to Some(0). The scan returns no tasks, but reports:

scanned_data_manifests = 1
skipped_data_manifests = 0

Java excludes these manifests before incrementing the scanned counter, producing scanned=0 and skipped=1.

Should this also check !manifest_file.has_added_files() && !manifest_file.has_existing_files()? The existing helpers conservatively scan when either count is unknown.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review Alex! I realized that this PR's diff size was probably too large and started to split out some work.
The issue you found here is now fixed separately in #3708 but I didn't update the harness yet accordingly, sorry about that! 🙏

@DerGut

DerGut commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Closing this in favor of a more granular break-down:

@DerGut DerGut closed this Nov 19, 2026
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