-
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
Use concat to simplify Nested Scalar creation #9174
Conversation
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
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.
lgtm thanks @jayzhan211 I think some time ago it was a comment to use a concat, not sure if for this exact purpose
@Weijun-H cc
Perhaps #7893 (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.
Thank you @jayzhan211. Very nice -- #9186
datafusion/common/src/scalar.rs
Outdated
arrow::compute::concat(arrays.as_slice()) | ||
.map_err(|e| arrow_datafusion_err!(e))? |
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.
Since there is an automatic conversion from ArrowError
to DataFusionError
you can do this:
arrow::compute::concat(arrays.as_slice()) | |
.map_err(|e| arrow_datafusion_err!(e))? | |
arrow::compute::concat(arrays.as_slice())? |
I verified that this works locally. However I think the code in this PR just follows the pattern as the reset of this file. I'll make a PR to clean that up
datafusion/common/src/scalar.rs
Outdated
arrow::compute::concat(arrays.as_slice()) | ||
.map_err(|e| arrow_datafusion_err!(e))? |
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.
arrow::compute::concat(arrays.as_slice()) | |
.map_err(|e| arrow_datafusion_err!(e))? | |
arrow::compute::concat(arrays.as_slice())? |
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
Thanks again @jayzhan211 |
Which issue does this PR close?
Use concat to simplify Nested Scalar creation
Except FixedsizeList
Closes #9145.
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?