kasakrisz commented on code in PR #4212:
URL: https://github.com/apache/hive/pull/4212#discussion_r1176852722


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveDefaultRelMetadataProvider.java:
##########
@@ -128,4 +139,28 @@ public static void 
initializeMetadataProviderClass(List<Class<? extends RelNode>
     // This will register the classes in the default Hive implementation
     DEFAULT.register(nodeClasses);
   }
+
+  public static synchronized HiveDefaultRelMetadataProvider get(HiveConf 
hiveConf,
+      List<Class<? extends RelNode>> nodeClasses) {
+    Map<HiveConf.ConfVars, Object> confKey = getConfKey(hiveConf);
+    if (ALL_PROVIDERS.containsKey(confKey)) {
+      return ALL_PROVIDERS.get(confKey);
+    }
+
+    HiveDefaultRelMetadataProvider newProvider =
+        new HiveDefaultRelMetadataProvider(hiveConf, nodeClasses);
+    ALL_PROVIDERS.put(confKey, newProvider);
+    return newProvider;
+  }
+
+  private static Map<HiveConf.ConfVars, Object> getConfKey(HiveConf conf) {
+    ImmutableMap.Builder<HiveConf.ConfVars, Object> bldr = new 
ImmutableMap.Builder<>();
+    bldr.put(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE,
+        conf.getVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE));
+    bldr.put(HiveConf.ConfVars.HIVE_CBO_EXTENDED_COST_MODEL,
+        conf.getBoolVar(HiveConf.ConfVars.HIVE_CBO_EXTENDED_COST_MODEL));
+    bldr.put(HiveConf.ConfVars.MAPREDMAXSPLITSIZE,
+        conf.getLongVar(HiveConf.ConfVars.MAPREDMAXSPLITSIZE));

Review Comment:
   Are these settings can be changed without hs2 restart?



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