deniskuzZ commented on PR #8113:
URL: https://github.com/apache/iceberg/pull/8113#issuecomment-1680772133

   [HIVE-16614](https://issues.apache.org/jira/browse/HIVE-16614): Support "set 
local time zone" statement 
   ````
   ZoneId timeZone = SessionState.get() == null ? 
       new HiveConf().getLocalTimeZone() :
       SessionState.get().getConf().getLocalTimeZone();
   
   public ZoneId getLocalTimeZone() {
     String timeZoneStr = getVar(ConfVars.HIVE_LOCAL_TIME_ZONE);
     return TimestampTZUtil.parseTimeZone(timeZoneStr);
   }
   public static ZoneId parseTimeZone(String timeZoneStr) {
       if (timeZoneStr == null || timeZoneStr.trim().isEmpty() ||
           timeZoneStr.trim().toLowerCase().equals("local")) {
         // default
         return ZoneId.systemDefault();
       }
       try {
         return ZoneId.of(timeZoneStr);
       } catch (DateTimeException e1) {
         // default
         throw new RuntimeException("Invalid time zone displacement value", e1);
       }
     }
   ````


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to