cloud-fan commented on code in PR #36417:
URL: https://github.com/apache/spark/pull/36417#discussion_r866557269


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/limit.scala:
##########
@@ -207,32 +222,62 @@ case class GlobalLimitExec(limit: Int, child: SparkPlan) 
extends BaseLimitExec {
  * the child's single output partition.
  */
 case class GlobalLimitAndOffsetExec(
-    limit: Int,
-    offset: Int,
+    limit: Int = -1,
+    offset: Int = 0,

Review Comment:
   We don't need a default value for `offset`. If there is no offset, we should 
use `GlobalLimitExec`.



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/limit.scala:
##########
@@ -207,32 +222,62 @@ case class GlobalLimitExec(limit: Int, child: SparkPlan) 
extends BaseLimitExec {
  * the child's single output partition.
  */
 case class GlobalLimitAndOffsetExec(
-    limit: Int,
-    offset: Int,
+    limit: Int = -1,
+    offset: Int = 0,

Review Comment:
   and we can put a `assert(offset > 0)`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to