zratkai commented on code in PR #4566:
URL: https://github.com/apache/hive/pull/4566#discussion_r1406032016


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java:
##########
@@ -546,41 +553,48 @@ public boolean supportsGetGeneratedKeys() throws 
MetaException {
     }
   }
 
-  public boolean isDuplicateKeyError(SQLException ex) {
+  public boolean isDuplicateKeyError(Throwable ex) {
+    while (ex != null && !(ex instanceof SQLException) ) {
+      ex = ex.getCause();
+    }
+    if (ex == null) {
+      throw new IllegalArgumentException("No SQLException found in the 
exception chain!");

Review Comment:
   This part is the same in isTableNotExistsError. Can you move it to a 
separate method?



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to