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

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

It would be nice if we would have a way that all unary scalar kernels could be 
applied on list arrays (indeed by being applied to the single child array of 
flat values). 

I think in SQL one could do this with a subquery with unnesting and aggregating 
again (eg 
https://cloud.google.com/bigquery/docs/reference/standard-sql/arrays#creating_arrays_from_subqueries,
 although that example is actually not a unary kernel but a binary).

Such an approach doesn't really fit our kernels / Acero, I think. One option 
could be to have a generic kernel to "map" another kernel on the list values. 
Like

{code}
list_map_function(list_array, "kernel_name", FunctionOptions)
{code}

where you can pass the function name you want to apply, and a FunctionOptions 
object matching the kernel. Would something like this be possible technically?

Another option could be to directly register list type for unary kernels? (in 
many cases there might be no ambiguity about that we expect the function to be 
applied to each value in the list, instead of applied to each list. For example 
for {{round(list<float>)}} or {{ascii_lower(list<string>)}})




> Implement arithmetic kernels on List(number)
> --------------------------------------------
>
>                 Key: ARROW-17820
>                 URL: https://issues.apache.org/jira/browse/ARROW-17820
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: C++, Python
>            Reporter: Adam Lippai
>            Priority: Major
>              Labels: kernel, query-engine
>
> eg. rounding in list(float64()), similar to a map or foreach



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

Reply via email to