xtern commented on code in PR #2906:
URL: https://github.com/apache/ignite-3/pull/2906#discussion_r1429726935


##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/JdbcQueryCursorHandlerImpl.java:
##########
@@ -91,6 +95,49 @@ public CompletableFuture<JdbcQueryFetchResult> 
fetchAsync(JdbcQueryFetchRequest
         }).toCompletableFuture();
     }
 
+    /** {@inheritDoc} */
+    @Override
+    public CompletableFuture<JdbcQuerySingleResult> 
getMoreResultsAsync(JdbcFetchQueryResultsRequest req) {
+        AsyncSqlCursor<InternalSqlRow> asyncSqlCursor;
+        try {
+            asyncSqlCursor = 
resources.get(req.cursorId()).get(AsyncSqlCursor.class);
+        } catch (IgniteInternalCheckedException e) {
+            StringWriter sw = getWriterWithStackTrace(e);
+
+            return CompletableFuture.completedFuture(new 
JdbcQuerySingleResult(Response.STATUS_FAILED,

Review Comment:
   (related comment)
   Here we returning a future, which will result hasResults=false.
   
   By the way, it looks very strange that we only handle 
IgniteInternalCheckedException here (and ignoring IgniteInternalException, 
which can be thrown if, for example, if resource was not found in registry).
   It might be worth to fili a ticket to investigate error handling in such 
places.



##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc/JdbcResultSet.java:
##########
@@ -215,6 +218,37 @@ public JdbcResultSet(List<List<Object>> rows, 
List<JdbcColumnMeta> meta) throws
         initColumnOrder();
     }
 
+    @Nullable JdbcResultSet getNextResultSet() throws SQLException {
+        try {
+            JdbcQueryFetchRequest req = new JdbcQueryFetchRequest(cursorId, 
fetchSize);
+            JdbcQuerySingleResult res = 
cursorHandler.getMoreResultsAsync(req).get();
+
+            close0(true);
+
+            if (!res.hasResults()) {

Review Comment:
   AFAIK we need additional check here, something like
   ```
                   if (res.status() == STATUS_FAILED) {
                       throw createJdbcSqlException(res.err(), res.status());
                   }
   ```
   If the JdbcQueryCursorHandler returns a future with an error, we are not 
handling it properly here.
   
   (see related comment in `JdbcQueryCursorHandlerImpl` class)



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

Reply via email to