Lordworms commented on PR #11897:
URL: https://github.com/apache/datafusion/pull/11897#issuecomment-2284447751

   > EliminateGroupByConstant
   
   
   
   > Ideally group by constant should be eliminated, but the result is 
different when there is no row and we can't differentiate it after 
`EliminateGroupByConstant`.
   > 
   > I think this is why you bring the `is_global_group_by` information down to 
physical layer.
   exactly
   > 
   > I think another approach is we avoid `EliminateGroupByConstant` at all and 
we eliminate it when creating physical group by expression 🤔
   I don't think we should completely avoid this rule since it has its own 
usage, for example here, if we disable it, the plan would be like 
   <img width="985" alt="image" 
src="https://github.com/user-attachments/assets/bcc4988c-9164-4a42-a6be-130bdd02111a";>
   
   and with enable it, the plan is 
   <img width="704" alt="image" 
src="https://github.com/user-attachments/assets/c7501fdd-a8b7-48fd-9cb8-d15c3c32d28b";>
   
   we introduced an unnecessary Projection which I don't feel suitable. Also I 
think there should be other test cases which may require AggregateExec to emit 
empty set, since right now it always returns an null with no input.


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


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

Reply via email to