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

    https://github.com/apache/spark/pull/15596#discussion_r84815874
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/limit.scala ---
    @@ -36,14 +36,15 @@ import org.apache.spark.util.Utils
     case class CollectLimitExec(limit: Int, child: SparkPlan) extends 
UnaryExecNode {
       override def output: Seq[Attribute] = child.output
       override def outputPartitioning: Partitioning = SinglePartition
    -  override def executeCollect(): Array[InternalRow] = 
child.executeTake(limit)
    -  private val serializer: Serializer = new 
UnsafeRowSerializer(child.output.size)
    +  override def requiredChildDistribution: List[Distribution] = AllTuples 
:: Nil
    +  override def executeCollect(): Array[InternalRow] = {
    +    child.collect {
    --- End diff --
    
    That seems a good idea. I once thought about the difference between 
`GlobalLimitExec` and `CollectLimitExec` during refactoring this. But decided 
not to change too much. Looks like I could remove `CollectLimitExec`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to