File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
main/scala/org/apache/spark/sql/catalyst/optimizer
test/scala/org/apache/spark/sql/catalyst/optimizer Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1458,7 +1458,7 @@ object PushPredicateThroughJoin extends Rule[LogicalPlan] with PredicateHelper {
14581458 */
14591459object EliminateLimits extends Rule [LogicalPlan ] {
14601460 private def canEliminate (limitExpr : Expression , child : LogicalPlan ): Boolean = {
1461- limitExpr.foldable && child.maxRows.exists { _ <= limitExpr.eval().toString.toLong }
1461+ limitExpr.foldable && child.maxRows.exists { _ <= limitExpr.eval().asInstanceOf [ Int ] }
14621462 }
14631463
14641464 def apply (plan : LogicalPlan ): LogicalPlan = plan transformDown {
Original file line number Diff line number Diff line change @@ -109,10 +109,10 @@ class CombiningLimitsSuite extends PlanTest {
109109 comparePlans(optimized3, query3)
110110
111111 // test sort after limit
112- val query4 = testRelation.select().groupBy()(count(1 ))
112+ val query4 = testRelation.select(Symbol ( " a " ) ).groupBy()(count(1 ))
113113 .orderBy(Symbol (" a" ).asc).limit(1 ).analyze
114114 val optimized4 = Optimize .execute(query4)
115- val expected4 = testRelation.select().groupBy()(count(1 ))
115+ val expected4 = testRelation.select(Symbol ( " a " ) ).groupBy()(count(1 ))
116116 .orderBy(Symbol (" a" ).asc).analyze
117117 comparePlans(optimized4, expected4)
118118 }
You can’t perform that action at this time.
0 commit comments