Skip to content

Commit

Permalink
change code according to review
Browse files Browse the repository at this point in the history
  • Loading branch information
huleilei committed Mar 1, 2018
1 parent ed5c170 commit 023f2f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,9 @@ trait QueryPlanConstraints { self: LogicalPlan =>
* An [[ExpressionSet]] that contains an additional set of constraints, such as equality
* constraints and `isNotNull` constraints, etc.
*/
lazy val allConstraints: ExpressionSet = {
if (conf.constraintPropagationEnabled) {
ExpressionSet(validConstraints
lazy val allConstraints: ExpressionSet = ExpressionSet(validConstraints
.union(inferAdditionalConstraints(validConstraints))
.union(constructIsNotNullConstraints(validConstraints)))
} else {
ExpressionSet(Set.empty)
}
}

/**
* An [[ExpressionSet]] that contains invariants about the rows output by this operator. For
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ class InferFiltersFromConstraintsSuite extends PlanTest {
val originalQuery = x.join(y, LeftSemi, condition).analyze
val left = x.where(IsNotNull('a))
val right = y.where(IsNotNull('a))
val correctAnswer = left.join(right, LeftSemi, condition)
.analyze
val correctAnswer = left.join(right, LeftSemi, condition).analyze
val optimized = Optimize.execute(originalQuery)
comparePlans(optimized, correctAnswer)
}
Expand Down

0 comments on commit 023f2f7

Please sign in to comment.