Skip to content

Conversation

@kumarUjjawal
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

  • initcap uses make_scalar_function which converts scalar inputs to arrays.

What changes are included in this PR?

  • Add scalar fast path for Utf8/LargeUtf8/Utf8View inputs
  • Reuse existing initcap_string helper for direct scalar processing

Are these changes tested?

Yes. Unit tests and sqllogictest pass.

Benchmark Results

Type Before After Speedup
scalar_utf8 698 ns 250 ns 2.8x
scalar_utf8view 729 ns 248 ns 2.9x

Measured using:

cargo bench -p datafusion-functions --bench initcap -- "scalar"

Are there any user-facing changes?

No

@github-actions github-actions bot added the functions Changes to functions implementation label Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants