Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: StructArray compare #1889

Closed
wants to merge 2 commits into from
Closed

feat: StructArray compare #1889

wants to merge 2 commits into from

Conversation

AdamGS
Copy link
Contributor

@AdamGS AdamGS commented Jan 10, 2025

closes #1888.

@AdamGS AdamGS requested a review from robert3005 January 10, 2025 13:43
}

Ok(Some(
BoolArray::new(bool_builder.finish(), lhs.dtype().nullability()).into_array(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what's the correct option here for nullability, the default make_comparator is null < non-null, and it doesn't return null values, so maybe we should or here with the lhs/rhs validity arrays?

@gatesn
Copy link
Contributor

gatesn commented Jan 10, 2025

This is super inefficient.... we recursively canonicalize everything into Arrow.

Why are we implementing this at all?

@gatesn
Copy link
Contributor

gatesn commented Jan 10, 2025

If we do need to, you should run compare over each field independently, assemble the compare results into a struct array, and then pass that into Arrow.

You can do that using StructArrayTrait too so no requirement on the RHS encoding.

And then there's probably short-circuiting that's possible

@AdamGS
Copy link
Contributor Author

AdamGS commented Jan 10, 2025

We're implementing this because currently falling back to arrow panics.

@AdamGS
Copy link
Contributor Author

AdamGS commented Jan 10, 2025

the underlying impl here also short-circuits, I'm not sure why this is "super inefficient" when compares to the current (buggy) implementation.

@AdamGS
Copy link
Contributor Author

AdamGS commented Jan 10, 2025

I actually think your suggestion doesn't allow for short-circuiting because I have to rebuild a struct array (with what structure?).

@AdamGS
Copy link
Contributor Author

AdamGS commented Jan 13, 2025

closing in favor of #1912

@AdamGS AdamGS closed this Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compare doesn't work if both sides are structs
2 participants