deniskuzZ commented on code in PR #5498:
URL: https://github.com/apache/hive/pull/5498#discussion_r1810470454


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergTableUtil.java:
##########
@@ -129,19 +129,19 @@ public static Table getTable(Configuration configuration, 
org.apache.hadoop.hive
    */
   static Table getTable(Configuration configuration, Properties properties, 
boolean skipCache) {
     String metaTable = 
properties.getProperty(IcebergAcidUtil.META_TABLE_PROPERTY);
-    String tableName = properties.getProperty(Catalogs.NAME);
-    String location = properties.getProperty(Catalogs.LOCATION);
+    Properties props = (metaTable != null) ? new Properties() : properties;
+
     if (metaTable != null) {
+      props.computeIfAbsent(InputFormatConfig.CATALOG_NAME, properties::get);
       // HiveCatalog, HadoopCatalog uses NAME to identify the metadata table
-      properties.setProperty(Catalogs.NAME, tableName + "." + metaTable);
+      props.computeIfAbsent(Catalogs.NAME, k -> properties.get(k) + "." + 
metaTable);
       // HadoopTable uses LOCATION to identify the metadata table
-      properties.setProperty(Catalogs.LOCATION, location + "#" + metaTable);
+      props.computeIfAbsent(Catalogs.LOCATION, k -> properties.get(k) + "#" + 
metaTable);
     }

Review Comment:
   hashtable's `get` has a O(1) complexity, so that could be ignored, but I 
don't mind to refactor it as you proposed
    



-- 
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-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to