gengliangwang commented on code in PR #37840:
URL: https://github.com/apache/spark/pull/37840#discussion_r968750387


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -756,10 +756,8 @@ trait CheckAnalysis extends PredicateHelper with 
LookupCatalog {
       val invalidCols = groupByCols -- correlatedCols
       // GROUP BY columns must be a subset of columns in the predicates
       if (invalidCols.nonEmpty) {
-        failAnalysis(
-          "A GROUP BY clause in a scalar correlated subquery " +
-            "cannot contain non-correlated columns: " +
-            invalidCols.mkString(","))
+        throw QueryCompilationErrors.nonCorrelatedColumnsInGroupBy(
+          invalidCols.map(_.name).mkString(","), expr.origin)

Review Comment:
   With https://github.com/apache/spark/pull/37841 merged, we can skip passing 
expr.origin here. @dtenedor Will you give a try?



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

Reply via email to