Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22344#discussion_r218630241
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/limit.scala ---
    @@ -98,7 +98,8 @@ case class LocalLimitExec(limit: Int, child: SparkPlan) 
extends UnaryExecNode wi
     /**
      * Take the `limit` elements of the child output.
      */
    -case class GlobalLimitExec(limit: Int, child: SparkPlan) extends 
UnaryExecNode {
    +case class GlobalLimitExec(limit: Int, child: SparkPlan,
    +                           orderedLimit: Boolean = false) extends 
UnaryExecNode {
    --- End diff --
    
    When limit number is more than `SQLConf.TOP_K_SORT_FALLBACK_THRESHOLD`, the 
planner won't choose `TakeOrderedAndProjectExec` to perform the sort + limit 
operation.


---

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

Reply via email to