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

Cleanup DynComparator (#2654) #4687

Merged
merged 1 commit into from
Aug 13, 2023

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #2654

Rationale for this change

Cleans up the code and improves the type coverage. I have confirmed that this does not impact any benchmarks

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Aug 11, 2023
($t:ty, $key_type_lhs:expr, $left:expr, $right:expr) => {
cmp_dict_primitive::<$t>($key_type_lhs, $left, $right)?
};
// TODO: Handle value nulls (#2687)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still thinking about how best to handle this, we could pass SortOptions to build_compare, but this would likely imply making build_compare always handle nulls

Copy link
Contributor

Choose a reason for hiding this comment

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

Is #4691 the answer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it provides a way for users of DynComparator to "see" these nulls

let left = left.as_dictionary::<K>();
let right = right.as_dictionary::<K>();

let cmp = build_compare(left.values().as_ref(), right.values().as_ref())?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This approach significantly reduces codegen and does not appear to impact performance

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 like a very nice cleanup to me -- 👍 @tustvold 🧹

($t:ty, $key_type_lhs:expr, $left:expr, $right:expr) => {
cmp_dict_primitive::<$t>($key_type_lhs, $left, $right)?
};
// TODO: Handle value nulls (#2687)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is #4691 the answer?

@tustvold tustvold merged commit ec273e7 into apache:master Aug 13, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lexsort LargeString Panics
2 participants