You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/08/11 21:05:40 UTC

[GitHub] [hive] jcamachor commented on a change in pull request #1392: [WiP] Parquet conversion tz

jcamachor commented on a change in pull request #1392:
URL: https://github.com/apache/hive/pull/1392#discussion_r468864544



##########
File path: common/src/java/org/apache/hadoop/hive/common/type/TimestampTZUtil.java
##########
@@ -145,13 +149,33 @@ public static ZoneId parseTimeZone(String timeZoneStr) {
     }
   }
 
+  public static Timestamp convertTimestampToZone(Timestamp ts, ZoneId fromZone, ZoneId toZone) {
+    return convertTimestampToZone(ts, fromZone, toZone, false);
+  }
+
   /**
    * Timestamps are technically time zone agnostic, and this method sort of cheats its logic.
    * Timestamps are supposed to represent nanos since [UTC epoch]. Here,
    * the input timestamp represents nanoseconds since [epoch at fromZone], and
    * we return a Timestamp representing nanoseconds since [epoch at toZone].
    */
-  public static Timestamp convertTimestampToZone(Timestamp ts, ZoneId fromZone, ZoneId toZone) {
+  public static Timestamp convertTimestampToZone(Timestamp ts, ZoneId fromZone, ZoneId toZone,
+      boolean legacyConversion) {
+    if (legacyConversion) {
+      try {
+        DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

Review comment:
       Yes, that's right. I'll change it in follow-up commit.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org