wgtmac commented on code in PR #2609:
URL: https://github.com/apache/orc/pull/2609#discussion_r3151680885
##########
c++/test/TestWriter.cc:
##########
@@ -839,6 +839,73 @@ namespace orc {
testWriteTimestampWithTimezone(fileVersion, "America/Los_Angeles",
"America/Los_Angeles",
"2014-06-06 12:34:56", IS_DST);
}
+
+ // Test that the ORC-306 compensation (-1s for pre-1970 timestamps with
+ // nanos > 999999) is applied BEFORE timezone conversion in the Reader.
+ //
+ // We write secs = -5756401 (1s before the 1969 PDT->PST boundary in LA)
+ // with nanos = 1000000. The C++ Writer applies +1, storing -5756400 in the
+ // ORC file (exactly at the DST boundary). On read, the Reader must apply
+ // -1 BEFORE timezone conversion so that getVariant() sees -5756401 (PDT).
+ // If compensation were applied AFTER timezone conversion, getVariant() would
+ // see -5756400 (PST), producing a gmtOffset that differs by 3600 seconds.
+ TEST_P(WriterTest, DISABLED_writeNegativeTimestampAtDSTBoundary) {
Review Comment:
Yes, it would be great if these can be fixed together.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]