orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wgtmac <...@git.apache.org>
Subject [GitHub] orc pull request #233: ORC-322: [C++] Fix writing & reading timestamp
Date Sat, 17 Mar 2018 12:46:36 GMT
Github user wgtmac commented on a diff in the pull request:

    https://github.com/apache/orc/pull/233#discussion_r175257109
  
    --- Diff: c++/src/ColumnPrinter.cc ---
    @@ -710,7 +713,10 @@ namespace orc {
           writeString(buffer, "null");
         } else {
           int64_t nanos = nanoseconds[rowId];
    -      time_t secs = static_cast<time_t>(seconds[rowId]);
    +      // adjust the second to gmt timezone so that we can print same value
    +      // in writer's timezone
    +      time_t secs = static_cast<time_t>(seconds[rowId] +
    +        writerTimezone->getVariant(seconds[rowId]).gmtOffset);
           struct tm tmValue;
           gmtime_r(&secs, &tmValue);
           char timeBuffer[20];
    --- End diff --
    
    Good idea! But I don't think we have simple timezone acronyms on hand so I prefer to ignore
it for now.


---

Mime
View raw message