jchen5 commented on code in PR #39375: URL: https://github.com/apache/spark/pull/39375#discussion_r1072327019
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala: ########## @@ -1209,6 +1209,12 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog with QueryErrorsB case p @ (_: ResolvedHint | _: LeafNode | _: Repartition | _: SubqueryAlias) => p.children.foreach(child => checkPlan(child, aggregated, canContainOuter)) + case p @ (_ : Union) => + // Set operations (e.g. UNION) containing correlated values are only supported + // with decorrelateInnerQueryEnabled. + val childCanContainOuter = canContainOuter && SQLConf.get.decorrelateInnerQueryEnabled Review Comment: Added the check and tests for EXISTS. Correlation under IN is supported via RewritePredicateSubquery to rewrite to semi join. I found existing tests for IN at in-set-operations.sql. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org