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


##########
iceberg/iceberg-catalog/src/main/java/org/apache/iceberg/hive/MetastoreUtil.java:
##########
@@ -148,6 +153,74 @@ public static Table toHiveTable(org.apache.iceberg.Table 
table, Configuration co
     return result;
   }
 
+  /**
+   * Builds a Hive metastore {@link Table} representation for an Iceberg 
{@link View}, for clients
+   * (e.g. {@code HiveRESTCatalogClient}) that bridge Iceberg catalog metadata 
into the HMS API.
+   */
+  public static Table toHiveView(View view, Configuration conf) {
+    Table result = new Table();
+    TableName tableName =
+        TableName.fromString(
+            view.name(), MetaStoreUtils.getDefaultCatalog(conf), 
Warehouse.DEFAULT_DATABASE_NAME);
+    result.setCatName(tableName.getCat());
+    result.setDbName(tableName.getDb());

Review Comment:
   this method is only called when reading from a view using a REST Catalog - 
it is called from `HiveRESTCatalogClient.getTable(GetTableRequest tableRequest)`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to