Skip to content

Commit

Permalink
Optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
beliefer committed Jan 21, 2020
1 parent d18c591 commit e7b4d43
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ trait CheckAnalysis extends PredicateHelper {
}

/**
* Validates that the root plan is [[Offset]].
* Validate that the root node of query or subquery is [[Offset]].
*/
private def checkOutermostOffset(plan: LogicalPlan): Unit = {
plan match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ object CombineLimits extends Rule[LogicalPlan] {
* merging the expressions into one single expression.
*/
object RewriteOffsets extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transformUp {
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
case GlobalLimit(le, oe, Offset(noe, grandChild)) =>
GlobalLimit(le, Greatest(Seq(noe, oe)), grandChild)
case LocalLimit(le, oe, Offset(noe, grandChild)) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ case class Offset(offsetExpr: Expression, child: LogicalPlan) extends OrderPrese
* So we introduced LocalLimit and GlobalLimit in the logical plan node for limit pushdown.
*/
object Limit {
val INVALID_LIMIT = Literal(Int.MaxValue)
val INVALID_LIMIT = Literal(-1)
def apply(
limitExpr: Expression,
offsetExpr: Expression = Literal(0),
Expand Down

0 comments on commit e7b4d43

Please sign in to comment.