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] Timestamp from GPU ORC reading is different from CPU ORC reading #6312

Closed
ttnghia opened this issue Aug 12, 2022 · 3 comments · Fixed by #6545
Closed

[BUG] Timestamp from GPU ORC reading is different from CPU ORC reading #6312

ttnghia opened this issue Aug 12, 2022 · 3 comments · Fixed by #6545
Labels
bug Something isn't working cudf_dependency An issue or PR with this label depends on a new feature in cudf

Comments

@ttnghia
Copy link
Collaborator

ttnghia commented Aug 12, 2022

Related: test_read_with_more_columns failed in #6286. As such, when this issue is fixed then that test should also be updated.

See this example to reproduce:

scala> spark.conf.set("spark.rapids.sql.enabled", "false")

scala> import java.sql.Timestamp
import java.sql.Timestamp

scala> val df = Seq(Timestamp.valueOf("1839-12-24 03:58:55.000826")).toDF("v")
df: org.apache.spark.sql.DataFrame = [v: timestamp]

scala> df.coalesce(1).write.mode("overwrite").orc("/tmp/ts.orc")

scala> val df2 = spark.read.orc("/tmp/ts.orc")
df2: org.apache.spark.sql.DataFrame = [v: timestamp]

scala> df2.show(false)
+--------------------------+
|v                         |
+--------------------------+
|1839-12-24 03:58:55.000826|
+--------------------------+


scala> spark.conf.set("spark.rapids.sql.enabled", "true")

scala> val df2 = spark.read.orc("/tmp/ts.orc")
df2: org.apache.spark.sql.DataFrame = [v: timestamp]

scala> df2.show(false)
22/08/12 21:34:09 WARN GpuOverrides: 
*Exec <CollectLimitExec> will run on GPU
  *Partitioning <SinglePartition$> will run on GPU
  *Exec <ProjectExec> will run on GPU
    *Expression <Alias> cast(v#37 as string) AS v#40 will run on GPU
      *Expression <Cast> cast(v#37 as string) will run on GPU
    *Exec <FileSourceScanExec> will run on GPU

+--------------------------+
|v                         |
+--------------------------+
|1839-12-24 03:58:54.000826|
+--------------------------+

@ttnghia ttnghia added bug Something isn't working ? - Needs Triage Need team to review and classify labels Aug 12, 2022
@ttnghia
Copy link
Collaborator Author

ttnghia commented Aug 12, 2022

In particular, the second number is wrongly read. The input second for writing is 55 but read is 54.

@ttnghia ttnghia changed the title [BUG] Result from ORC reading is different from CPU ORC reading [BUG] Timstamp from GPU ORC reading is different from CPU ORC reading Aug 12, 2022
@ttnghia
Copy link
Collaborator Author

ttnghia commented Aug 12, 2022

Turned out this is a bug in libcudf. I've filed the related issue: rapidsai/cudf#11525

@ttnghia
Copy link
Collaborator Author

ttnghia commented Aug 16, 2022

Other data that can reproduce:

1930-12-24 03:58:55.000826
1950-12-24 03:58:55.000826

@sameerz sameerz added cudf_dependency An issue or PR with this label depends on a new feature in cudf and removed ? - Needs Triage Need team to review and classify labels Aug 16, 2022
@jlowe jlowe changed the title [BUG] Timstamp from GPU ORC reading is different from CPU ORC reading [BUG] Timestamp from GPU ORC reading is different from CPU ORC reading Sep 20, 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 cudf_dependency An issue or PR with this label depends on a new feature in cudf
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants