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


##########
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:
   Iceberg RESTCatalog uses catalog type as input ("type" property) when 
initializing a catalog, but when it returns a table its properties don't 
include any catalog properties. Looks like RESTCatalog does not use this 
property: `iceberg.catalog.default_iceberg.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