difin commented on code in PR #5995:
URL: https://github.com/apache/hive/pull/5995#discussion_r2288574539


##########
iceberg/iceberg-catalog/src/main/java/org/apache/iceberg/hive/MetastoreUtil.java:
##########
@@ -87,4 +103,39 @@ public static void alterTable(
       }
     }
   }
+
+  public static Table convertIcebergTableToHiveTable(org.apache.iceberg.Table 
icebergTable, Configuration conf) {
+    Table hiveTable = new Table();
+    TableMetadata metadata = ((BaseTable) icebergTable).operations().current();
+    long maxHiveTablePropertySize = 
conf.getLong(HiveOperationsBase.HIVE_TABLE_PROPERTY_MAX_SIZE,
+        HiveOperationsBase.HIVE_TABLE_PROPERTY_MAX_SIZE_DEFAULT);
+    
HMSTablePropertyHelper.updateHmsTableForIcebergTable(metadata.metadataFileLocation(),
 hiveTable, metadata,
+        null, true, maxHiveTablePropertySize, null);
+    hiveTable.getParameters().put(CatalogUtils.ICEBERG_CATALOG_TYPE, 
CatalogUtil.ICEBERG_CATALOG_TYPE_REST);

Review Comment:
   From what I found no, it is not contained in table properties and it is an 
intentional design decision separation of concerns. Fixed this hardcoding by 
getting the catalog from conf:
   
   `hiveTable.getParameters().put(CatalogUtil.ICEBERG_CATALOG_TYPE, 
conf.get(CatalogUtils.CATALOG_CONFIG_TYPE));`



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