Skip to content
Closed
Show file tree
Hide file tree
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
Merge branch 'master' into join
  • Loading branch information
cloud-fan committed Apr 18, 2018
commit 5e412088745eee407ddd9c1edefab6fde0914587
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,6 @@ object ConstraintsUtils {
case e: Expression if e.semanticEquals(source) => destination
})

/**
* Returns an [[ExpressionSet]] that contains an additional set of constraints, such as
* equality constraints and `isNotNull` constraints, etc., and that only contains references
* to this [[LogicalPlan]] node.
*/
def getRelevantConstraints(constraints: Set[Expression]): ExpressionSet = {
val allRelevantConstraints =
if (conf.constraintPropagationEnabled) {
constraints
.union(inferAdditionalConstraints(constraints))
.union(constructIsNotNullConstraints(constraints))
} else {
constraints
}
ExpressionSet(allRelevantConstraints.filter(selfReferenceOnly))
}

/**
* Infers a set of `isNotNull` constraints from null intolerant expressions as well as
* non-nullable attributes. For e.g., if an expression is of the form (`a > 5`), this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,24 +213,6 @@ class InferFiltersFromConstraintsSuite extends PlanTest {
testConstraintsAfterJoin(x, y, x.where(IsNotNull('a)), y.where(IsNotNull('a)), LeftSemi)
}

test("SPARK-23564: left anti join should filter out null join keys on right side") {
val x = testRelation.subquery('x)
val y = testRelation.subquery('y)
testConstraintsAfterJoin(x, y, x, y.where(IsNotNull('a)), LeftAnti)
}

test("SPARK-23564: left outer join should filter out null join keys on right side") {
val x = testRelation.subquery('x)
val y = testRelation.subquery('y)
testConstraintsAfterJoin(x, y, x, y.where(IsNotNull('a)), LeftOuter)
}

test("SPARK-23564: right outer join should filter out null join keys on left side") {
val x = testRelation.subquery('x)
val y = testRelation.subquery('y)
testConstraintsAfterJoin(x, y, x.where(IsNotNull('a)), y, RightOuter)
}

test("SPARK-21479: Outer join after-join filters push down to null-supplying side") {
val x = testRelation.subquery('x)
val y = testRelation.subquery('y)
Expand Down Expand Up @@ -263,4 +245,22 @@ class InferFiltersFromConstraintsSuite extends PlanTest {
x, y.where(IsNotNull('a) && 'a === 1),
LeftOuter)
}

test("SPARK-23564: left anti join should filter out null join keys on right side") {
val x = testRelation.subquery('x)
val y = testRelation.subquery('y)
testConstraintsAfterJoin(x, y, x, y.where(IsNotNull('a)), LeftAnti)
}

test("SPARK-23564: left outer join should filter out null join keys on right side") {
val x = testRelation.subquery('x)
val y = testRelation.subquery('y)
testConstraintsAfterJoin(x, y, x, y.where(IsNotNull('a)), LeftOuter)
}

test("SPARK-23564: right outer join should filter out null join keys on left side") {
val x = testRelation.subquery('x)
val y = testRelation.subquery('y)
testConstraintsAfterJoin(x, y, x.where(IsNotNull('a)), y, RightOuter)
}
}
You are viewing a condensed version of this merge commit. You can view the full changes here.