Port ArrayPosition and ArrayPositions to functions-array subcrate#9617
Port ArrayPosition and ArrayPositions to functions-array subcrate#9617jayzhan211 merged 4 commits intoapache:mainfrom erenavsarogullari:Issue-9616
ArrayPosition and ArrayPositions to functions-array subcrate#9617Conversation
|
@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 |
Weijun-H
left a comment
There was a problem hiding this comment.
Nice work! Thanks @erenavsarogullari
alamb
left a comment
There was a problem hiding this comment.
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.
We can use function in crate::utils
| } | ||
|
|
||
| fn return_type(&self, arg_types: &[DataType]) -> datafusion_common::Result<DataType> { | ||
| Ok(match arg_types[0] { |
There was a problem hiding this comment.
I don't think the type checking is necessary in return_type 🤔
There was a problem hiding this comment.
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:
ArrayPositionandArrayPositionsare ported tofunctions-arraysubcrate.Are these changes tested?
Yes, all
array.sltbasedArrayPositionandArrayPositionstests are passed.Are there any user-facing changes?
No