Commit 0487d78
[SPARK-48748][SQL] Cache numChars in UTF8String
### 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 #47142 from uros-db/cache-numchars.
Authored-by: Uros Bojanic <[email protected]>
Signed-off-by: Kent Yao <[email protected]>1 parent f49418b commit 0487d78
File tree
1 file changed
+11
-0
lines changed- common/unsafe/src/main/java/org/apache/spark/unsafe/types
1 file changed
+11
-0
lines changedLines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
257 | 268 | | |
258 | 269 | | |
259 | 270 | | |
| |||
0 commit comments