alamb commented on code in PR #12085:
URL: https://github.com/apache/datafusion/pull/12085#discussion_r1723861478


##########
datafusion/physical-plan/src/aggregates/mod.rs:
##########
@@ -817,7 +818,16 @@ fn create_schema(
         | AggregateMode::SinglePartitioned => {
             // in final mode, the field with the final result of the 
accumulator
             for expr in aggr_expr {
-                fields.push(expr.field()?)

Review Comment:
   I think it would be better to update the defintion of `field` here to return 
the correct value
   
   What I suggest is to add a `field` method to `AggregateUDFImpl` with a 
default implementation  like 
[this](https://github.com/apache/datafusion/blob/e088945c38b74bb1d86dcbb88a69dfc21d59e375/datafusion/physical-expr-functions-aggregate/src/aggregate.rs#L243-L245)
   
   Then have `AggregateFunctionExpr::field` call into `fun.field()`
   
   Note that the `AggregateExpr` trait is under consideration for removal -- 
see https://github.com/apache/datafusion/issues/11810 



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to