Sergey Soldatov created ZEPPELIN-2833:
-----------------------------------------

             Summary: JDBC Interpreter doesn't follow JDBC specification when 
getting the results.
                 Key: ZEPPELIN-2833
                 URL: https://issues.apache.org/jira/browse/ZEPPELIN-2833
             Project: Zeppelin
          Issue Type: Bug
          Components: Interpreters
            Reporter: Sergey Soldatov


According to the documentation for ResultSet#next:
{noformat}
When a call to the next method returns false, the cursor is positioned after 
the last row. Any invocation of a ResultSet method which requires a current row 
will result in a SQLException being thrown. If the result set type is 
TYPE_FORWARD_ONLY, it is vendor specified whether their JDBC driver 
implementation *will return false or throw an SQLException on a subsequent call 
to next.*
{noformat}
In JDBCInterpreter getResults method is iterating till it reaches the max limit 
or next() returns false.
In executeSql that calls getResults the next() method is called again. 
According to the JDBC specification this may produce SQL Exception if end of 
the result set is already reached. 
That may be reproducible with Apache Phoenix 4.7+  jdbc driver. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to