Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

This PR caches the result of PartitionReader.next in PartitionIterator, so that its hasNext method is cheap to be called repeatedly.

Why are the changes needed?

potential perf improvement. PartitionReader.next can be expensive in some v2 sources, and it's legal to call Iterator.hasNext repeatedly.

Does this PR introduce any user-facing change?

no

How was this patch tested?

existing tests

@github-actions github-actions bot added the SQL label Sep 15, 2022
@LuciferYang
Copy link
Contributor

Does this pr and #37743 solve the same issue?

@cloud-fan
Copy link
Contributor Author

ah they fix the same issue. Let me comment on that PR.

Copy link
Contributor

@LuciferYang LuciferYang left a comment

Choose a reason for hiding this comment

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

+1, LGTM

@cloud-fan
Copy link
Contributor Author

Since #37743 is inactive, I'll merge this PR but assign the JIRA ticket to that PR author to share credits.

@cloud-fan
Copy link
Contributor Author

thanks for review, merging to master!

@cloud-fan cloud-fan closed this in 3b9e5cf Sep 19, 2022
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.

+1, LGTM, too.

LuciferYang pushed a commit to LuciferYang/spark that referenced this pull request Sep 20, 2022
…repeatedly

### What changes were proposed in this pull request?

This PR caches the result of `PartitionReader.next` in `PartitionIterator`, so that its `hasNext` method is cheap to be called repeatedly.

### Why are the changes needed?

potential perf improvement. `PartitionReader.next` can be expensive in some v2 sources, and it's legal to call `Iterator.hasNext` repeatedly.

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

existing tests

Closes apache#37900 from cloud-fan/minor.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
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.

5 participants