rtpsw commented on code in PR #35364:
URL: https://github.com/apache/arrow/pull/35364#discussion_r1180741744


##########
cpp/src/arrow/engine/substrait/options.cc:
##########
@@ -205,12 +205,17 @@ class DefaultExtensionProvider : public 
BaseExtensionProvider {
       ARROW_ASSIGN_OR_RAISE(auto aggregate, internal::ParseAggregateMeasure(
                                                 agg_measure, ext_set, 
conv_opts,
                                                 /*is_hash=*/!keys.empty(), 
input_schema));
+      aggregate.name = aggregate.function;

Review Comment:
   Without this logic, the aggregate schema ends up with an empty name for each 
aggregate. This is because the [aggregate 
decoding](https://github.com/apache/arrow/blob/16dbd98e8f525884649e5a33096c74a455f64610/cpp/src/arrow/engine/substrait/extension_set.cc#L929)
 is [returning an aggregate with an empty 
name](https://github.com/apache/arrow/blob/16dbd98e8f525884649e5a33096c74a455f64610/cpp/src/arrow/engine/substrait/extension_set.cc#L980-L981),
 which in turn is likely because it has no access to the input schema against 
which to resolve the field reference (`*arg_ref`). The code here does have 
access to this schema and resolves the field reference.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to