korlov42 commented on code in PR #2906:
URL: https://github.com/apache/ignite-3/pull/2906#discussion_r1416832587
##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc/JdbcResultSet.java:
##########
@@ -201,6 +205,37 @@ public JdbcResultSet(List<List<Object>> rows,
List<JdbcColumnMeta> meta) throws
initColumnOrder();
}
+ JdbcResultSet getNextResultSet() throws SQLException {
+ try {
+ JdbcGetMoreResultsRequest req = new
JdbcGetMoreResultsRequest(cursorId);
+ JdbcGetMoreResultsResult res =
cursorHandler.getMoreResultsAsync(req).get();
+
+ if (!res.hasResults()) {
+ return null;
+ }
+
+ long cursorId0 = res.cursorId();
+
+ long updCount = 0;
+
+ if (res.isDml()) {
+ CompletableFuture<JdbcQueryFetchResult> fetch =
cursorHandler.fetchAsync(
+ new JdbcQueryFetchRequest(cursorId0, 1));
+ JdbcQueryFetchResult fetchRes = fetch.get();
+ updCount = (long) fetchRes.items().get(0).get(0);
+ }
+
+ return new JdbcResultSet(cursorHandler, stmt, cursorId0,
getFetchSize(), false, Collections.emptyList(), res.isQuery(),
Review Comment:
well, you've done this already for DML (by the cost of extra round trip
though)... And regarding just a query: why one might execute SELECT statement
if they don't need a result? I believe the common case here is that every
result will be consumed, thus prefetching the first page seems like a legit
optimisation of the common case.
--
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]