Zhang Jiawei created ORC-2151:
---------------------------------

             Summary: Move the ORC-306 timestamp compensation before timezone 
conversion to prevent incorrect DST offset lookup.
                 Key: ORC-2151
                 URL: https://issues.apache.org/jira/browse/ORC-2151
             Project: ORC
          Issue Type: Bug
            Reporter: Zhang Jiawei


Previously, the -1 second compensation for pre-1970 timestamps (caused by 
Java's truncating integer division in Timestamp.getTime()) was applied after 
the writer-to-reader timezone adjustment. This means 
writerTimezone.getVariant(writerTime) was called with an uncorrected writerTime 
that could be 1 second larger than the true value. If this 1-second discrepancy 
happens to cross a DST (Daylight Saving Time) boundary, the timezone lookup 
would return an incorrect GMT offset, causing the final timestamp result to be 
off by the entire DST shift (typically 1 hour) rather than just 1 second.

 

By moving the compensation to before the timezone conversion, we ensure that 
getVariant() always receives the corrected wall-clock time, producing the 
correct DST offset and an accurate final result.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to