maropu commented on issue #24209: [SPARK-27255][SQL] Aggregate functions should 
not be allowed in WHERE
URL: https://github.com/apache/spark/pull/24209#issuecomment-476428652
 
 
   To just make sure this is a right approach, one question; `CheckAnalysis` is 
the best place to fix this issue? For example, analyzer itself throws an 
exception when filter has generators?
   
   ```
   scala> sql("select * from x where explode(array(1, 2, 3)) < id").show
   org.apache.spark.sql.AnalysisException: Generators are not supported outside 
the SELECT clause, but got: 'Filter (explode(array(1, 2, 3)) < id#10L);
     at 
org.apache.spark.sql.catalyst.analysis.Analyzer$ExtractGenerator$$anonfun$apply$17.applyOrElse(Analyzer.scala:1796)
     at 
org.apache.spark.sql.catalyst.analysis.Analyzer$ExtractGenerator$$anonfun$apply$17.applyOrElse(Analyzer.scala:1751)
     at 
org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.$anonfun$resolveOperatorsUp$3(AnalysisHelper.scala:90)
     at 
org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(TreeNode.scala:72)
   ```

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