minor: support semantic_equality for datatypes - #10902
Open
Rich-T-kid wants to merge 6 commits into
Open
Conversation
Rich-T-kid
commented
Aug 28, 2026
| /// field, including its name, nullability, and metadata. `EquivalenceGauge` lets | ||
| /// callers relax those checks, e.g. to treat `List<item: Int32>` and | ||
| /// `List<element: Int32>` as equivalent by setting `check_field_name` to `false`. | ||
| #[derive(Clone, Debug)] |
Contributor
Author
There was a problem hiding this comment.
may be worth adding a couple constructor methods like
- Default (all true)
- new_true (all true)
- new_false (all false)
but it may also be useful for callers to be explicit each time they call equal_datatypes or semantic_equality 🤔
Contributor
Author
There was a problem hiding this comment.
thinking about this a bit more, a default constructor (all false) should be enough.
The point of the SemanticEqualityOptions is to relax the strictness of comparison between datatypes, if users want a more strict comparison they should manually opt in.
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?
Rationale for this change
Arrow's derived
PartialEqonDataType/Fieldrequires exact equality (name, nullability, metadata), so logically-equivalent types likeList<item: Int32>andList<element: Int32>compare unequal.What changes are included in this PR?
Add
EquivlenceGaugeandDataType::semantic_equality/equal_datatypesto compare nested types (List, FixedSizeList, Struct, Union, Map, Dictionary, RunEndEncoded) while optionally ignoring field name, nullability, and/or metadata.Are these changes tested?
Yes, unit tests in
datatype.rs.Are there any user-facing changes?
Yes, new public API:
EquivlenceGauge,DataType::semantic_equality,equal_datatypes.