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] \D and \W match newline in Spark but not in cuDF #4475

Closed
andygrove opened this issue Jan 7, 2022 · 0 comments · Fixed by #4527
Closed

[BUG] \D and \W match newline in Spark but not in cuDF #4475

andygrove opened this issue Jan 7, 2022 · 0 comments · Fixed by #4527
Assignees
Labels
bug Something isn't working

Comments

@andygrove
Copy link
Contributor

andygrove commented Jan 7, 2022

Describe the bug
\D is inconsistent between Spark and cuDF. Spark will match newline and cuDF does not. This may also apply to \d.

Steps/Code to reproduce bug

test("compare CPU and GPU: non-digit class") {
  val patterns = Seq(raw"\D", raw"\d\D\d", raw"\D\d\D")
  val inputs = Seq("1", "a1b", "1a2", " 1\n", " a\n")
  assertCpuGpuMatchesRegexpFind(patterns, inputs)
}

Fails with:

javaPattern=\D\d\D, cudfPattern=\D\d\D, input=' 1\n', cpu=true, gpu=false

Expected behavior
Behavior should be made consistent by transpiling to an equivalent term in cuDF (perhaps (?:\D|\n))

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 7, 2022
@andygrove andygrove added this to the Jan 10 - Jan 28 milestone Jan 7, 2022
@andygrove andygrove self-assigned this Jan 7, 2022
@andygrove andygrove changed the title [BUG] [BUG] \D matches newline in Spark but not in cuDF Jan 7, 2022
@sameerz sameerz removed the ? - Needs Triage Need team to review and classify label Jan 11, 2022
@andygrove andygrove changed the title [BUG] \D matches newline in Spark but not in cuDF [BUG] \D and \W match newline in Spark but not in cuDF Jan 12, 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