Skip to content

Commit

Permalink
combine the limits.
Browse files Browse the repository at this point in the history
  • Loading branch information
gatorsmile committed Dec 23, 2015
1 parent 3779874 commit 72f73fb
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,15 @@ object PushLimitThroughOuterJoin extends Rule[LogicalPlan] with PredicateHelper
case f @ Limit(expr, Join(left, right, joinType, joinCondition)) =>
joinType match {
case RightOuter =>
Limit(expr, Join(left, Limit(expr, right), joinType, joinCondition))
Limit(expr, Join(left, CombineLimits(Limit(expr, right)), joinType, joinCondition))
case LeftOuter =>
Limit(expr, Join(Limit(expr, left), right, joinType, joinCondition))
Limit(expr, Join(CombineLimits(Limit(expr, left)), right, joinType, joinCondition))
case FullOuter =>
Limit(expr, Join(Limit(expr, left), Limit(expr, right), joinType, joinCondition))
Limit(expr,
Join(
CombineLimits(Limit(expr, left)),
CombineLimits(Limit(expr, right)),
joinType, joinCondition))
case _ => f // DO Nothing for the other join types
}
}
Expand Down

0 comments on commit 72f73fb

Please sign in to comment.