Shubham Chaurasia created HIVE-21729:
----------------------------------------

             Summary: Arrow serializer sometimes shifts timestamp by one second
                 Key: HIVE-21729
                 URL: https://issues.apache.org/jira/browse/HIVE-21729
             Project: Hive
          Issue Type: Bug
          Components: Serializers/Deserializers
    Affects Versions: 3.1.1
            Reporter: Shubham Chaurasia
            Assignee: Shubham Chaurasia


This happens due to 
[secondInMicros|https://github.com/apache/hive/blob/rel/release-3.1.1/ql/src/java/org/apache/hadoop/hive/ql/io/arrow/Serializer.java#L445]
 are calculated like
{code}
final long secondInMicros = (secondInMillis - secondInMillis % 
MILLIS_PER_SECOND) * MICROS_PER_MILLIS;
{code}

Instead this should be calculated like(by taking nanos from 
timestampColumnVector itself)
{code}
final long nanos = timestampColumnVector.getNanos(j);
final long secondInMicros = (secondInMillis - nanos / NS_PER_MILLIS) * 
MICROS_PER_MILLIS;
{code}




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to