Skip to content

[SPARK-45157][SQL] Avoid repeated if checks in [On|Off|HeapColumnVector #42903

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

Conversation

cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

This is a small followup of #42850. getBytes checks if the dictionary is null or not, then call getByte which also checks if the dictionary is null or not. This PR avoids the repeated if checks by copying one line code from getByte to getBytes. The same applies to other getXXX methods.

Why are the changes needed?

Make the perf-critical path more efficient.

Does this PR introduce any user-facing change?

no

How was this patch tested?

existing tests

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

No

@github-actions github-actions bot added the SQL label Sep 13, 2023
@cloud-fan
Copy link
Contributor Author

cc @bersprockets @wangyum @dongjoon-hyun

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. Thank you, @cloud-fan .

@bersprockets
Copy link
Contributor

Also LGTM, thanks!

@bersprockets
Copy link
Contributor

Maybe a dumb procedural question: Can a follow-up cross release boundaries? v3.5.0 will have SPARK-44805 but not its follow-up. Should this be a new Jira?

@dongjoon-hyun
Copy link
Member

Oh, you are right. This should have a new JIRA., @bersprockets .

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-44805][SQL][FOLLOWUP] Avoid repeated if checks [SPARK-45157][SQL] Avoid repeated if checks in [On|Off|HeapColumnVector Sep 13, 2023
@dongjoon-hyun
Copy link
Member

I created an Improvement JIRA, SPARK-45157.
Merged to master for Apache Spark 4.0.0.

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