-
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
Port ArrayPosition
and ArrayPositions
to functions-array
subcrate
#9617
Conversation
@jayzhan211 Created this PR in terms of our previous discussion on the |
ArrayPosition
and ArrayPositions
to functions-array
subcrateArrayPosition
and ArrayPositions
to functions-array
subcrate
Remind to add the roundtrip test |
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.
Nice work! Thanks @erenavsarogullari
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 @erenavsarogullari
I took the liberty of merging up from main to fix the merge conflicts and I removed the dependency on arrow-ord to fix the datafusion-cli CI check
Thank you @Weijun-H for the review
generic_position::<O>(list_array, element_array, arr_from) | ||
} | ||
|
||
fn check_datatypes(name: &str, args: &[&ArrayRef]) -> datafusion_common::Result<()> { |
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.
We can use function in crate::utils
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
} | ||
|
||
fn return_type(&self, arg_types: &[DataType]) -> datafusion_common::Result<DataType> { | ||
Ok(match arg_types[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.
I don't think the type checking is necessary in return_type
🤔
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 by reflecting both array_position
and array_positions
.
Thanks everyone for the reviews and feedbacks. |
Thanks @erenavsarogullari and @alamb , @Weijun-H for the review |
Which issue does this PR close?
Closes #9616.
What changes are included in this PR?
This PR aims to do following changes in terms of Epic #9285:
ArrayPosition
andArrayPositions
are ported tofunctions-array
subcrate.Are these changes tested?
Yes, all
array.slt
basedArrayPosition
andArrayPositions
tests are passed.Are there any user-facing changes?
No