Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESQL: LTRIM, RTRIM and fix unicode whitespace #98548

Closed
wants to merge 2 commits into from

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Aug 16, 2023

Here we add support for the following two ESQL functions:

  • LTRIM: remove leading spaces from a string
  • RTRIM: remove trailing spaces from a string

We also fix an issue with the handling of unicode white spaces. We make use of unicode code points to identify unicode whitespace characters instead of relying on ASCII codes.

Moreover, iterating bytes in a Unicode string needs to consider that some Unicode characters are encoded using multiple bytes.

Here we add support for the following two ESQL functions:
* LTRIM: remove leading spaces from a string
* RTRIM: remove trailing spaces from a string

We also fix an issue with the handling of unicode white spaces.
We make use of unicode code points to identify unicode
whitespace characters instead of relying on ASCII codes.

Moreover, iterating bytes in a Unicode string needs to consider
that some Unicode characters are encoded using multiple bytes.
@github-actions
Copy link
Contributor

Documentation preview:

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

@elasticsearchmachine elasticsearchmachine added the Team:QL (Deprecated) Meta label for query languages team label Aug 16, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL)

@nik9000
Copy link
Member Author

nik9000 commented Aug 16, 2023

This is work originally done by @salvatore-campagna against the original ESQL repo. He didn't get to merge it before he stepped out for a while so I've modernized it and will land it here.

@nik9000 nik9000 added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Aug 16, 2023
@nik9000 nik9000 mentioned this pull request Aug 16, 2023
76 tasks
Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGoodTM, though with some tests on just empty spaces and empty string it would LGreatTM.

@ChrisHegarty ChrisHegarty deleted the branch elastic:feature/esql August 17, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >feature Team:QL (Deprecated) Meta label for query languages team v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants