kumarUjjawal commented on PR #21739:
URL: https://github.com/apache/datafusion/pull/21739#issuecomment-4282512950

   > Wouldn't we want the left version though? The physical plan is actually 
executing `count(1)`, but you don't see that at all in the physical plan even 
though the logical plan does show it.
   
   I think the current behavior is intentional.
   
   My thinking:
     - user-written aliases should inline the aggregate expression
     - internal planner aliases should stay compact
   
    count(*) is in the second group, so keeping aggr=[count(*)] is expected. 
The bug here is about user aliases like sum(...) as agg disappearing in 
physical explain, not about exposing every internal rewrite.
   
    So while the physical plan does execute the lowered count(1) form, showing 
count(1) as count(*) in explain would expose planner internals and would 
regress the compact count(*) output we already preserve elsewhere. If we want 
physical explain to show lowered forms more generally, I think that should be 
doable but will require some changes.


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