alamb commented on pull request #1319:
URL: https://github.com/apache/arrow-datafusion/pull/1319#issuecomment-971663467


   > Hmm, there is a test ctx_sql_should_optimize_plan that assumes the logical 
plan after sql is optimized one. I thought it doesn't make sense as the logical 
plan is not a final one, e.g. you could do select etc. operations to produce 
new DataFrame (i.e., new logical plan). We only need to optimize it before 
creating physical plan (create_physical_plan).
   
   I wonder if another possible bug fix might be to change the 
`ConstantEvaluation` code to add an alias for aggregates? For example, rewrite 
aggregates so they explicitly keep the same (original) display name
   
   Like for example, rewrite `COUNT(1+1)` to `COUNT(2) as "COUNT(1+1)"`
   


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