Skip to content

Commit

Permalink
Update CombiningLimitsSuite.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
pzzs committed Apr 29, 2015
1 parent e2a491d commit 7db4566
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class CombiningLimitsSuite extends PlanTest {

object Optimize extends RuleExecutor[LogicalPlan] {
val batches =
Batch("Filter Pushdown", FixedPoint(100),
ColumnPruning) ::
Batch("Combine Limit", FixedPoint(10),
CombineLimits) ::
Batch("Constant Folding", FixedPoint(10),
Expand Down Expand Up @@ -69,4 +71,22 @@ class CombiningLimitsSuite extends PlanTest {

comparePlans(optimized, correctAnswer)
}

test("limits: combines two limits after ColumnPruning") {
val originalQuery =
testRelation
.select('a)
.limit(2)
.select('a)
.limit(5)

val optimized = Optimize(originalQuery.analyze)
val correctAnswer =
testRelation
.select('a)
.limit(2).analyze

comparePlans(optimized, correctAnswer)
}

}

0 comments on commit 7db4566

Please sign in to comment.