You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2022/12/01 14:47:00 UTC

[jira] [Commented] (ARROW-18265) [C++] Allow FieldPath to work with ListElement

    [ https://issues.apache.org/jira/browse/ARROW-18265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17641982#comment-17641982 ] 

Joris Van den Bossche commented on ARROW-18265:
-----------------------------------------------

bq. However, it would be a bit tricky if FindOne/FindAll ended up calling list_element (a compute function). FindOne/FindAll currently is in the core module and not the compute module. 

That's a good point. So, for doing FindOne/FindAll itself, we won't need "list_element" kernel, since this returns a path, and for that we don't need to do the actual selection from the array. 
There is however a set of {{FieldPath::Get(..)}} methods that you can call on the resulting FieldPath. For "getting" the path from a schema or type, that's still OK (no need for the actual kernel), but there is a signature for {{Get()}} to apply the path on a record batch or array. For that specific case, one would actually need to use the kernel. Now, I am not sure we actually use this variant internally, though (outside of a few tests). 

> [C++] Allow FieldPath to work with ListElement
> ----------------------------------------------
>
>                 Key: ARROW-18265
>                 URL: https://issues.apache.org/jira/browse/ARROW-18265
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Miles Granger
>            Assignee: Miles Granger
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 11.0.0
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> {{FieldRef::FromDotPath}} can parse a single list element field. ie. {{{}'path.to.list[0]`{}}}but does not work in practice. Failing with:
> _struct_field: cannot subscript field of type list<....>_
> Being able to add a slice or multiple list elements is not within the scope of this issue. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)