Skip to content

Conversation

@Weijun-H
Copy link
Member

@Weijun-H Weijun-H commented Mar 2, 2024

Which issue does this PR close?

Parts #9285

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@Weijun-H Weijun-H marked this pull request as draft March 2, 2024 04:03
@github-actions github-actions bot added logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates labels Mar 2, 2024
@Weijun-H Weijun-H marked this pull request as ready for review March 2, 2024 04:28
@jayzhan211
Copy link
Contributor

@Weijun-H Can you also add a roundtrip test for those functions?
https://github.com/apache/arrow-datafusion/blob/2a490e48c924b76a2d389227c674b9f81b0404c8/datafusion/proto/tests/cases/roundtrip_logical_plan.rs#L578-L582

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.

This looks great @Weijun-H -- thank you for the contrubution and thank you @jayzhan211 for the review

Ok(arr)
}

/// Returns the length of each array dimension
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is just following the existing pattern of array_functions, but I wonder if it would be better to organize the code by function.

For example, we could put the UDF and implementations in datafusion/functions-array/src/dims.rs 🤔

We could definitely do this as a follow on PR

Any thoughts @jayzhan211 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we split two files udf and kernel inside dims?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the difficult part is naming the category name. Like array_append, array_prepend and array_concat. Should we name it mutable? How about pop_front and pop_back.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree how to organize the functions is not clear.

We could always just make one file for each function, I suppose. array_append.rs, array_prepend.rs, etc. Though that feels like a bit of an overkill

@alamb
Copy link
Contributor

alamb commented Mar 2, 2024

Looks like there is a conflict that needs to be resolved

@Weijun-H Weijun-H force-pushed the move-array-dims-and-card branch from 944848b to e6a5c3c Compare March 3, 2024 01:45
@jayzhan211
Copy link
Contributor

Thanks @Weijun-H

@jayzhan211 jayzhan211 merged commit f229dcc into apache:main Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants