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


##########
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:
   hardcode - ICEBERG_CATALOG_TYPE_REST, can we get it from iceberg table 
properties?
   
   Also I am not sure about 
`ICEBERG_CATALOG_TYPE("iceberg.catalog.default_iceberg.type")`, because we do 
not check for `default_iceberg` in Catalogs.getCatalogProperties or 
getCatalogType



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