nastra commented on code in PR #8918:
URL: https://github.com/apache/iceberg/pull/8918#discussion_r1377186180


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -261,6 +261,15 @@ public void renameTable(TableIdentifier from, 
TableIdentifier originalTo) {
     } catch (InterruptedException e) {
       Thread.currentThread().interrupt();
       throw new RuntimeException("Interrupted in call to rename", e);
+    } catch (RuntimeException e) {
+      // in case of table already exists,
+      // Hive rename operation throws exception as
+      // java.lang.RuntimeException:InvalidOperationException(message:new 
table <> already exists)
+      if (e.getMessage().contains(String.format("new table %s already 
exists)", to))) {

Review Comment:
   I think here we should examine the exact cause rather than just looking at 
the exception message. 



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