Gopal V created HIVE-4884:
-----------------------------

             Summary: ORC TimestampTreeReader.nextVector() off by a second when 
time in fractional
                 Key: HIVE-4884
                 URL: https://issues.apache.org/jira/browse/HIVE-4884
             Project: Hive
          Issue Type: Sub-task
          Components: File Formats
    Affects Versions: vectorization-branch
            Reporter: Gopal V
            Assignee: Gopal V
             Fix For: vectorization-branch


When using negative timestamps, the ORC vectorized Timestampreader does the 
following

{code}
result.vector[i] = (result.vector[i] * 1000000) + nanoVector.vector[i];
{code}

This suffers from inaccuracies because the nanoseconds are always positive and 
the result.vector[i] is in effect 

{code}
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
{code}

This needs to be adjusted down if nanos has been zero adjusted, to result in 
-42001 as the vector[i] value.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to