[ 
https://issues.apache.org/jira/browse/ORC-341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464126#comment-16464126
 ] 

ASF GitHub Bot commented on ORC-341:
------------------------------------

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.


> Support time zone as a parameter for Java reader and writer
> -----------------------------------------------------------
>
>                 Key: ORC-341
>                 URL: https://issues.apache.org/jira/browse/ORC-341
>             Project: ORC
>          Issue Type: Improvement
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>            Priority: Major
>
> Currently, time zone is hardcoded as the system default time zone and ORC 
> applies displacement between timestamp values read/written based on time zone.
> This issue aims at adding the option to pass the time zone as a parameter to 
> the reader/writer.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to