[ 
https://issues.apache.org/jira/browse/HIVE-14566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15427129#comment-15427129
 ] 

Prasanth Jayachandran commented on HIVE-14566:
----------------------------------------------

The issue is actually not 1 second difference. It happened to be the case in 
the test case (data/files/alltypesorc3xcols file was written with different 
timezone). The actual issue is, llap reader was not making timezone adjustments 
when reading timestamp columns causing difference in results. The non-llap 
reader used to make the timezone adjustments during start of stripe. This was 
missing for llap 
https://github.com/apache/hive/blob/master/orc/src/java/org/apache/orc/impl/TreeReaderFactory.java#L870

Each stripe in orc maintains the timezone that was used by the writer. The 
reader reads the timestamp values using reader's timezone and by knowing the 
writer's timezone information from the stripe footer, the reader will make 
offset adjustments to read timestamp correctly. 

> LLAP IO reads timestamp wrongly
> -------------------------------
>
>                 Key: HIVE-14566
>                 URL: https://issues.apache.org/jira/browse/HIVE-14566
>             Project: Hive
>          Issue Type: Bug
>          Components: llap
>    Affects Versions: 2.1.0, 2.0.1, 2.2.0
>            Reporter: Prasanth Jayachandran
>            Assignee: Prasanth Jayachandran
>            Priority: Critical
>         Attachments: HIVE-14566.1.patch
>
>
> HIVE-10127 is causing incorrect results when orc_merge12.q is run in llap.
> It reads timestamp wrongly.
> {code:title=LLAP IO Enabled}
> hive> select atimestamp1 from alltypesorc3xcols limit 10;
> OK
> 1969-12-31 15:59:46.674
> NULL
> 1969-12-31 15:59:55.787
> 1969-12-31 15:59:44.187
> 1969-12-31 15:59:50.434
> 1969-12-31 16:00:15.007
> 1969-12-31 16:00:07.021
> 1969-12-31 16:00:04.963
> 1969-12-31 15:59:52.176
> 1969-12-31 15:59:44.569
> {code}
> {code:title=LLAP IO Disabled}
> hive> select atimestamp1 from alltypesorc3xcols limit 10;
> OK
> 1969-12-31 15:59:46.674
> NULL
> 1969-12-31 15:59:55.787
> 1969-12-31 15:59:44.187
> 1969-12-31 15:59:50.434
> 1969-12-31 16:00:14.007
> 1969-12-31 16:00:06.021
> 1969-12-31 16:00:03.963
> 1969-12-31 15:59:52.176
> 1969-12-31 15:59:44.569
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to