[ 
https://issues.apache.org/jira/browse/HIVE-23699?focusedWorklogId=446208&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-446208
 ]

ASF GitHub Bot logged work on HIVE-23699:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Jun/20 00:58
            Start Date: 16/Jun/20 00:58
    Worklog Time Spent: 10m 
      Work Description: jfsii commented on a change in pull request #1119:
URL: https://github.com/apache/hive/pull/1119#discussion_r440522788



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -101,6 +102,65 @@
   private volatile boolean isSparkConfigUpdated = false;
   private static final int LOG_PREFIX_LENGTH = 64;
 
+  interface HiveConfEnum<T extends Enum<T>> {
+    public static <T extends Enum<T>> T from(Class<T> cls, String value, T 
invalidEnum) {
+      try {
+        return T.valueOf(cls, value.toUpperCase());
+      } catch (Exception e) {
+        return invalidEnum;
+      }
+    }
+  }

Review comment:
       Should I even bother with this interface? The intent was originally to 
have static definitions of getValidSet and getInvalid as part of the interface 
in addition to from. Except Java interfaces don't allow implementations of an 
interface to override static methods. The from method here is also not super 
useful in that I think I still have to fully qualify the call (I.E. 
HiveConfEnum.from()). It would be nice if we could define required static 
methods on a enum interface for future uses of enums in HiveConf, but I don't 
think it is cleanly possible.




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 446208)
    Time Spent: 20m  (was: 10m)

> Cleanup HIVEQUERYRESULTFILEFORMAT handling
> ------------------------------------------
>
>                 Key: HIVE-23699
>                 URL: https://issues.apache.org/jira/browse/HIVE-23699
>             Project: Hive
>          Issue Type: Improvement
>          Components: HiveServer2
>    Affects Versions: 4.0.0
>            Reporter: John Sherman
>            Assignee: John Sherman
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> HIVEQUERYRESULTFILEFORMAT format handling has grown over the years and has 
> become somewhat messy code wise in SemanticAnalyzer and TaskCompiler. There 
> are special cases where the HIVEQUERYRESULTFILEFORMAT setting gets changed at 
> runtime that may cause issues if a user changes execution.engines between 
> queries and probably other corner cases.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to