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

Weston Pace commented on ARROW-17484:
-------------------------------------

This is an invalid plan.  The "sum" function is defined in Substrait as follows:

{noformat}
  - name: "sum"
    description: Sum a set of values. The sum of zero elements yields null.
    impls:
      - args:
          - options: [ SILENT, SATURATE, ERROR ]
            required: false
          - value: i8
        nullability: DECLARED_OUTPUT
        decomposable: MANY
        intermediate: i64?
        return: i64?
{noformat}

The output type is always {{i64?}}.  It is not legal in Substrait to have two 
implementations that differ only by return type.  This is very similar to 
function overloading which has a similar constraint.  So it would be illegal to 
have an implementation that accepted {{i32}} and returns {{i32}}.  So this plan 
that you've created can never be legal.

As a consequence, the output type can always be calculated from the input types 
and the function name.  So the {{outputType}} in the plan is purely 
informational and the consumer is free to ignore it.

> [C++] Substrait to Arrow Aggregate doesn't take the provided Output Type for 
> aggregates
> ---------------------------------------------------------------------------------------
>
>                 Key: ARROW-17484
>                 URL: https://issues.apache.org/jira/browse/ARROW-17484
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>            Reporter: Vibhatha Lakmal Abeykoon
>            Assignee: Vibhatha Lakmal Abeykoon
>            Priority: Major
>
> The current Substrait to Aggregate deserializer doesn't take the plan 
> provided output type as the output type of the execution plan.



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

Reply via email to