Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/12306#discussion_r60135581
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
---
@@ -110,6 +110,31 @@ trait CheckAnalysis {
s"filter expression '${f.condition.sql}' " +
s"of type ${f.condition.dataType.simpleString} is not a
boolean.")
+ case f @ Filter(condition, child) =>
+ // Make sure no correlated predicate is in an OUTER join,
because this could change the
+ // semantics of the join.
+ lazy val attributes: Set[Expression] = child.output.toSet
+ def checkCorrelatedPredicates(p: PredicateSubquery): Unit =
p.query.foreach {
+ case j @ Join(left, right, jt, _) if jt != Inner =>
+ j.transformAllExpressions {
+ case e if attributes.contains(e) =>
+ failAnalysis(s"Accessing outer query column is not
allowed in outer joins: $e")
--- End diff --
I have added more cases here. I think we are good now.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]