-
Notifications
You must be signed in to change notification settings - Fork 240
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
Improve regular expression error messages #5871
Merged
anthony-chang
merged 9 commits into
NVIDIA:branch-22.08
from
anthony-chang:improve-regex-error-messages
Jul 7, 2022
Merged
Improve regular expression error messages #5871
anthony-chang
merged 9 commits into
NVIDIA:branch-22.08
from
anthony-chang:improve-regex-error-messages
Jul 7, 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>
…ing regex Signed-off-by: Anthony Chang <antchang@nvidia.com>
Signed-off-by: Anthony Chang <antchang@nvidia.com>
Signed-off-by: Anthony Chang <antchang@nvidia.com>
Signed-off-by: Anthony Chang <antchang@nvidia.com>
sameerz
added
the
task
Work required that improves the product but is not user facing
label
Jun 18, 2022
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 21, 2022
sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala
Outdated
Show resolved
Hide resolved
…prove-regex-error-messages
Signed-off-by: Anthony Chang <antchang@nvidia.com>
anthony-chang
changed the title
[WIP] Improve regular expression error messages
Improve regular expression error messages
Jun 21, 2022
…prove-regex-error-messages Signed-off-by: Anthony Chang <antchang@nvidia.com>
build |
NVnavkumar
approved these changes
Jul 7, 2022
|
||
case (RegexGroup(capture, term), SimpleQuantifier(ch)) | ||
if "+*".contains(ch) && !isSupportedRepetitionBase(term) => | ||
if "+*".contains(ch) && !(isSupportedRepetitionBase(term)._1) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would recommend converting this to a pattern matching construct to avoid _1
, _2
references and the use Option.get()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do this in a separate PR
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 #4537
This PR improves the error messages when throwing
RegexUnsupportedExceptions
by attempting to isolate what exactly in the pattern is not supported. I also added aposition
field toRegexAST
and recorded the index of each node in the AST within the regular expression pattern in theparse
stage, so that this can be printed in errors thrown in therewrite
stage. AllRegexUnsupportedExceptions
must specify the index now.There should be no changes to functionality.