Skip to content

GH-35815: [C++][Compute] Support dictionary inputs in UTF-8 trim#50501

Draft
LarryHu0217 wants to merge 1 commit into
apache:mainfrom
LarryHu0217:codex/arrow-dictionary-utf8-trim-35815
Draft

GH-35815: [C++][Compute] Support dictionary inputs in UTF-8 trim#50501
LarryHu0217 wants to merge 1 commit into
apache:mainfrom
LarryHu0217:codex/arrow-dictionary-utf8-trim-35815

Conversation

@LarryHu0217

@LarryHu0217 LarryHu0217 commented Jul 13, 2026

Copy link
Copy Markdown

Rationale for this change

The UTF-8 trim functions only registered kernels for string and large-string inputs. Their exact dispatch therefore rejected dictionary-encoded strings even though the dictionary value type was supported.

What changes are included in this PR?

  • Allow the stateful unary string-kernel helper to use a specialized function type.
  • Decode dictionary input types during dispatch for utf8_trim, utf8_ltrim, and utf8_rtrim.
  • Add regression coverage for dictionary-encoded string and large-string arrays, including nulls.

Are these changes tested?

  • arrow-compute-scalar-type-test --gtest_filter='*TrimUTF8*' (4 passed)
  • arrow-compute-scalar-type-test --gtest_brief=1 (344 passed, 1 pre-existing disabled test)
  • C++ Debug build with warnings treated as errors
  • clang-format 18.1.8 and cpplint 1.6.1

Are there any user-facing changes?

Yes. The three UTF-8 trim functions now accept dictionary-encoded string inputs and return decoded string arrays. There are no public API signature changes.

AI-assisted development

OpenAI Codex assisted with reproducing the issue, implementing the patch, and drafting the regression tests. The change was checked against Arrow's existing dictionary-dispatch patterns and validated with the commands above.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #35815 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions Bot added awaiting review Awaiting review Component: C++ and removed awaiting review Awaiting review labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant