orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omalley <...@git.apache.org>
Subject [GitHub] orc pull request #249: [ORC-341] Support time zone as a parameter for Java r...
Date Fri, 04 May 2018 16:44:39 GMT
Github user omalley commented on a diff in the pull request:

    https://github.com/apache/orc/pull/249#discussion_r186140770
  
    --- Diff: java/core/src/java/org/apache/orc/impl/writer/TimestampTreeWriter.java ---
    @@ -54,9 +57,20 @@ public TimestampTreeWriter(int columnId,
         if (rowIndexPosition != null) {
           recordPosition(rowIndexPosition);
         }
    -    this.localTimezone = TimeZone.getDefault();
    -    // for unit tests to set different time zones
    -    this.baseEpochSecsLocalTz = Timestamp.valueOf(BASE_TIMESTAMP_STRING).getTime() /
MILLIS_PER_SECOND;
    +    if (writer.isUseUTCTimestamp()) {
    +      this.localTimezone = TimeZone.getTimeZone("UTC");
    +    } else {
    +      this.localTimezone = TimeZone.getDefault();
    +    }
    +    this.localDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    --- End diff --
    
    It sucks that there isn't a simpler way in Java to do this.


---

Mime
View raw message