You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/24 00:15:51 UTC

[GitHub] [spark] wangyum edited a comment on pull request #31739: [SPARK-34622][SQL] Push down limit through Project with Join

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:
users@infra.apache.org



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