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

[BUG] regexp_replace with replacement string containing \ can produce incorrect results #4559

Closed
andygrove opened this issue Jan 18, 2022 · 0 comments · Fixed by #4556
Closed
Labels
bug Something isn't working

Comments

@andygrove
Copy link
Contributor

Describe the bug
There are differences in behavior between CPU and GPU in some cases when using regexp_replace and a replacement string that contains the backslash character,

The expression regexp_replace(strings,'[a-z]+','\\\\WORD') will replace matches with WORD on the CPU and with \WORD on the GPU.

Steps/Code to reproduce bug

Add this test to RegularExpressionsSuite.scala

testSparkResultsAreEqual("String regexp_replace with backslash ",
  extractStrings, conf = conf) {
  frame => frame.selectExpr("regexp_replace(strings,'[a-z]+','\\\\WORD')")
}

Expected behavior
Behavior should be consistent between CPU and GPU.

Environment details (please complete the following information)
N/A

Additional context
None

@andygrove andygrove added bug Something isn't working ? - Needs Triage Need team to review and classify labels Jan 18, 2022
@sameerz sameerz removed the ? - Needs Triage Need team to review and classify label Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants