Skip to content

Conversation

beliefer
Copy link
Contributor

What changes were proposed in this pull request?

This PR proposes to improve OffsetAndLimit by avoiding duplicate evaluation.

Why are the changes needed?

OffsetAndLimit doesn't return the local limit (the same as offset + global limit), it lead to duplicate evaluation.

Does this PR introduce any user-facing change?

'No'.
Inner change.

How was this patch tested?

GA tests.

Was this patch authored or co-authored using generative AI tooling?

'No'.

@github-actions github-actions bot added the SQL label Sep 11, 2025
@beliefer
Copy link
Contributor Author

ping @cloud-fan @dongjoon-hyun @viirya

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-53551][SQL] Improve OffsetAndLimit by avoiding duplicate evaluation [SPARK-53551][SQL] Improve OffsetAndLimit by avoiding duplicate evaluation Sep 12, 2025
@dongjoon-hyun
Copy link
Member

Thank you for pinging me, @beliefer .

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

At a first glance, this PR aims to replace offset + limit with localLimit simply?

A few Int add operations seems to be saved. Is there any other improvement, @beliefer ?

@beliefer
Copy link
Contributor Author

At a first glance, this PR aims to replace offset + limit with localLimit simply?

Yes. offset + limit equals to localLimit and have the same meaning.

A few Int add operations seems to be saved. Is there any other improvement, @beliefer ?

No. But I added some comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants