-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-12669:[C++][Python] Implement a new scalar function: list_element #11159
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
ARROW-12669:[C++][Python] Implement a new scalar function: list_element #11159
Conversation
|
Tomorrow I'll work on the python and R bindings for this new function |
91f1638 to
b38ee7e
Compare
|
Just a quick thought, why is this a vector kernel instead of a scalar one? (Though with one input it's maybe not a big difference.) |
|
Oh wait nevermind, the index here is a parameter and not an options. |
I think it has to be a scalar kernel if we want to be able to call it in a projection node, which is why we're doing this now--right? |
Ah, right - plus expressions aren't evaluatable unless they're scalar: arrow/cpp/src/arrow/compute/exec/expression.cc Lines 503 to 506 in 9cf2372
I think most kernels like this pass the second argument via options, not as an argument. I was also debating whether to comment about this, but might as well: there's no need to generate kernels for different index types, especially if we just make the index an option instead of a parameter. (It'll also limit the number of special cases to account for in type coverage testing.) |
Why can't this be a scalar kernel while still having |
Ah, you're right. So this should just be a scalar kernel, then. |
ea560fa to
954ca3e
Compare
954ca3e to
6201ebf
Compare
lidavidm
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.
Thanks! This looks good to me, I just left one note - the scalar kernel doesn't need to be templated on the list type, so you can save yourself some generated code there.
6201ebf to
2a207d5
Compare
2a207d5 to
5b899d6
Compare
lidavidm
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!
add python test and C++ docs for the new function: list_element convert list_element into a scalar function minor changes format support scalar inputs for list_element, improve tests minor changes less generated code thanks to some template tricks less generated code, again using template tricks
5b899d6 to
2369457
Compare
edponce
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.
Thanks for resolving this issue!
https://issues.apache.org/jira/browse/ARROW-12669 Closes apache#11159 from aucahuasi/return-array-for-each-list-in-array Authored-by: Percy Camilo Triveño Aucahuasi <percy.camilo.ta@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>
https://issues.apache.org/jira/browse/ARROW-12669