xtern commented on code in PR #6397: URL: https://github.com/apache/ignite-3/pull/6397#discussion_r2285072473
########## modules/client/src/main/java/org/apache/ignite/internal/client/sql/ClientAsyncResultSet.java: ########## @@ -139,6 +162,49 @@ public boolean hasRowSet() { return hasRowSet; } + /** + * Returns flag indicating whether the current result set is the result of + * a multi-statement query and this statement is not the last one. + */ + public boolean hasNextResultSet() { + return nextResultResourceId != null; + } + + /** + * Retrieves the next result set of a multi-statement query. + * + * @return Next result set. + * @throws NoSuchElementException if the query has no more statements to execute. + */ + public CompletableFuture<ClientAsyncResultSet<T>> nextResultSet() { + if (nextResultResourceId == null) { + return CompletableFuture.failedFuture(new NoSuchElementException("Query has no more results")); + } + + assert nextResultFuture != null; + + if (!nextResultSetRetrieved.compareAndSet(false, true)) { + return nextResultFuture; + } + + assert marshaller == null : "Multi-statement execution doesn't support custom mapper"; Review Comment: Removed this confusing assertion. -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org