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/09/17 23:00:17 UTC

[GitHub] [hive] rajkrrsingh commented on a change in pull request #1460: Hive 24113

rajkrrsingh commented on a change in pull request #1460:
URL: https://github.com/apache/hive/pull/1460#discussion_r490607794



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUnixTime.java
##########
@@ -107,6 +107,10 @@ public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumen
     }
 
     if (timeZone == null) {
+      if (SessionState.get() == null) {
+        SessionState ss = new SessionState(new HiveConf());
+        SessionState.setCurrentSessionState(ss);

Review comment:
       * sorry I did not follow this correctly, I think SessionState will not be available in HMS, can you please guide me how can I retrieve it from new HiveConf()
   * yes that's a rare case while filtering the partition by expression, a query with filter condition having timestamp/date as predicate e.g. following query
   select * from table_name where hour between from_unixtime(unix_timestamp('2020090120', 'yyyyMMddHH') - 1*60*60, 'yyyyMMddHH') and from_unixtime(unix_timestamp('2020090122', 'yyyyMMddHH') + 2*60*60, 'yyyyMMddHH');
   
   in case of  PartitionExpressionForMetastore proxy, the filter expression is based on ql class/package and thats where user will see such exception.
   
   * I think its difficult to reproduce with embedded HMS.




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