pan3793 commented on code in PR #6115:
URL: https://github.com/apache/kyuubi/pull/6115#discussion_r1506934592


##########
kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiStatement.java:
##########
@@ -543,6 +543,18 @@ public int getMaxRows() throws SQLException {
     return maxRows;
   }
 
+  @Override
+  public boolean getMoreResults(int current) throws SQLException {
+    // getMoreResults() javadoc says, that it should implicitly close
+    // any current ResultSet object, so here in case of 
Statement.CLOSE_CURRENT_RESULT
+    // we can implement the same logic
+    // see also https://issues.apache.org/jira/browse/HIVE-7680
+    if (current == Statement.CLOSE_CURRENT_RESULT) {
+      return false;
+    }
+    throw new SQLFeatureNotSupportedException("Method not supported");

Review Comment:
   The `TrinoStatement`'s implementation looks better
   ```
       @Override
       public boolean getMoreResults(int current)
               throws SQLException
       {
           checkOpen();
   
           currentUpdateCount.set(-1);
           currentUpdateType.set(null);
   
           if (current == CLOSE_CURRENT_RESULT) {
               closeResultSet();
               return false;
           }
   
           if (current != KEEP_CURRENT_RESULT && current != CLOSE_ALL_RESULTS) {
               throw new SQLException("Invalid argument: " + current);
           }
   
           throw new SQLFeatureNotSupportedException("Multiple open results not 
supported");
       }
   ```



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

Reply via email to