fix(spec): reject unequal map default arrays - #3110
Open
mattfaltyn wants to merge 1 commit into
Open
Conversation
mattfaltyn
marked this pull request as ready for review
August 28, 2026 20:43
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.
Which issue does this PR close?
What changes are included in this PR?
keysandvaluesarrays have different lengths instead of silently truncating them withIterator::zip.NestedFielddeserialization so malformed metadata cannot be accepted as a missing default.initial-defaultandwrite-defaultat the schema boundary.This matches the Java reference implementation's equal-length requirement for map literals.
Are these changes tested?
Yes.
cargo +stable test -p iceberg --lib spec::values::tests::json_map_rejects_mismatched_key_value_lengths -- --exact --nocapturecargo +stable test -p iceberg --lib spec::datatypes::tests::nested_field_rejects_invalid_map_defaults -- --exact --nocapturemake checkmake buildmake unit-testcargo nextest run --all-targets --all-features --workspace --no-fail-fast: 2,107 passed; the only 20 failures were HMS integration cases because the pinned amd64-only Hive 3.1.3 container did not bind port 9083 under ARM64 emulation on this host.cargo nextest run --all-targets --all-features --workspace -E 'not (package(iceberg-catalog-hms) | test(/hms_catalog/))': 2,090/2,090 passed, including REST, Glue, S3Tables, SQL, DataFusion, Spark, S3, GCS, and Hugging Face integrations. HMS unit tests passed undermake unit-test.AI Disclosure
I used Codex to assist with repository inspection, implementation, test execution, and drafting this description. I reviewed the bug reproduction, diff, and test results before submission.