[ 
https://issues.apache.org/jira/browse/HIVE-23526?focusedWorklogId=441071&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-441071
 ]

ASF GitHub Bot logged work on HIVE-23526:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Jun/20 02:26
            Start Date: 04/Jun/20 02:26
    Worklog Time Spent: 10m 
      Work Description: belugabehr commented on pull request #1029:
URL: https://github.com/apache/hive/pull/1029#issuecomment-638563394


   I think the best thing would be to modify this:
   
   
https://github.com/apache/hive/blob/2795d3253f5ff09c23b12e5ff980cb14268d37ab/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java#L189-L202
   
   Thrift does not have sub-classes for Exception, but Exceptions generally 
carry a type.  In this case, the type is 
`TApplicationException.BAD_SEQUENCE_ID` :
   
   
https://github.com/apache/thrift/blob/af7ecd6a2b15efe5c6b742cf4a9ccb31bcc1f362/lib/java/src/org/apache/thrift/TServiceClient.java#L84-L87
   
   I think the best course of action here is to catch the Exception in the 
`HiveStatement`, check the 'type', and if it is `BAD_SEQUENCE_ID, wrap the 
Exception in a `SQLException` and provide a better error message that is more 
clear.
   
   That `Commands` method is a bit hairy, but all that needs to happen as a 
quick fix is to wrap the `Statement#close()` with its own try-catch block.  
There is no need to close the result set.  Closing the Statement should close 
all associated result sets.
   
   > When a Statement object is closed, its current ResultSet object, if one 
exists, is also closed.
   https://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#close()


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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 441071)
    Time Spent: 3h 20m  (was: 3h 10m)

> Beeline may throw the misleading exception
> ------------------------------------------
>
>                 Key: HIVE-23526
>                 URL: https://issues.apache.org/jira/browse/HIVE-23526
>             Project: Hive
>          Issue Type: Improvement
>          Components: Beeline
>         Environment: Hive 1.2.2
>            Reporter: Zhihua Deng
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: HIVE-23526.2.patch, HIVE-23526.3.patch, 
> HIVE-23526.patch, outofsequence.log
>
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> Sometimes we can see 'out of sequence response' message in beeline, for 
> example:
> Error: org.apache.thrift.TApplicationException: CloseOperation failed: out of 
> sequence response (state=08S01,code=0)
> java.sql.SQLException: org.apache.thrift.TApplicationException: 
> CloseOperation failed: out of sequence response
> at 
> org.apache.hive.jdbc.HiveStatement.closeClientOperation(HiveStatement.java:198)
> at org.apache.hive.jdbc.HiveStatement.close(HiveStatement.java:217)
> at org.apache.hive.beeline.Commands.execute(Commands.java:891)
> at org.apache.hive.beeline.Commands.sql(Commands.java:713)
> at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:976)
> at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:816)
> at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:774)
> at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:487)
> at org.apache.hive.beeline.BeeLine.main(BeeLine.java:470)
> and there is no other usage message to figured it out, even with --verbose, 
> this makes problem puzzled as beeline does not have concurrency problem on 
> underlying thrift transport.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to