scsmithr opened a new issue, #9028:
URL: https://github.com/apache/arrow-datafusion/issues/9028

   ### Describe the bug
   
   `NthValueAgg` returns one expression here (which is used when encoding a 
plan to a protobuf): 
https://github.com/apache/arrow-datafusion/blob/ed2453901949101556c0c89b9acf442873c06ce8/datafusion/physical-expr/src/aggregate/nth_value.rs#L119-L121
   
   But `create_aggregate_expr` expects two input expressions (which is used 
when decoding a protobuf to a plan): 
https://github.com/apache/arrow-datafusion/blob/ed2453901949101556c0c89b9acf442873c06ce8/datafusion/physical-expr/src/aggregate/build_in.rs#L375-L396
   
   A workaround could be downcasting and manually adding in an expression on 
either the encode or decode side, but that does feel like a hack.
   
   ### To Reproduce
   
   I've added an additional test case in this pr which hits the issue: 
https://github.com/apache/arrow-datafusion/pull/9027/files#diff-f5f4ff60a3b2f61388e01e1ebda773642ab5d86b5acee785c902f24e3b9dad70R340-R348
   
   ### Expected behavior
   
   I expect that `expression` returns the proper number of expressions needed 
to recreate an aggregate expression in `create_aggregate_expr`.
   
   ### Additional context
   
   I'm trying to make sure all the aggregates can be properly encoded and 
decoded into protobufs, and hit this issue.


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