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


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/MetastoreUtil.java:
##########
@@ -72,6 +73,23 @@ public static void alterTable(
     env.putAll(extraEnv);
     env.put(StatsSetupConst.DO_NOT_UPDATE_STATS, StatsSetupConst.TRUE);
 
-    ALTER_TABLE.invoke(client, databaseName, tblName, table, new 
EnvironmentContext(env));
+    try {
+      ALTER_TABLE.invoke(client, databaseName, tblName, table, new 
EnvironmentContext(env));
+    } catch (RuntimeException e) {

Review Comment:
   It's only being used at two places:
   
   1.  To 
[update](https://github.com/apache/iceberg/blob/12f6d0d0a35522915f5a8da73973403fe12cb01c/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveOperationsBase.java#L112)
 the table .
   2. To 
[rename](https://github.com/apache/iceberg/blob/12f6d0d0a35522915f5a8da73973403fe12cb01c/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java#L245)
 the table .
   
   Are you proposing to throw non RTE `MetaException` at alter table . 
something like 
   ```
   catch (RuntimeException e) {
         if (e.getCause() instanceof InvalidOperationException
             && e.getCause().getMessage() != null
             && e.getCause()
                 .getMessage()
                 .contains(
                     String.format(
                         "new table %s.%s already exists", table.getDbName(), 
table.getTableName()))) {
           throw new MetaException(
               String.format("Table already exists: %s.%s", table.getDbName(), 
table.getTableName()));
         }
         throw e;
       }



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