peter-toth commented on pull request #31913:
URL: https://github.com/apache/spark/pull/31913#issuecomment-806711502


   So, I was thinking a bit about this `case class GroupingExprRef(ordinal: 
Int)` and I don't know how we could implement its `eval()` (without changing 
the ` <: BaseAggregateExec` implementations) or how could we keep its 
properties in sync with the possible changing properties of the referenced 
grouping expression? Like `.nullable()` of the referenced can change during 
optimization and `GroupingExprRef` should be in sync with that so as to allow 
further optimizations on aggregate expressions.
   
   Obviously we could capture the referenced grouping expression itself instead 
of the ordinal (like `ReusedExchangeExec` captures the referenced `Excange`), 
but transformations on the plan can easily replace the referenced to a 
different instance and so ruining our `GroupingExprRef`.
   (Sidenote: Actually `ReusedExchangeExec`/`ReusedSubquery` nodes only work 
because the reuse rules are the last plan changing ones before the execution 
begins and we still have issues with these rules: 
https://github.com/apache/spark/pull/28885) 


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to