Skip to content

feat: Validate add.stats. numRecords must exist on writes when icebergCompatV3 enabled#2512

Open
dengsh12 wants to merge 11 commits intodelta-io:mainfrom
dengsh12:stack/detect-no-num
Open

feat: Validate add.stats. numRecords must exist on writes when icebergCompatV3 enabled#2512
dengsh12 wants to merge 11 commits intodelta-io:mainfrom
dengsh12:stack/detect-no-num

Conversation

@dengsh12
Copy link
Copy Markdown
Collaborator

@dengsh12 dengsh12 commented May 2, 2026

🥞 Stacked PR

Use this link to review incremental changes.


What changes are proposed in this pull request?

Added a new NumRecordsValidator to validate add.stats.numRecords must exist on writes when icebergCompatV3 enabled. Renamed Existing StatsVerifier to StatsColumnVerifier to distinguish.

How was this change tested?

Unit tests for:

  1. Empty EngineData batches.
  2. One EngineData batches with several numRecords as None(validates early-return).
  3. Two EngineData batches with several numRecords as None(validates early-return).
  4. One EngineData batch with numRecords in all add actions.

@dengsh12 dengsh12 changed the title numrecord validator feat: Validate add.stats. numRecords must exist on writes when icebergCompatV3 enabled May 2, 2026
Comment on lines +992 to +998
// IcebergCompatV3 requires every AddFile to carry `stats.numRecords`.
if self
.effective_table_config
.is_feature_enabled(&TableFeature::IcebergCompatV3)
{
stats_verifier::verify_num_records_present(add_files)?;
}
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.

Currently we never enter this if branch since we can't write to icebergCompatV3 tables. Will covered by later integration tests

@dengsh12 dengsh12 force-pushed the stack/detect-no-num branch from eb4f572 to 8480dfe Compare May 2, 2026 01:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

PR title does not match the required pattern. Please ensure you follow the conventional commits spec.

Your title should start with feat:, fix:, chore:, docs:, perf:, refactor:, test:, or ci:, and if it's a breaking change that should be suffixed with a ! (like feat!:), and then a 1-72 character brief description of your change.

Title: feat: Validate add.stats. numRecordsmust exist on writes whenicebergCompatV3 enabled
PR title does not match the required pattern. Please ensure you follow the conventional commits spec.

Your title should start with feat:, fix:, chore:, docs:, perf:, refactor:, test:, or ci:, and if it's a breaking change that should be suffixed with a ! (like feat!:), and then a 1-72 character brief description of your change.

Title: feat: Validate add.stats. numRecordsmust exist on writes whenicebergCompatV3 enabled
PR title does not match the required pattern. Please ensure you follow the conventional commits spec.

Your title should start with feat:, fix:, chore:, docs:, perf:, refactor:, test:, or ci:, and if it's a breaking change that should be suffixed with a ! (like feat!:), and then a 1-72 character brief description of your change.

Title: feat: Validate add.stats. numRecordsmust exist on writes whenicebergCompatV3 enabled

@dengsh12 dengsh12 marked this pull request as ready for review May 2, 2026 01:01
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

❌ Patch coverage is 94.44444% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.56%. Comparing base (78670eb) to head (8480dfe).

Files with missing lines Patch % Lines
kernel/src/engine/arrow_expression/apply_schema.rs 89.47% 13 Missing and 3 partials ⚠️
kernel/src/engine/arrow_conversion/mod.rs 94.28% 0 Missing and 8 partials ⚠️
kernel/src/transaction/stats_verifier.rs 92.75% 2 Missing and 3 partials ⚠️
kernel/src/utils.rs 98.59% 3 Missing ⚠️
kernel/src/transaction/mod.rs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2512      +/-   ##
==========================================
+ Coverage   88.50%   88.56%   +0.05%     
==========================================
  Files         179      179              
  Lines       59031    59551     +520     
  Branches    59031    59551     +520     
==========================================
+ Hits        52245    52739     +494     
- Misses       4785     4803      +18     
- Partials     2001     2009       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot added the breaking-change Public API change that could cause downstream compilation failures. Requires a major version bump. label May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Public API change that could cause downstream compilation failures. Requires a major version bump.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant