Skip to content

Commit

Permalink
Check if forcedMaxOutputRows is negative
Browse files Browse the repository at this point in the history
  • Loading branch information
wForget committed Mar 12, 2024
1 parent ddf347f commit 057c538
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ trait ForcedMaxOutputRowsBase extends Rule[LogicalPlan] {

protected def canInsertLimit(p: LogicalPlan, maxOutputRowsOpt: Option[Int]): Boolean = {
maxOutputRowsOpt match {
case Some(forcedMaxOutputRows) => canInsertLimitInner(p) &&
case Some(forcedMaxOutputRows) if forcedMaxOutputRows >= 0 => canInsertLimitInner(p) &&
!p.maxRows.exists(_ <= forcedMaxOutputRows)
case None => false
case _ => false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ trait ForcedMaxOutputRowsBase extends Rule[LogicalPlan] {

protected def canInsertLimit(p: LogicalPlan, maxOutputRowsOpt: Option[Int]): Boolean = {
maxOutputRowsOpt match {
case Some(forcedMaxOutputRows) => canInsertLimitInner(p) &&
case Some(forcedMaxOutputRows) if forcedMaxOutputRows >= 0 => canInsertLimitInner(p) &&
!p.maxRows.exists(_ <= forcedMaxOutputRows)
case None => false
case _ => false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ trait ForcedMaxOutputRowsBase extends Rule[LogicalPlan] {

protected def canInsertLimit(p: LogicalPlan, maxOutputRowsOpt: Option[Int]): Boolean = {
maxOutputRowsOpt match {
case Some(forcedMaxOutputRows) => canInsertLimitInner(p) &&
case Some(forcedMaxOutputRows) if forcedMaxOutputRows >= 0 => canInsertLimitInner(p) &&
!p.maxRows.exists(_ <= forcedMaxOutputRows)
case None => false
case _ => false
}
}

Expand Down

0 comments on commit 057c538

Please sign in to comment.