pvary commented on code in PR #9432:
URL: https://github.com/apache/iceberg/pull/9432#discussion_r1454984558


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -251,12 +251,14 @@ public void renameTable(TableIdentifier from, 
TableIdentifier originalTo) {
     } catch (NoSuchObjectException e) {
       throw new NoSuchTableException("Table does not exist: %s", from);
 
-    } catch (AlreadyExistsException e) {
-      throw new org.apache.iceberg.exceptions.AlreadyExistsException(
-          "Table already exists: %s", to);
-
     } catch (TException e) {
-      throw new RuntimeException("Failed to rename " + from + " to " + to, e);
+      if (e.getMessage() != null
+          && e.getMessage().contains(String.format("new table %s already 
exists", to))) {
+        throw new org.apache.iceberg.exceptions.AlreadyExistsException(
+            "Table already exists: %s", to);
+      } else {
+        throw new RuntimeException("Failed to rename " + from + " to " + to, 
e);
+      }

Review Comment:
   could we please move this under a `catch (InvalidOperationException)`?
   But keep the old `TException` handler part



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