perf: preserve dictionary encoding for bit_length, octet_length, and ascii#23743
Merged
Jefffrey merged 5 commits intoJul 23, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #23743 +/- ##
==========================================
- Coverage 80.70% 80.69% -0.02%
==========================================
Files 1089 1089
Lines 368038 368484 +446
Branches 368038 368484 +446
==========================================
+ Hits 297031 297351 +320
- Misses 53308 53415 +107
- Partials 17699 17718 +19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Jefffrey
approved these changes
Jul 21, 2026
| ASCII(ascii_2) as c2, | ||
| ASCII(unicode_1) as c3, | ||
| ASCII(unicode_2) as c4 | ||
| arrow_cast(ASCII(ascii_1), 'Int32') as c1, |
Contributor
There was a problem hiding this comment.
is this to preserve the return type above? query IIII
Contributor
Author
There was a problem hiding this comment.
Yes, this keeps the existing value test unchanged.
Contributor
|
thanks @lyne7-sc |
Contributor
Author
|
Thanks for the review @Jefffrey |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
CoercionAPI #19458Rationale for this change
String functions normally materialize
Dictionary(K, Utf8)inputs before evaluation. This loses the dictionary encoding and applies the function to every row instead of only the unique dictionary values.This pr extends the dictionary-preserving implementation from #22905 to
ascii,bit_length, andoctet_length.What changes are included in this PR?
ascii,bit_length, andoctet_length.Are these changes tested?
Yes, covered by SLTs.
Are there any user-facing changes?
Yes. These functions now preserve Dictionary encoding in their output:
Dictionary(K, Utf8) -> Dictionary(K, Int32)Benchmarks