Skip to content

Conversation

friendlymatthew
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

Since the fields of VariantArray impl PartialEq, this PR simply derives PartialEq for VariantArray
out.

Based off of #8625

@github-actions github-actions bot added the parquet-variant parquet-variant* crates label Oct 15, 2025
@friendlymatthew
Copy link
Contributor Author

cc @scovich

This is unrelated, but I wonder if we should revisit the topic of equality? Especially how it mixes with Equivalence classes? 🤔

In my experimental repo, I had the Variant map to an EquivalenceClass and then check for equality

Basically,

Variant::Int8(n) => EquivalenceClass::ExactNumeric(n as i64),
Variant::Int16(n) => EquivalenceClass::ExactNumeric(n as i64),

This way, we can test for equality across Variant::Int8 <--> other exact numeric members

@friendlymatthew
Copy link
Contributor Author

cc @alamb

@alamb alamb changed the title [Variant] impl PartialEq for VariantArray [Variant] impl PartialEq and FromIterator<Option<..>> for VariantArray Oct 16, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me -- thank you @friendlymatthew

@alamb alamb merged commit a85d8b0 into apache:main Oct 17, 2025
17 checks passed
samueleresca pushed a commit to samueleresca/arrow-rs that referenced this pull request Oct 18, 2025
…tArray` (apache#8627)

# Which issue does this PR close?

- Closes apache#8610

# Rationale for this change

Since the fields of `VariantArray` impl `PartialEq`, this PR simply
derives `PartialEq` for `VariantArray`
out.

Based off of apache#8625
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet-variant parquet-variant* crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Variant] impl PartialEq for VariantArray

3 participants