Skip to content

Commit c070e92

Browse files
viiryaericm-db
authored andcommitted
[MINOR][SQL] Remove out-of-dated comment in CollectLimitExec
### What changes were proposed in this pull request? This patch removes an out-of-dated code comment that was added by apache#35975. ### Why are the changes needed? Removed out-of-dated comment to reduce misunderstanding and confusion. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing test ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#45311 from viirya/remove_comment. Authored-by: Liang-Chi Hsieh <viirya@gmail.com> Signed-off-by: yangjie01 <yangjie01@baidu.com>
1 parent dda4a56 commit c070e92

File tree

1 file changed

+0
-5
lines changed
  • sql/core/src/main/scala/org/apache/spark/sql/execution

1 file changed

+0
-5
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/limit.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ case class CollectLimitExec(limit: Int = -1, child: SparkPlan, offset: Int = 0)
5050
override def output: Seq[Attribute] = child.output
5151
override def outputPartitioning: Partitioning = SinglePartition
5252
override def executeCollect(): Array[InternalRow] = {
53-
// Because CollectLimitExec collect all the output of child to a single partition, so we need
54-
// collect the first `limit` + `offset` elements and then to drop the first `offset` elements.
55-
// For example: limit is 1 and offset is 2 and the child output two partition.
56-
// The first partition output [1, 2] and the Second partition output [3, 4, 5].
57-
// Then [1, 2, 3] will be taken and output [3].
5853
if (limit >= 0) {
5954
if (offset > 0) {
6055
child.executeTake(limit).drop(offset)

0 commit comments

Comments
 (0)