Skip to content
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

[SPARK-48748][SQL] Cache numChars in UTF8String #47142

Closed
wants to merge 3 commits into from

Conversation

uros-db
Copy link
Contributor

@uros-db uros-db commented Jun 28, 2024

What changes were proposed in this pull request?

Cache numChars value in a thread-safe way.

Why are the changes needed?

Faster access to numChars() method, which currently requires entire UTF8String scan every time.

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.

@uros-db uros-db requested a review from yaooqinn June 29, 2024 12:13
Copy link
Member

@yaooqinn yaooqinn left a comment

Choose a reason for hiding this comment

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

LGTM

@yaooqinn yaooqinn closed this in 0487d78 Jul 1, 2024
@yaooqinn
Copy link
Member

yaooqinn commented Jul 1, 2024

Thank you @uros-db , merged to master

attilapiros pushed a commit to attilapiros/spark that referenced this pull request Oct 4, 2024
### What changes were proposed in this pull request?
Cache `numChars` value in a thread-safe way.

### Why are the changes needed?
Faster access to `numChars()` method, which currently requires entire UTF8String scan every time.

### 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.

Closes apache#47142 from uros-db/cache-numchars.

Authored-by: Uros Bojanic <157381213+uros-db@users.noreply.github.com>
Signed-off-by: Kent Yao <yao@apache.org>
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.

3 participants