-
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
regexp_replace with back-references should fall back to CPU #4556
regexp_replace with back-references should fall back to CPU #4556
Conversation
…ck-references Signed-off-by: Andy Grove <andygrove@nvidia.com>
…e-backref-fallback
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 am not thrilled with using a regular expression to find the back references, but I could not figure out a better way to do it either.
|
||
expr.rep match { | ||
case Literal(s: UTF8String, DataTypes.StringType) if s != null => | ||
val backrefPattern = Pattern.compile("\\$[0-9]") |
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.
Note that this can create false-positives. A Spark regex replace string of "\\$1"
isn't asking for a group but this pattern matcher will think it is.
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 was working on a fix for this but that exposed another issue that I am going to have to fix first, so I will mark this PR as a draft for now.
Signed-off-by: Andy Grove <andygrove@nvidia.com>
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/stringFunctions.scala
Show resolved
Hide resolved
sql-plugin/src/main/scala/org/apache/spark/sql/rapids/stringFunctions.scala
Outdated
Show resolved
Hide resolved
build |
Closes #4503 and #4559
Follow-on issue to support back-references on the GPU: #4557