twosigma / twosigma/flint

Failure of test: "correctly convert SQL TimestampType with default format" in "CSVSpec.scala".

Open
#39 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
1.2k
Forks
199
PR merge metrics
No merged PRs in 30d

Description

Running ``sbt assembly`` yields the following:
```
[info] - should correctly convert SQL TimestampType with default format *** FAILED *** (244 milliseconds)
[info] 1199232000000000000 did not equal 1199253600000000000 (CSVSpec.scala:100)
```
Now, 1199232000000000000, the result of ``first.getAs[Long]("time")``, where ``first`` contains the string "2018-01-02 00:00:00" equals 2018-01-01 18:00:00, which is in turn equal to "2018-01-02 00:00:00 UTC-6."

1199253600000000000, on the other hand, equals "2018-01-02 00:00:00" and since its timezone was extracted from ``format.setTimeZone(TimeZone.getDefault)`` (my computer resides in Mexico City, UTC-6), I believe it is being interpreted as "2018-01-02 00:00:00 UTC-6".

tl;dr: I believe the test is reading "2018-01-02 00:00:00" from CSV and assuming UTC *and then* converting it to UTC-6, yet simply appending my default timezone to the hard-coded string "2018-01-02 00:00:00".

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.