Skip to content

test: verify MergingSnapshotUpdate commit reports - #884

Open
manuzhang wants to merge 1 commit into
apache:mainfrom
manuzhang:codex/fix-merging-snapshot-event-report
Open

test: verify MergingSnapshotUpdate commit reports#884
manuzhang wants to merge 1 commit into
apache:mainfrom
manuzhang:codex/fix-merging-snapshot-event-report

Conversation

@manuzhang

Copy link
Copy Markdown
Member

What changed

  • remove the stale MergingSnapshotUpdate event-reporting TODO
  • add focused coverage proving a merge-based snapshot update emits one CommitReport
  • verify the report carries the table name, operation, created snapshot ID, sequence number, and summary-derived file and record counts

Why

The TODO predates commit metrics integration and still says C++ has no equivalent reporting mechanism. Snapshot updates now report successful commits through MetricsReporter, but MergingSnapshotUpdate did not have direct regression coverage for that behavior.

This keeps reporting centralized in SnapshotUpdate while testing the contract for merge-based updates.

Validation

  • cmake --build build --target table_update_test -j2
  • build/src/iceberg/test/table_update_test --gtest_filter='MergingSnapshotUpdateTest.*' (79 tests passed)
  • clang-format --dry-run --Werror src/iceberg/test/merging_snapshot_update_test.cc src/iceberg/update/merging_snapshot_update.h
  • git diff --check

Co-authored-by: Codex <codex@openai.com>
@manuzhang
manuzhang marked this pull request as ready for review August 12, 2026 06:52
Copilot AI lite review requested due to automatic review settings August 12, 2026 06:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR removes an outdated comment implying merge-based snapshot updates don’t emit commit events, and adds a focused regression test asserting that MergingSnapshotUpdate emits exactly one CommitReport containing key commit metadata and summary-derived metrics.

Changes:

  • Removed stale TODO in MergingSnapshotUpdate header about lacking event/reporting support.
  • Added a new test that captures emitted MetricsReport instances and validates the CommitReport fields (table name, operation, snapshot/sequence IDs, and added file/record counts).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/iceberg/update/merging_snapshot_update.h Removes an outdated TODO that no longer reflects the current metrics reporting behavior.
src/iceberg/test/merging_snapshot_update_test.cc Adds regression coverage verifying merge-append snapshot commits emit a correct CommitReport.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

/// 6. Merge data manifests (via data_merge_manager_)
/// 7. Merge delete manifests (via delete_merge_manager_)
///
/// TODO(Guotao): Java MergingSnapshotProducer overrides updateEvent() to return a

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.

MetricsReporter covers the commit reporting use case, but it is not exactly the same as Java's event listener mechanism. Java handles event notification and metrics reporting separately. If we don't plan to support a general event listener in C++, removing this TODO is fine.

EXPECT_EQ(snapshot->summary.at(SnapshotSummaryFields::kAddedRecords), "100");
}

TEST_F(MergingSnapshotUpdateTest, CommitReportsCreatedSnapshot) {

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.

+1 for this test case.

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.

3 participants