wangyum edited a comment on pull request #31739:
URL: https://github.com/apache/spark/pull/31739#issuecomment-805359628
> Last question: do we push down limit through project?
It seems push down limit through project no benefit:
```scala
spark.range(2000L).selectExpr("id AS a", "id AS b").write.saveAsTable("t1")
spark.sql("select a, java_method('java.lang.Thread', 'sleep', 3000L) from t1
limit 5").show()
spark.sql("select a, java_method('java.lang.Thread', 'sleep', 3000L) from
(select * from t1 limit 5) t limit 5").show()
```
```
== Optimized Logical Plan ==
GlobalLimit 5
+- LocalLimit 5
+- Project [a#16L, java_method(java.lang.Thread, sleep, 3000) AS
java_method(java.lang.Thread, sleep, 3000)#18]
+- Relation default.t1[a#16L,b#17L] parquet
```
```
== Optimized Logical Plan ==
Project [a#16L, java_method(java.lang.Thread, sleep, 3000) AS
java_method(java.lang.Thread, sleep, 3000)#21]
+- GlobalLimit 5
+- LocalLimit 5
+- Project [a#16L]
+- Relation default.t1[a#16L,b#17L] parquet
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]