andygrove commented on PR #25783:
URL: https://github.com/apache/datafusion/pull/25783#issuecomment-6128353267

   Thanks @hsiang-c for tracking this down and for the clear write-up.
   
   Since this PR was opened, #25786 has merged. It makes 
`AggregateExec::try_new` return an internal error when there are no grouping 
expressions and no aggregate expressions, as suggested above. This matches the 
logical `Aggregate`, which has rejected this shape since #3286 and suggests a 
single-row `VALUES` instead. With this branch applied to current main, the new 
test fails while building the plan:
   
   ```
   Error: Internal("Grouping expressions and aggregate expressions cannot both 
be empty")
   ```
   
   Since this plan can no longer be built, I think we should close this PR and 
#25782, and handle the shape in Comet. apache/datafusion-comet#6899 plans it as 
`count(1)` under a `ProjectionExec` with no expressions. I checked that this 
returns one row with no columns on current main, for input with rows, empty 
input, and zero-column input.
   
   If you still think DataFusion should accept this shape, that means reverting 
the check from #25786, so let's discuss it on #25782 first.
   


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