-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Port ArrayResize to functions-array subcrate
#9570
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
Conversation
ArrayResize to function-arrays subcrateArrayResize to functions-arrays subcrate
ArrayResize to functions-arrays subcrateArrayResize to functions-array subcrate
| | array_union(array1, array2) | Returns an array of the elements in the union of array1 and array2 without duplicates. `array_union([1, 2, 3, 4], [5, 6, 3, 4]) -> [1, 2, 3, 4, 5, 6]` | | ||
| | array_except(array1, array2) | Returns an array of the elements that appear in the first array but not in the second. `array_except([1, 2, 3, 4], [5, 6, 3, 4]) -> [3, 4]` | | ||
| | array_resize(array, size, value) | Resizes the list to contain size elements. Initializes new elements with value or empty if value is not set. `array_resize([1, 2, 3], 5, 0) -> [1, 2, 3, 4, 5, 6]` | | ||
| | array_resize(array, size, value) | Resizes the list to contain size elements. Initializes new elements with value or empty if value is not set. `array_resize([1, 2, 3], 5, 0) -> [1, 2, 3, 0, 0]` | |
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.
👍
| field.data_type().clone(), | ||
| true, | ||
| )))), | ||
| _ => exec_err!( |
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.
nit
| _ => exec_err!( | |
| List(field) | FixedSizeList(field, _) => Ok(List(field.clone())), | |
| LargeList(field) => Ok(LargeList(field.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.
Addressed
Weijun-H
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.
LGTM! Thanks @erenavsarogullari
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.
Thank you very much @erenavsarogullari and @Weijun-H for the review
| } | ||
| } | ||
|
|
||
| /// array_resize SQL function |
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 think @jayzhan211 may have a plan to split these functions up into different modules (e.g. not one giant kernels.rs file). No changes needed for this PR, just FYI
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 @alamb. Yes, our direction will be like that with the next PR.
|
|
||
| - list_sort | ||
|
|
||
| ### `array_resize` |
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.
Its cool to see improvements to the documentation as part of the porting over 👍
|
Since I was taking a pass through anyways, I merged this PR up to main and fixed a compilation error. |
|
Thanks again @erenavsarogullari and @jayzhan211 |
|
Thanks @alamb for follow-up and merge. |
Which issue does this PR close?
Closes #9569.
What changes are included in this PR?
This PR aims to do following changes in terms of Epic #9285:
1-
ArrayResizeis ported tofunctions-arraysubcrate,2-
array_resizefunction documentation is added.Are these changes tested?
Yes, all
array.sltbasedarray_resizetests are passed.Are there any user-facing changes?
No