zratkai commented on code in PR #5014:
URL: https://github.com/apache/hive/pull/5014#discussion_r1516196517


##########
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java:
##########
@@ -88,31 +88,42 @@ public Object evaluate(DeferredObject[] arguments) throws 
HiveException {
     Timestamp inputTs = ((TimestampWritableV2) converted_o0).getTimestamp();
 
     String tzStr = textConverter.convert(o1).toString();
-    TimeZone timezone = TimeZone.getTimeZone(tzStr);
-
-    TimeZone fromTz;
-    TimeZone toTz;
-    if (invert()) {
-      fromTz = timezone;
-      toTz = tzUTC;
-    } else {
-      fromTz = tzUTC;
-      toTz = timezone;
-    }
 
-    // inputTs is the year/month/day/hour/minute/second in the local timezone.
-    // For this UDF we want it in the timezone represented by fromTz
-    TimestampTZ fromTs = TimestampTZUtil.parse(inputTs.toString(), 
fromTz.toZoneId());
+    ZoneId zoneId;
+    try{
+      zoneId = ZoneId.of(tzStr);
+    }catch (Exception exception) {

Review Comment:
   Done.



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

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

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


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

Reply via email to