Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/12539#discussion_r60696559
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
@@ -1536,17 +1560,22 @@ object RewritePredicateSubquery extends
Rule[LogicalPlan] with PredicateHelper {
// Filter the plan by applying left semi and left anti joins.
withSubquery.foldLeft(newFilter) {
- case (p, Exists(sub)) =>
+ case (p, Exists(sub, _)) =>
val (resolved, conditions) = pullOutCorrelatedPredicates(sub, p)
Join(p, resolved, LeftSemi, conditions.reduceOption(And))
- case (p, Not(Exists(sub))) =>
+ case (p, Not(Exists(sub, _))) =>
val (resolved, conditions) = pullOutCorrelatedPredicates(sub, p)
Join(p, resolved, LeftAnti, conditions.reduceOption(And))
case (p, in: InSubQuery) =>
- val (resolved, conditions) = pullOutCorrelatedPredicates(in, p)
- Join(p, resolved, LeftSemi, conditions.reduceOption(And))
+ val (newP, resolved, conditions) =
pullOutCorrelatedPredicates(in, p)
--- End diff --
`newP` is `p` when we don't have to have an inmediate projection right? If
it is, then we don't need the if/else block.
---
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]