szehon-ho commented on a change in pull request #4261:
URL: https://github.com/apache/iceberg/pull/4261#discussion_r819065028
##########
File path:
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java
##########
@@ -271,29 +273,32 @@ protected void doCommit(TableMetadata base, TableMetadata
metadata) {
try {
persistTable(tbl, updateHiveTable);
commitStatus = CommitStatus.SUCCESS;
- } catch (Throwable persistFailure) {
+ } catch (org.apache.hadoop.hive.metastore.api.AlreadyExistsException e) {
+ throw new AlreadyExistsException(e, "Table already exists: %s.%s",
database, tableName);
+
+ } catch (InvalidObjectException e) {
+ throw new ValidationException(e, "Invalid table name for %s.%s",
database, tableName);
Review comment:
Yea so I grepped through the instances it throws in Hive code base, it
is always like Precondition check in Iceberg for user-error, and never proceeds
further.
This is a github search (which unfortunately returns only a few top results):
https://github.com/search?q=%22throw+new+InvalidObjectException*%22+repo%3Aapache%2Fhive&type=code
My grep finds it thrown only in these classes which you can also
double-check inside:
https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java
https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java
https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java
https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
It should not be thrown when Hive commits successfully, or disconnect issue,
if that is the fear? Maybe @pvary can verify?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]