srielau commented on code in PR #37840:
URL: https://github.com/apache/spark/pull/37840#discussion_r968610696
##########
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:
@gengliangwang is working on the origin. Link up with him on whether you
should leave it out here
--
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]