mihailoale-db commented on code in PR #50409:
URL: https://github.com/apache/spark/pull/50409#discussion_r2016004056
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -4941,6 +4941,23 @@ class SQLQuerySuite extends QueryTest with
SharedSparkSession with AdaptiveSpark
Row(Array(0), Array(0)), Row(Array(1), Array(1)), Row(Array(2),
Array(2)))
checkAnswer(df, expectedAnswer)
}
+
+ test("SPARK-51614: Generator can't show up in HAVING") {
+ val query = """select
+ | explode(packages) as package
+ |from
+ | values(array('a')) t(packages)
+ |group by all
+ |having package in ('a')""".stripMargin
Review Comment:
```
Could not verify permissions for logical node 'UnresolvedHaving package#4 IN
(a)
org.apache.spark.SparkSecurityException:
at
com.databricks.sql.acl.CheckPermissions.queryToRequests(CheckPermissions.scala:947)
at
com.databricks.sql.acl.CheckPermissions.getRequestsToCheck(CheckPermissions.scala:468)
at
com.databricks.sql.acl.CheckPermissions.apply(CheckPermissions.scala:159)
at
com.databricks.sql.acl.CheckPermissions.apply(CheckPermissions.scala:116)
at
org.apache.spark.sql.catalyst.analysis.CheckAnalysis.$anonfun$checkAnalysis0$59(CheckAnalysis.scala:1042)
```
We just need to match a proper case in `CheckAnalysis` so we throw a
meaningful error.
--
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]