belugabehr commented on a change in pull request #1029: URL: https://github.com/apache/hive/pull/1029#discussion_r435245485
########## File path: jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java ########## @@ -197,6 +198,12 @@ private void closeStatementIfNeeded() throws SQLException { } catch (SQLException e) { throw e; } catch (Exception e) { + if (e instanceof TApplicationException && ((TApplicationException)e) + .getType() == TApplicationException.BAD_SEQUENCE_ID) { + String errorMsg = "Mismatch thrift sequence id, which usually is caused by an OutOfMemoryError " + + "or a SocketTimeoutException, please check the memory status and previous calls."; + throw new SQLException(errorMsg, "08S01", e); Review comment: Please do not say 'is usually caused by'. We do not yet know what "usual" is. Try something like: ` Mismatch thrift sequence id. A previous call to the Thrift library failed and now position within the input stream is lost. Please enable verbose error logging and check the status of previous calls. ` ########## File path: jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java ########## @@ -197,6 +198,12 @@ private void closeStatementIfNeeded() throws SQLException { } catch (SQLException e) { throw e; } catch (Exception e) { + if (e instanceof TApplicationException && ((TApplicationException)e) Review comment: Please do not use `instanceof` here, just create a new `catch` block for `TApplicationException` types. ---------------------------------------------------------------- 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. 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