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

Add partial support for line begin and end anchors in regexp_replace #4155

Merged
merged 9 commits into from
Jan 4, 2022

Conversation

andygrove
Copy link
Contributor

Closes #4091

Signed-off-by: Andy Grove <andygrove@nvidia.com>
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove andygrove added this to the Nov 15 - Nov 26 milestone Nov 18, 2021
@andygrove andygrove self-assigned this Nov 18, 2021
@jlowe jlowe changed the title Add partial support for BOL and EOL in regexp_replace Add partial support for line begin and end anchors in regexp_replace Nov 18, 2021
|| isRegexChar(parts.head, '$'))) {
throw new RegexUnsupportedException("regexp_replace on GPU does not support ^ or $")
if (parts.forall {
case RegexChar(ch) => ch == '^' || ch == '$'
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to worry about any degenerate cases of other directives (e.g.: empty group, character class, etc.) that would essentially be equivalent to just having these characters in the pattern?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For empty groups, we would fall back to CPU, but I did find one case that is not detected by this rule ((^)($)) so will spend some more time on this.

Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove andygrove marked this pull request as draft December 1, 2021 17:55
@andygrove andygrove changed the title Add partial support for line begin and end anchors in regexp_replace WIP: Add partial support for line begin and end anchors in regexp_replace Dec 1, 2021
@andygrove
Copy link
Contributor Author

Converting this to WIP since there are regressions caused by other regexp PRs that were recently merged

@sameerz sameerz added the feature request New feature or request label Dec 10, 2021
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove
Copy link
Contributor Author

build

@andygrove andygrove changed the title WIP: Add partial support for line begin and end anchors in regexp_replace Add partial support for line begin and end anchors in regexp_replace Dec 20, 2021
@andygrove andygrove marked this pull request as ready for review December 20, 2021 21:26
@andygrove
Copy link
Contributor Author

build

1 similar comment
@andygrove
Copy link
Contributor Author

build

patterns.foreach(pattern =>
assertUnsupported(pattern, "nothing to repeat"))
assertUnsupported(pattern, replace = false,
"cuDF does not support null characters in regular expressions"))
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is no longer valid and the patterns tested here have moved to a different test

@andygrove
Copy link
Contributor Author

Sign-off check is failing due to:

  Step 1/5 : FROM python:alpine
  Head "https://registry-1.docker.io/v2/library/python/manifests/alpine": received unexpected HTTP status: 503 Service Unavailable

@andygrove
Copy link
Contributor Author

build

Signed-off-by: Andy Grove <andygrove@nvidia.com>
Copy link
Member

@jlowe jlowe left a comment

Choose a reason for hiding this comment

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

CI is failing due to an unrelated issue, see #4423.

@sameerz
Copy link
Collaborator

sameerz commented Dec 30, 2021

build

@andygrove
Copy link
Contributor Author

build

@andygrove andygrove merged commit 8bb8dbe into NVIDIA:branch-22.02 Jan 4, 2022
@andygrove andygrove deleted the regex-replace-bol-eol branch January 4, 2022 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] regexp_replace: Improve support for ^ and $
3 participants