okumin commented on code in PR #5014: URL: https://github.com/apache/hive/pull/5014#discussion_r1467621197
########## ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java: ########## @@ -34,6 +35,7 @@ import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import sun.util.calendar.ZoneInfo; Review Comment: I'm curious what are the advantages of this package. In my first impression, I would use `java.time.ZoneId` because it sounds more standard and consistent with the TimeZone API. ########## ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java: ########## @@ -88,18 +90,15 @@ 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; + if(ZoneInfo.getTimeZone(tzStr)==null){ Review Comment: It would be nice if we added spaces between parentheses/operators. ``` if (ZoneInfo.getTimeZone(tzStr) == null) { ``` -- 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