maropu commented on a change in pull request #27749: [SPARK-30997][SQL] An 
analysis failure in generators with aggregate functions
URL: https://github.com/apache/spark/pull/27749#discussion_r386076423
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisErrorSuite.scala
 ##########
 @@ -433,6 +433,13 @@ class AnalysisErrorSuite extends AnalysisTest {
       :: Nil
   )
 
+  errorTest(
+    "generator nested in expressions for aggregates",
+    testRelation.select(Explode(CreateArray(min($"a") :: max($"a") :: Nil)) + 
1),
+    "Generators are not supported when it's nested in expressions, but got: " +
+      "(explode(array(min(a), max(a))) + 1)" :: Nil
+  )
+
 
 Review comment:
   This is not related to this pr though, I added the two tests here to improve 
test coverage for 
https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala#L2209-L2217.
 Please let me know if there are any problems.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to