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


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -261,6 +261,16 @@ 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.getCause() instanceof InvalidOperationException
+          && e.getCause().getMessage().contains(String.format("new table %s 
already exists", to))) {

Review Comment:
   you might need to add a null check for the message as it's not guaranteed 
that an exception has a 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