viirya commented on code in PR #45311:
URL: https://github.com/apache/spark/pull/45311#discussion_r1505557135


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/limit.scala:
##########
@@ -50,11 +50,6 @@ case class CollectLimitExec(limit: Int = -1, child: 
SparkPlan, offset: Int = 0)
   override def output: Seq[Attribute] = child.output
   override def outputPartitioning: Partitioning = SinglePartition
   override def executeCollect(): Array[InternalRow] = {
-    // Because CollectLimitExec collect all the output of child to a single 
partition, so we need
-    // collect the first `limit` + `offset` elements and then to drop the 
first `offset` elements.
-    // For example: limit is 1 and offset is 2 and the child output two 
partition.
-    // The first partition output [1, 2] and the Second partition output [3, 
4, 5].
-    // Then [1, 2, 3] will be taken and output [3].

Review Comment:
   While I reviewed something related to this, the comment read confused to me. 
I traced it to original PR #35975, but the code was already updated by later 
PRs. This comment is actually out-of-dated and not matched to the code.



-- 
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