-
Type:
Sub-task
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: vectorization-branch
-
Fix Version/s: vectorization-branch, 0.13.0
-
Component/s: File Formats
-
Labels:None
-
Release Note:Adjust milliseconds down when encountering a negative second value with a fractional second stored as nanoseconds.
When using negative timestamps, the ORC vectorized Timestampreader does the following
result.vector[i] = (result.vector[i] * 1000000) + nanoVector.vector[i];
This suffers from inaccuracies because the nanoseconds are always positive and the result.vector[i] is in effect
seconds = (getTime() / 1000) nanos = (getNanos()) // so -42001 ms is written as // seconds = -42 // nanos = 999000000 // (-42001 / 1000) * 1000 == -42000 // + 999 ms (from nanos) // which is -42999 ms
This needs to be adjusted down if nanos has been zero adjusted, to result in -42001 as the vector[i] value.