Repository navigation
Conversation
This branch has not been deployed
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?
Closes #11948.
Rationale for this change
In
cast_to_variant, converting ArrowStructArrayorMapArrayto Parquet Variant in strict mode (options.safe == false) silently overwrote duplicate object keys instead of returning an error. Duplicate keys with null values could also bypass underlying builder checks because null fields are skipped during builder insertion.In strict mode, duplicate keys within the same object should be rejected with an
ArrowError::InvalidArgumentError. Safe mode retains its existing permissive overwrite behavior.What changes are included in this PR?
Struct conversion
struct_array.column_names()for duplicate names in strict mode.Map conversion
HashSetto detect duplicate keys in strict mode.Regression tests
Are these changes tested?
Previously reported verification:
cargo test -p parquet-variant-compute: 381 unit tests and 15 doctests passed.cargo test -p parquet-variant --lib: 178 unit tests passed.-D warningspassed.cargo fmt --checkpassed.git diff --checkpassed.These are results from the implementation and audit stages, not newly executed tests in this PR-creation stage.
Are there any user-facing changes?
Strict
cast_to_variantconversions (CastOptions { safe: false, .. }) containing duplicate Struct or Map keys now returnArrowError::InvalidArgumentErrorinstead of silently overwriting earlier values.Safe conversions (
safe: true) retain the existing permissive behavior.AI Tooling Disclosure: AI tools were used during initial problem reproduction, test scaffolding, and implementation drafting. The contributor reviewed and refined the implementation, error-handling paths, and test assertions, and is responsible for understanding, debugging, and maintaining the submitted changes.