pvary commented on a change in pull request #2860:
URL: https://github.com/apache/iceberg/pull/2860#discussion_r708842942



##########
File path: 
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java
##########
@@ -275,10 +275,15 @@ protected void doCommit(TableMetadata base, TableMetadata 
metadata) {
       throw new AlreadyExistsException("Table already exists: %s.%s", 
database, tableName);
 
     } catch (TException | UnknownHostException e) {
-      if (e.getMessage() != null && e.getMessage().contains("Table/View 
'HIVE_LOCKS' does not exist")) {
-        throw new RuntimeException("Failed to acquire locks from metastore 
because 'HIVE_LOCKS' doesn't " +
-            "exist, this probably happened when using embedded metastore or 
doesn't create a " +
-            "transactional meta table. To fix this, use an alternative 
metastore", e);
+      if (e.getMessage() != null) {
+        if (e.getMessage().contains("Table/View 'HIVE_LOCKS' does not exist")) 
{
+          throw new RuntimeException("Failed to acquire locks from metastore 
because 'HIVE_LOCKS' doesn't " +
+              "exist, this probably happened when using embedded metastore or 
doesn't create a " +
+              "transactional meta table. To fix this, use an alternative 
metastore", e);
+        } else if (e.getMessage().contains("java.net.SocketTimeoutException: 
Read timed out")) {

Review comment:
       Could we just check for the `cause` field instead of the message string?
   Or we are in a same situation as with the MetaExceptions, where there is 
only a string available?
   
   Thanks, Peter 




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

Reply via email to