-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix comparison of decimal array with null scalar #3567
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
fix comparison of decimal array with null scalar #3567
Conversation
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kmitchener
| let result: Result<Arc<dyn Array>> = match right { | ||
| ScalarValue::Boolean(b) => compute_bool_op_dyn_scalar!($LEFT, b, $OP, $OP_TYPE), | ||
| ScalarValue::Decimal128(..) => compute_decimal_op_scalar!($LEFT, right, $OP, Decimal128Array), | ||
| ScalarValue::Decimal128(..) => compute_decimal_op_dyn_scalar!($LEFT, right, $OP, $OP_TYPE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ you are starting to figure out the thicket that is binary.rs 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah :) and what a pleasure it is
| ll, | ||
| $RIGHT.try_into()?, | ||
| )?)) | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we assert here that $RIGHT is still a decimal ? As written the code could convert ScalarValue::Int8(Some(4)) into NULL, for example
But I don't know if such a ScalarValue could be passed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to. Those 2 decimal macros are used only in 1 place each and include "decimal" in the name -- it'd be a clear mistake to use it for any other datatype. This area could use some refactoring, but I wanted to get this in and the kernels moved to arrow-rs then maybe revisit this whole module (famous last words, right?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
famous last words maybe, but a reasonable plan nonetheless ;)
|
Thanks again @kmitchener |
|
Benchmark runs are scheduled for baseline = b54a56f and contender = b134fa4. b134fa4 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #3487 .
Rationale for this change
Prior to fix, would error (no longer panic after Arrow 23). After fix, works as expected.
What changes are included in this PR?
Are there any user-facing changes?