Description
There is a bug in java.sql.Timestamp where if the timestamp is of the form "YYYY-MM-DD HH:MM:SS.000XXX" and year is before 1970, the resulting time is off by one second. Unfortunately, the ORC reader was unintentionally triggering this case for all timestamps before 1970 and thus included compensating code to correct the problem.
Unfortunately, the workaround means that the user get incorrect results if they don't use Timestamp to interpret the results.1900-05-05 12:34:56.1 is stored in TimestampColumnVector as -2198201103900 millis and 100000000 nanos. The ORC reader incorrectly restores that as -2198201103000 and 100000000 (notice the missing 900 millis), then adjusts the millis to -2198201102000. Since the last three digits of the millis are 0 that triggers the Timestamp bug and becomes the matching 1900-05-05 12:34:56.1.
So basically, ORC added a bug to compensate for Java's bug.
Attachments
Issue Links
- causes
-
ORC-546 The timestamps are getting duplicated millis after ORC-306.
- Closed
- is related to
-
ORC-645 Timestamp between -1 and 0 seconds from UNIX epoch changes after write-read
- Open
- relates to
-
ORC-763 ORC timestamp inconsistencies before UNIX epoch
- Closed
-
ORC-771 ORC timestamp consistency Test for sql.Timestamps close to epoch
- Closed
- links to