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

Vibhatha Lakmal Abeykoon commented on ARROW-17484:
--------------------------------------------------


{code:json}
"relations": [{
      "rel": {
        "aggregate": {
          "common": {
          "emit": {
            "outputMapping": [0]
          }
        },
          "input": {
            "read": {
              "base_schema": {
                "names": ["A", "B", "C"],
                "struct": {
                  "types": [{
                    "i32": {}
                  }, {
                    "i32": {}
                  }, {
                    "i32": {}
                  }]
                }
              },
              "local_files": {
                "items": [
                  {
                    "uri_file": ")" +
                               substrait_file_uri +
                               R"(",
                    "parquet": {}
                  }
                ]
              }
            }
          },
          "groupings": [{
            "groupingExpressions": [{
              "selection": {
                "directReference": {
                  "structField": {
                    "field": 0
                  }
                }
              }
            }]
          }],
          "measures": [{
            "measure": {
              "functionReference": 0,
              "arguments": [{
                "value": {
                  "selection": {
                    "directReference": {
                      "structField": {
                        "field": 2
                      }
                    }
                  }
                }
            }],
              "sorts": [],
              "phase": "AGGREGATION_PHASE_INITIAL_TO_RESULT",
              "invocation": "AGGREGATION_INVOCATION_ALL",
              "outputType": {
                "i32": {}
              }
            }
          }]
        }
      }
    }],
    "extensionUris": [{
      "extension_uri_anchor": 0,
      "uri": 
"https://github.com/substrait-io/substrait/blob/main/extensions/functions_arithmetic.yaml";
    }],
    "extensions": [{
      "extension_function": {
        "extension_uri_reference": 0,
        "function_anchor": 0,
        "name": "sum"
      }
    }],
{code}

For instance, here, if we debug and check the aggregate function's return type, 
it mentions that _i32_ is the _output_type_ , but at the end of the execution 
the return type is _i64_. This is not the expected behavior.

> [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