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

David Li commented on ARROW-12751:
----------------------------------

Just to clarify, do we want to propagate nulls or ignore them? (NumPy raises an 
error which is also an option)
{noformat}
minimum([1, 2, 3], [null, 1, 1]) = [null, 1, 1] # Propagate
minimum([1, 2, 3], Scalar(null)) = [null, null, null]
minimum([1, 2, 3], [null, 1, 1]) = [1, 1, 1]    # Ignore
minimum([1, 2, 3], Scalar(null)) = [1, 2, 3]{noformat}
Also, what do we do with 0 arguments?
{noformat}
minimum(Scalar(null)) = null or error?
minimum() = [], NullScalar, or error? {noformat}

> [C++] Add variadic row-wise min/max kernels (least/greatest)
> ------------------------------------------------------------
>
>                 Key: ARROW-12751
>                 URL: https://issues.apache.org/jira/browse/ARROW-12751
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Ian Cook
>            Assignee: David Li
>            Priority: Major
>
> Add a pair of variadic functions equivalent to SQL's {{least}}/{{greatest}} 
> or R's {{pmin}}/{{pmax}}. Should take 0, 1, 2, ... same-length numeric arrays 
> as input and return an array giving the minimum/maximum of the values found 
> in each position of the input arrays. For example, in the case of these 2 
> input arrays:
> {code:java}
> Array<double>        Array<double>
> [                    [
>   1,                   2,
>   4                    3
> ]                    ]
> {code}
> {{least}} would return:
> {code:java}
> Array<double>
> [ 
>   1,
>   3
> ] 
> {code}
> and {{greatest}} would return
> {code:java}
> Array<double>
> [ 
>   2,
>   4
> ] 
> {code}
> The returned array should have the same data type as the input arrays, or 
> follow promotion rules if the numeric types of the input arrays differ.
> Should also accept scalar numeric inputs and recycle their values.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to