Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
vectorization-branch
-
None
-
Adjust milliseconds down when encountering a negative second value with a fractional second stored as nanoseconds.
Description
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.