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

Use concat to simplify Nested Scalar creation #9174

Merged
merged 3 commits into from
Feb 10, 2024

Conversation

jayzhan211
Copy link
Contributor

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?

Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
@jayzhan211 jayzhan211 marked this pull request as draft February 9, 2024 04:29
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
@jayzhan211 jayzhan211 marked this pull request as ready for review February 9, 2024 05:18
Copy link
Contributor

@comphead comphead left a 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

@alamb
Copy link
Contributor

alamb commented Feb 9, 2024

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)

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.

Thank you @jayzhan211. Very nice -- #9186

Comment on lines 1498 to 1499
arrow::compute::concat(arrays.as_slice())
.map_err(|e| arrow_datafusion_err!(e))?
Copy link
Contributor

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:

Suggested change
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

Comment on lines 1504 to 1505
arrow::compute::concat(arrays.as_slice())
.map_err(|e| arrow_datafusion_err!(e))?
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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>
@alamb alamb merged commit f97a208 into apache:main Feb 10, 2024
22 checks passed
@alamb
Copy link
Contributor

alamb commented Feb 10, 2024

Thanks again @jayzhan211

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.

Use concat to simplify Struct scalar creation
3 participants