flyrain commented on code in PR #5327:
URL: https://github.com/apache/iceberg/pull/5327#discussion_r929428005
##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -235,19 +235,21 @@ public void renameTable(TableIdentifier from,
TableIdentifier originalTo) {
}
@Override
- public org.apache.iceberg.Table registerTable(TableIdentifier identifier,
String metadataFileLocation) {
+ public org.apache.iceberg.Table registerTable(TableIdentifier identifier,
+ String metadataFileLocation, boolean force) {
Preconditions.checkArgument(isValidIdentifier(identifier), "Invalid
identifier: %s", identifier);
- // Throw an exception if this table already exists in the catalog.
- if (tableExists(identifier)) {
+ // Throw an exception if this table already exists in the catalog and no
force option.
+ if (tableExists(identifier) && !force) {
throw new org.apache.iceberg.exceptions.AlreadyExistsException("Table
already exists: %s", identifier);
}
+ HiveTableOperations ops = (HiveTableOperations) newTableOps(identifier);
+ TableMetadata base = ops.current();
Review Comment:
Do we need to get the `base`? Passing the null should be fine, right?
--
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]