You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Stamatis Zampetakis (Jira)" <ji...@apache.org> on 2021/06/25 08:33:00 UTC
[jira] [Updated] (HIVE-21729) Arrow serializer sometimes shifts
timestamp by one second
[ https://issues.apache.org/jira/browse/HIVE-21729?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stamatis Zampetakis updated HIVE-21729:
---------------------------------------
Labels: pull-request-available timestamp (was: pull-request-available)
> 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: 4.0.0
> Reporter: Shubham Chaurasia
> Assignee: Shubham Chaurasia
> Priority: Major
> Labels: pull-request-available, timestamp
> Fix For: 4.0.0
>
> Attachments: HIVE-21729.1.patch, HIVE-21729.2.patch
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> 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
(v8.3.4#803005)