Repository navigation
Add a test for out-of-range enums in Iceberg manifest files - #116318
Merged
Merged
Conversation
Regression test for the Iceberg part of #115703: an out-of-range `status` or `data_file.content` of a manifest entry and an out-of-range (or negative) `content` of a manifest list entry must throw `ICEBERG_SPECIFICATION_VIOLATION` instead of casting the unchecked value to a C++ enum. The test creates a well-formed table with the `IcebergLocal` engine and rewrites a single enum value in place: the Avro metadata files are written with the null codec, so a schema-driven walk over the first record finds the field without a third-party Avro library. Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
|
Workflow [PR], commit [23fc8fc] Summary: ✅ AI ReviewSummaryThis PR adds a focused stateless regression test for malformed enum-like integers in Iceberg manifest metadata, covering both out-of-range and negative values for the validated manifest-entry and manifest-list fields. The current version addresses the earlier review concerns by tying each case to the intended diagnostic and by adding negative-value coverage, and I did not find a remaining correctness or test-contract issue in the patch. Final Verdict✅ No remaining findings. |
…anifest-entry enums Two changes requested in the review: - \`check_throws\` now also matches the field-specific error message, so the test stays tied to the intended range check even if the Avro patching ever starts corrupting a different field. - Added negative (\`-1\`) cases for the \`status\` and \`data_file.content\` of a manifest entry. Their expected fragments do not pin the reported value: today a negative value surfaces via the \`safeGet\` unsigned conversion as a huge number, and the rendering may change while the rejection itself must stay. Co-Authored-By: Claude Fable 5 <[email protected]>
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #115703
Changelog category (leave one):
Regression coverage for the Iceberg part of #115703, requested in the review there: reading a table whose metadata contains an out-of-range enum-like integer must throw
ICEBERG_SPECIFICATION_VIOLATIONinstead of casting the unchecked value to a C++ enum, which is undefined behaviour. The test covers all three validated fields:statusof a manifest entry,data_file.contentof a manifest entry,contentof a manifest list entry.The test creates a well-formed Iceberg table with the
IcebergLocalengine and rewrites a single enum value of the Avro metadata in place: the files are written with the null codec, so a schema-driven walk over the first record finds the byte offset of the field with no third-party Avro library (the stateless CI image has noavro/fastavro). If any of the range checks from #115703 is removed again, the corresponding case stops throwing and the test fails.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/116318]