yaooqinn commented on code in PR #44699:
URL: https://github.com/apache/spark/pull/44699#discussion_r1449865361


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala:
##########
@@ -1446,6 +1446,25 @@ class PlannerSuite extends SharedSparkSession with 
AdaptiveSparkPlanHelper {
       }
     }
   }
+
+  test("Limit and offset should not drop LocalLimitExec operator") {
+    val df = sql("SELECT * FROM (SELECT * FROM RANGE(100000) LIMIT 25 OFFSET 
3) WHERE id > 1000")
+    df.collect()

Review Comment:
   Is the action here even necessary?



##########
sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala:
##########
@@ -1446,6 +1446,25 @@ class PlannerSuite extends SharedSparkSession with 
AdaptiveSparkPlanHelper {
       }
     }
   }
+
+  test("Limit and offset should not drop LocalLimitExec operator") {
+    val df = sql("SELECT * FROM (SELECT * FROM RANGE(100000) LIMIT 25 OFFSET 
3) WHERE id > 1000")
+    df.collect()
+
+    val planned = df.queryExecution.sparkPlan
+    assert(planned.exists(_.isInstanceOf[GlobalLimitExec]))
+    assert(planned.exists(_.isInstanceOf[LocalLimitExec]))
+  }
+
+  test("Offset and limit should not drop LocalLimitExec operator") {
+    val df = sql("""SELECT * FROM (SELECT * FROM
+      (SELECT * FROM RANGE(100000) LIMIT 25) OFFSET 3) WHERE id > 
1000""".stripMargin)
+    df.collect()

Review Comment:
   ditto



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to