You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "kasakrisz (via GitHub)" <gi...@apache.org> on 2023/04/25 17:56:48 UTC

[GitHub] [hive] kasakrisz commented on a diff in pull request #4212: HIVE-27238: Avoid Calcite Code generation for MetadataHandler on ever…

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: gitbox-unsubscribe@hive.apache.org

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