You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by "Zhang Jiawei (Jira)" <ji...@apache.org> on 2026/04/21 10:49:00 UTC

[jira] [Updated] (ORC-2151) Move the ORC-306 timestamp compensation before timezone conversion to prevent incorrect DST offset lookup.

     [ https://issues.apache.org/jira/browse/ORC-2151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zhang Jiawei updated ORC-2151:
------------------------------
    Language: C++

> 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
>            Priority: Major
>
> 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)