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] to_date produces wrong value on GPU for some corner cases #2868

Closed
andygrove opened this issue Jul 2, 2021 · 0 comments · Fixed by #2890
Closed

[BUG] to_date produces wrong value on GPU for some corner cases #2868

andygrove opened this issue Jul 2, 2021 · 0 comments · Fixed by #2890
Assignees
Labels
bug Something isn't working P0 Must have for release

Comments

@andygrove
Copy link
Contributor

Describe the bug

to_date (without a format specified) produces incorrect results for some invalid inputs. For example, the input string 3330-7 39 49 produces null on the CPU but produces the date 3330-07-01 on the GPU.

CPU: [3330-7 39 49: 1,null]

GPU: [3330-7 39 49: 1,3330-07-01]

Steps/Code to reproduce bug

I was experimenting with some basic fuzzing in the unit test.

private def generateTimestampStrings(n: Int): Seq[String] = {
  val validChars = "0123456789:-. \t\n"
  val rand = new Random(0) // fixed seed
  val list = new ListBuffer[String]()
  for (_ <- 0 to n) {
    val len = rand.nextInt(32)
    val str = new StringBuilder(len)
    for (_ <- 0 to len) {
      str.append(validChars.charAt(rand.nextInt(validChars.length)))
    }
    list += str.toString
  }
  list
}

Expected behavior
Results should be consistent between CPU and GPU.

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

Additional context
N/A

@andygrove andygrove added bug Something isn't working ? - Needs Triage Need team to review and classify labels Jul 2, 2021
@andygrove andygrove added this to the July 5 - July 16 milestone Jul 2, 2021
@andygrove andygrove self-assigned this Jul 2, 2021
@andygrove andygrove removed this from the July 5 - July 16 milestone Jul 6, 2021
@Salonijain27 Salonijain27 removed the ? - Needs Triage Need team to review and classify label Jul 6, 2021
@Salonijain27 Salonijain27 added this to the July 5 - July 16 milestone Jul 6, 2021
@Salonijain27 Salonijain27 added the P0 Must have for release label Jul 6, 2021
@Salonijain27 Salonijain27 removed this from the July 5 - July 16 milestone Jul 6, 2021
@andygrove andygrove linked a pull request Jul 7, 2021 that will close this issue
@andygrove andygrove added this to the July 5 - July 16 milestone Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Must have for release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants