veghlaci05 commented on code in PR #4566:
URL: https://github.com/apache/hive/pull/4566#discussion_r1407546896
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java:
##########
@@ -193,10 +193,17 @@ public boolean isDeadlock(SQLException e) {
/**
* Is the given exception a table not found exception
- * @param e Exception
+ * @param ex Exception
* @return
*/
- public boolean isTableNotExistsError(SQLException e) {
+ public boolean isTableNotExistsError(Throwable ex) {
+ while (ex != null && !(ex instanceof SQLException) ) {
+ ex = ex.getCause();
+ }
+ if (ex == null) {
+ throw new IllegalArgumentException("No SQLException found in the
exception chain!");
+ }
+ SQLException e = (SQLException) ex;
Review Comment:
There is no need for check because the preceding code will either result in
an `IllegalArgumentException`, or the ex variable will contain an
`SQLException` instance.
--
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]