yabola commented on code in PR #5327:
URL: https://github.com/apache/iceberg/pull/5327#discussion_r929434238
##########
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:
I feel that the changes here will have the least impact on the overall
method, and no additional logic will be added. The connection between methods
is also self-consistent
--
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]