AngersZhuuuu commented on pull request #29087:
URL: https://github.com/apache/spark/pull/29087#issuecomment-754389257


   @maropu All comment done, But I find with
   `SET spark.sql.legacy.parser.havingWithoutGroupByAsWhere=true;`
    `SELECT 1 FROM range(10) HAVING true`  will failed with 
   ```
   -- !query
   SELECT 1 FROM range(10) HAVING true
   -- !query schema
   struct<>
   -- !query output
   org.apache.spark.sql.AnalysisException
   unresolved operator 'UnresolvedHaving cast(true as boolean)
   ```
   Seem not same with the migration guide 
   ```
     - In Spark version 2.3 and earlier, HAVING without GROUP BY is treated as 
WHERE. This means, `SELECT 1 FROM range(10) HAVING true` is executed as `SELECT 
1 FROM range(10) WHERE true`  and returns 10 rows. This violates SQL standard, 
and has been fixed in Spark 2.4. Since Spark 2.4, HAVING without GROUP BY is 
treated as a global aggregate, which means `SELECT 1 FROM range(10) HAVING 
true` will return only one row. To restore the previous behavior, set 
`spark.sql.legacy.parser.havingWithoutGroupByAsWhere` to `true`.
   ```
   And I did't see any UT about this feature. any thing wrong? Should I fix 
this problem with a new jira ticket?
   


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