-
Notifications
You must be signed in to change notification settings - Fork 244
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 support for \h
, \H
, \v
, \V
, and \R
character classes
#5477
Merged
revans2
merged 6 commits into
NVIDIA:branch-22.06
from
anthony-chang:support-new-java8-char-classes
May 17, 2022
Merged
Add support for \h
, \H
, \v
, \V
, and \R
character classes
#5477
revans2
merged 6 commits into
NVIDIA:branch-22.06
from
anthony-chang:support-new-java8-char-classes
May 17, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Anthony Chang <antchang@nvidia.com>
\h
, \H
, \v
, \V
, and \R
character classes
revans2
reviewed
May 12, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
Signed-off-by: Anthony Chang <antchang@nvidia.com>
…into support-new-java8-char-classes
…into support-new-java8-char-classes Signed-off-by: Anthony Chang <antchang@nvidia.com>
revans2
previously approved these changes
May 12, 2022
NVnavkumar
reviewed
May 12, 2022
tests/src/test/scala/com/nvidia/spark/rapids/RegularExpressionTranspilerSuite.scala
Outdated
Show resolved
Hide resolved
Signed-off-by: Anthony Chang <antchang@nvidia.com>
build |
revans2
reviewed
May 13, 2022
… and add support for reptitions Signed-off-by: Anthony Chang <antchang@nvidia.com>
build |
revans2
approved these changes
May 16, 2022
anthony-chang
added a commit
to anthony-chang/spark-rapids
that referenced
this pull request
May 17, 2022
…VIDIA#5477) Signed-off-by: Anthony Chang <antchang@nvidia.com>
anthony-chang
added a commit
to anthony-chang/spark-rapids
that referenced
this pull request
May 17, 2022
…VIDIA#5477) Signed-off-by: Anthony Chang <antchang@nvidia.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #4605
Java 8 added support for the character classes
\h
,\H
(horizontal whitespace),\v
,\V
(vertical whitespace), and\R
(unicode linebreak sequence). This adds support for these character classes on GPU by transpiling to equivalent character classes, which can be found here: https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html.EDIT:
A couple updates to this PR:
rewrite
to theparse
section to handle the case where cuDF and Java treats newlines for negative character matches differently (which is dealt with in theRegexCharacterClass
case inrewrite
). By expanding the character classes earlier inparse
, we can then make any modifications to the AST such as this case inrewrite
\R
due to an inconsistency within Java. The Java docs says\R
is equivalent to\r\n|[\n\u000B\u000C\r\u0085\u2028\u2029]
but if we run the pattern\R{2}
against the inputa\r\nb
, Java finds no matches, whereas cuDF finds 1 match (which is correct).Signed-off-by: Anthony Chang antchang@nvidia.com