jchen5 commented on code in PR #39375:
URL: https://github.com/apache/spark/pull/39375#discussion_r1067356436
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/DecorrelateInnerQuerySuite.scala:
##########
@@ -283,6 +283,51 @@ class DecorrelateInnerQuerySuite extends PlanTest {
check(innerPlan, outerPlan, correctAnswer, Seq(y <=> y, x === a, y === z))
}
+ test("union in correlation path") {
+ val outerPlan = testRelation2
+ val innerPlan =
+ Union(
+ Filter(And(OuterReference(x) === a, c === 3),
+ testRelation),
+ Filter(And(OuterReference(y) === b, c === 6),
+ testRelation))
+ val correctAnswer =
+ Union(
+ Filter(And(x === a, c === 3),
+ DomainJoin(Seq(x, y),
+ testRelation)),
+ Filter(And(y === b, c === 6),
+ DomainJoin(Seq(x, y),
Review Comment:
Right, currently we always insert domain joins. We can optimize some
equality cases in a follow-up, as I mentioned in the PR description
--
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]