Skip to content

fix: handle empty delimiter in split_part (closes #20503) (#20542)#88

Merged
LiaCastaneda merged 1 commit intobranch-52from
lia/cherry-pick-split-part-fix
Mar 3, 2026
Merged

fix: handle empty delimiter in split_part (closes #20503) (#20542)#88
LiaCastaneda merged 1 commit intobranch-52from
lia/cherry-pick-split-part-fix

Conversation

@LiaCastaneda
Copy link

Cherry picks apache#20503 (This made it to the v53 release)

…he#20542)

- Closes apache#20503

`split_part` did not handle empty delimiters in a PostgreSQL-compatible
way (`split("")` in Rust creates leading/trailing empty fields).
This could return unexpected results for positions like `1` / `-1` and
out-of-range values.
This PR aligns behavior with Postgres semantics for empty delimiters.

Small change in how we treat the 1, -1

Indeed!

Yes, behavior is now more consistent with PostgreSQL for
`split_part(str, '', n)`.
No API changes.

(cherry picked from commit 3ab1301)
@LiaCastaneda LiaCastaneda force-pushed the lia/cherry-pick-split-part-fix branch from a8c0f00 to d904593 Compare March 3, 2026 12:00
@LiaCastaneda LiaCastaneda marked this pull request as ready for review March 3, 2026 12:03
@LiaCastaneda LiaCastaneda merged commit 25799f5 into branch-52 Mar 3, 2026
56 checks passed
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.

3 participants