Skip to content

lpad, rpad, translate should use codepoints, not graphemes #21060

Closed

Description

@neilconway

Describe the bug

For consistency with most other SQL implementations (including Postgres), as well as the rest of DataFusion, lpad, rpad, and translate should use codepoints when manipulating Unicode strings, not graphemes. #3054 switched to using codepoints instead of graphemes in most places, but AFAICS the same should be done for these remaining UDFs.

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Activity

  1. added theissue type on Mar 19, 2026
  2. neilconway commented on Mar 19, 2026

    @neilconway
    ContributorAuthor

    take

  3. neilconway commented on Mar 19, 2026

    @neilconway
    ContributorAuthor

    @Dandandan I realize it was a long time ago, but if there was a reason you chose to have lpad, rpad, and translate continue to consider graphemes instead of codepoints, please let me know 😊

  4. added a commit that references this issue on Apr 9, 2026
    6c106ba
  5. added a commit that references this issue on Apr 21, 2026
    81b5148
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions