bart-samwel commented on pull request #28836:
URL: https://github.com/apache/spark/pull/28836#issuecomment-644615299


   I'm not a huge fan of this. For one thing, it is not in ANSI SQL 2016. 
AFAICT it's a Teradata extension that Snowflake adopted as well because they 
get a lot of Teradata workloads. To be honest, I find it confusing. There's 
already WHERE and HAVING, and QUALIFY follows HAVING but the evaluation order 
is different:
   
   Syntax: SELECT -> FROM -> WHERE -> GROUP BY -> **HAVING -> QUALIFY**
   Semantics: FROM -> WHERE -> GROUP BY -> **HAVING -> SELECT -> QUALIFY**
   
   And all it does is basically (SELECT * FROM (SELECT -> FROM -> WHERE -> 
GROUP BY -> HAVING) WHERE ...). To make this work they've invented a third 
synonym that basically means "filter", but the meaning is less clear than any 
of the other synonyms because the order in the syntax is right next to HAVING.
   


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

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