-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 panic in struct
function with mixed scalar/array arguments
#9775
Conversation
}) | ||
}) | ||
.collect::<Result<Vec<ArrayRef>>>()?; | ||
let arrays = ColumnarValue::values_to_arrays(args)?; |
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 also filed
I also filed #9774 to improve the documentation
.map(|x| { | ||
Ok(match x { | ||
ColumnarValue::Array(array) => array.clone(), | ||
ColumnarValue::Scalar(scalar) => scalar.to_array()?.clone(), |
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.
the bug here is that this always makes a 1 row array, even if one of the other arguments has more than 1 row.
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 reviewed it and it looks good to me :)
(when I port this function I didn't notice this XD
Thanks @yyy1000 ! It certainly didn't have test coverage either, and I think that bug has existed for quite a while |
Thank you for the review @viirya |
Which issue does this PR close?
Fixes #9773
Rationale for this change
Bug (see #9773)
What changes are included in this PR?
Fix bug by calling the correct api, add test
Are these changes tested?
Yes, new test
Are there any user-facing changes?
Less bugs