mingmwang commented on issue #4556:
URL: 
https://github.com/apache/arrow-datafusion/issues/4556#issuecomment-1342518459

   @jackwener Maybe you can refer to this
   
   https://docs.snowflake.com/en/sql-reference/constructs/having.html
   
   Per SnowFlake's doc, HAVING should apply to expressions produced by the 
GROUP BY.
   GROUP BY can include Alias. Today DataFusion does not merge the adjacent 
PROJECT and GROUP BY. In future we might
   add a rule to collapse the adjacent PROJECT and GROUP BY Aggregation, so 
that the GROUP BY exprs will include Alias.
   
   Some other docs for you to refer about the evaluation ordering of operators:
   
   https://docs.snowflake.com/en/sql-reference/constructs/qualify.html
   
https://docs.teradata.com/r/Teradata-VantageTM-SQL-Data-Manipulation-Language/March-2019/Select-Statements/QUALIFY-Clause/Usage-Notes/Evaluation-Order-of-WHERE-GROUP-BY-and-QUALIFY-Clauses
   


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