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

fix: regexp_split fails in empty match pattern #12305

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HolyLow
Copy link
Contributor

@HolyLow HolyLow commented Feb 11, 2025

The implementation of Re2RegexpSplit has a bug, that it might fail to split the string when the pattern is a empty string itself.

For example, in the function calling: regexp_split("abcd", "").
The expected result is {"", "a", "b", "c", "d", ""}, but the current implementation would throw error.

This testcase comes from presto https://github.com/prestodb/presto/blob/099bd42eba287b1ea25bf55404c7a18882e0f6d5/presto-main/src/test/java/com/facebook/presto/operator/scalar/AbstractTestRegexpFunctions.java#L231

See detailed description in #12304.

This PR fix this bug in Re2RegexpSplit implementation.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 11, 2025
Copy link

netlify bot commented Feb 11, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 5933f3b
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/67ab30126931bf000869bf67

@HolyLow
Copy link
Contributor Author

HolyLow commented Feb 11, 2025

@mbasmanova @kagamiori Could you kindly help review this PR? Thanks a lot.

Any suggestion is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants