-
Notifications
You must be signed in to change notification settings - Fork 232
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
Handle regexp_replace inconsistency with empty strings and zero-repetition patterns [databricks] #5740
Merged
anthony-chang
merged 18 commits into
NVIDIA:branch-22.08
from
anthony-chang:regexp-shim-5456
Jun 8, 2022
Merged
Handle regexp_replace inconsistency with empty strings and zero-repetition patterns [databricks] #5740
anthony-chang
merged 18 commits into
NVIDIA:branch-22.08
from
anthony-chang:regexp-shim-5456
Jun 8, 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>
Signed-off-by: Anthony Chang <antchang@nvidia.com>
andygrove
reviewed
Jun 6, 2022
sql-plugin/src/main/311-nondb/scala/com/nvidia/spark/rapids/shims/RegExpShim.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 6, 2022
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/stringFunctions.scala
Outdated
Show resolved
Hide resolved
Signed-off-by: Anthony Chang <antchang@nvidia.com>
Signed-off-by: Anthony Chang <antchang@nvidia.com>
@anthony-chang I know this is still WIP but could you update the PR description to explain what is changed in this PR |
Signed-off-by: Anthony Chang <antchang@nvidia.com>
build |
Signed-off-by: Anthony Chang <antchang@nvidia.com>
build |
1 similar comment
build |
Signed-off-by: Anthony Chang <antchang@nvidia.com>
anthony-chang
force-pushed
the
regexp-shim-5456
branch
from
June 7, 2022 19:41
e63aa01
to
be93d92
Compare
build |
Signed-off-by: Anthony Chang <antchang@nvidia.com>
Signed-off-by: Anthony Chang <antchang@nvidia.com>
build |
anthony-chang
changed the title
[WIP] Handle regexp_replace inconsistency with empty strings and zero-repetition patterns
[WIP] Handle regexp_replace inconsistency with empty strings and zero-repetition patterns [databricks]
Jun 7, 2022
Signed-off-by: Anthony Chang <antchang@nvidia.com>
Signed-off-by: Anthony Chang <antchang@nvidia.com>
build |
anthony-chang
changed the title
[WIP] Handle regexp_replace inconsistency with empty strings and zero-repetition patterns [databricks]
Handle regexp_replace inconsistency with empty strings and zero-repetition patterns [databricks]
Jun 8, 2022
andygrove
reviewed
Jun 8, 2022
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/stringFunctions.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Jun 8, 2022
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/stringFunctions.scala
Outdated
Show resolved
Hide resolved
Co-authored-by: Andy Grove <andygrove73@gmail.com>
build |
NVnavkumar
reviewed
Jun 8, 2022
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/stringFunctions.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/stringFunctions.scala
Outdated
Show resolved
Hide resolved
Signed-off-by: Anthony Chang <antchang@nvidia.com>
Signed-off-by: Anthony Chang <antchang@nvidia.com>
build |
NVnavkumar
approved these changes
Jun 8, 2022
andygrove
approved these changes
Jun 8, 2022
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.
Fixes #5456
When using
regexp_replace
on an empty string using a regex pattern containing only zero-repetitions (eg.*
,?
,{0,}
, etc), the behaviour is different depending on which version of Spark.Given the input
Spark versions 3.1.3, 3.1.4, 3.2.2, 3.3.0+ gives
but all other versions gives
This PR adds shims for the 2nd case to short circuit the plugin regex handling.
Signed-off-by: Anthony Chang antchang@nvidia.com