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 Sun, 18 Mar 2018 14:05:46 GMT
Github user wgtmac commented on a diff in the pull request:

    https://github.com/apache/orc/pull/233#discussion_r175290353
  
    --- Diff: c++/src/ColumnWriter.cc ---
    @@ -1194,12 +1194,11 @@ namespace orc {
         bool hasNull = false;
         for (uint64_t i = 0; i < numValues; ++i) {
           if (notNull == nullptr || notNull[i]) {
    -        // TimestampVectorBatch already stores data in UTC
    -        int64_t millsUTC = secs[i] * 1000 + nanos[i] / 1000000;
    +        int64_t millsUTC =
    +          (secs[i] + timezone.getVariant(secs[i]).gmtOffset) * 1000 + nanos[i] / 1000000;
             tsStats->increase(1);
             tsStats->update(millsUTC);
     
    -        secs[i] -= timezone.getVariant(secs[i]).gmtOffset;
             secs[i] -= timezone.getEpoch();
    --- End diff --
    
    This was a trade-off. If we have made the input data constant, then we need to allocate
another buffer to store those modified values which may introduce larger memory consumption.


---

Mime
View raw message