Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update LeftSemiAntiJoinPushDownSuite.scala
  • Loading branch information
AngersZhuuuu committed Nov 9, 2020
commit 77d6e45ceb7b21dcc8fabf05b9b40102bd0b645b
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,21 @@ class LeftSemiPushdownSuite extends PlanTest {
comparePlans(optimized, originalQuery.analyze)
}

test("Unary: LeftSemi join push down through Expand") {
val expand = Expand(Seq(Seq('a, 'b, "null"), Seq('a, "null", 'c)),
Seq('a, 'b, 'c), testRelation)
val originalQuery = expand
.join(testRelation1, joinType = LeftSemi, condition = Some('b === 'd && 'b === 1))

val optimized = Optimize.execute(originalQuery.analyze)
val correctAnswer = Expand(Seq(Seq('a, 'b, "null"), Seq('a, "null", 'c)),
Seq('a, 'b, 'c), testRelation
.join(testRelation1, joinType = LeftSemi, condition = Some('b === 'd && 'b === 1)))
.analyze

comparePlans(optimized, correctAnswer)
}

Seq(Some('d === 'e), None).foreach { case innerJoinCond =>
Seq(LeftSemi, LeftAnti).foreach { case outerJT =>
Seq(Inner, LeftOuter, Cross, RightOuter).foreach { case innerJT =>
Expand Down