Skip to content

[MINOR][SQL] Remove out-of-dated comment in CollectLimitExec #45311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

if (limit >= 0) {
if (offset > 0) {
child.executeTake(limit).drop(offset)
Expand Down