pvary commented on code in PR #8907:
URL: https://github.com/apache/iceberg/pull/8907#discussion_r1409256826


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveOperationsBase.java:
##########
@@ -181,4 +186,30 @@ default Table newHmsTable(String hmsTableOwner) {
 
     return newTable;
   }
+
+  default void setHmsParameters(
+      Table tbl,
+      String newMetadataLocation,
+      Schema schema,
+      String uuid,
+      Supplier<String> previousLocationSupplier) {
+    Map<String, String> parameters =
+        Optional.ofNullable(tbl.getParameters()).orElseGet(Maps::newHashMap);
+
+    if (uuid != null) {
+      parameters.put(TableProperties.UUID, uuid);
+    }

Review Comment:
   nit: newline



##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveOperationsBase.java:
##########
@@ -181,4 +186,30 @@ default Table newHmsTable(String hmsTableOwner) {
 
     return newTable;
   }
+
+  default void setHmsParameters(
+      Table tbl,
+      String newMetadataLocation,
+      Schema schema,
+      String uuid,
+      Supplier<String> previousLocationSupplier) {
+    Map<String, String> parameters =
+        Optional.ofNullable(tbl.getParameters()).orElseGet(Maps::newHashMap);
+
+    if (uuid != null) {
+      parameters.put(TableProperties.UUID, uuid);
+    }
+    parameters.put(BaseMetastoreTableOperations.METADATA_LOCATION_PROP, 
newMetadataLocation);
+    parameters.put(
+        BaseMetastoreTableOperations.TABLE_TYPE_PROP,
+        
BaseMetastoreTableOperations.ICEBERG_TABLE_TYPE_VALUE.toUpperCase(Locale.ENGLISH));
+
+    if (previousLocationSupplier.get() != null && 
!previousLocationSupplier.get().isEmpty()) {
+      parameters.put(
+          BaseMetastoreTableOperations.PREVIOUS_METADATA_LOCATION_PROP,
+          previousLocationSupplier.get());
+    }

Review Comment:
   nit: newline



-- 
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: issues-unsubscr...@iceberg.apache.org

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


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

Reply via email to