nk1506 commented on code in PR #8907:
URL: https://github.com/apache/iceberg/pull/8907#discussion_r1414954046


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -234,15 +225,29 @@ public void renameTable(TableIdentifier from, 
TableIdentifier originalTo) {
     String fromName = from.name();
 
     try {
-      Table table = clients.run(client -> client.getTable(fromDatabase, 
fromName));
-      HiveOperationsBase.validateTableIsIceberg(table, fullTableName(name, 
from));
+      Table fromTable = clients.run(client -> client.getTable(fromDatabase, 
fromName));
+      HiveOperationsBase.validateTableIsIceberg(fromTable, fullTableName(name, 
from));
+      Table table = null;
+
+      try {
+        table = clients.run(client -> client.getTable(toDatabase, to.name()));

Review Comment:
   
[renameTableTargetAlreadyExistsAsView](https://github.com/apache/iceberg/blob/99843f03efecc3f5ef7d3e1d32aae5eff22cb315/core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java#L720)
 expects some specific error message. Hive doesn't throw 
`AlreadyExistsException` instead it throws `InvalidOperationException` with 
message as `InvalidOperationException(message:new table ns.view already 
exists)` . There is already a thread happened around the same 
[here](https://github.com/apache/iceberg/pull/8918#discussion_r1371550325). 
Please share your thoughts for handling such scenarios:
   1. Should we change the implementation for the corresponding catalog and 
throw specific error message?
   2. Or we can Override the corresponding tests for the catalog?
   3. Or Add all the possible error messages to the same tests ? 



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to