szehon-ho commented on a change in pull request #3851:
URL: https://github.com/apache/iceberg/pull/3851#discussion_r779731029



##########
File path: hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java
##########
@@ -211,6 +214,18 @@ public void renameTable(TableIdentifier from, 
TableIdentifier originalTo) {
     }
   }
 
+  @Override
+  public org.apache.iceberg.Table registerTable(TableIdentifier identifier, 
String metadataFileLocation) {
+    Preconditions.checkArgument(isValidIdentifier(identifier), "Invalid 
identifier: %s", identifier);
+
+    TableOperations ops = newTableOps(identifier);
+    HadoopInputFile metadataFile = 
HadoopInputFile.fromLocation(metadataFileLocation, conf);

Review comment:
       Shouldn't we use FileIO to get the InputFile instead of hardcoding 
HadoopFileIO (in case we are using S3FileIO, for example?)

##########
File path: api/src/main/java/org/apache/iceberg/catalog/Catalog.java
##########
@@ -340,6 +340,17 @@ default boolean dropTable(TableIdentifier identifier) {
    */
   Table loadTable(TableIdentifier identifier);
 
+  /**
+   * Register a table.

Review comment:
       Seems from the test, the table is not there and it will create one from 
the file.  It wasn't too obvious from the name of the API, can we enhance the 
javadoc a bit to detail that?




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