xtern commented on code in PR #2789:
URL: https://github.com/apache/ignite-3/pull/2789#discussion_r1392536767
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java:
##########
@@ -535,4 +612,147 @@ private static void validateParsedStatement(
}
}
}
+
+ private class MultiStatementHandler {
+ private final String schemaName;
+ private final IgniteTransactions transactions;
+ private final @Nullable InternalTransaction explicitTransaction;
+ private final Queue<ScriptStatementParameters> statements;
+
+ MultiStatementHandler(
+ String schemaName,
+ IgniteTransactions transactions,
+ @Nullable InternalTransaction explicitTransaction,
+ List<ParsedResult> parsedResults,
+ Object[] params
+ ) {
+ this.schemaName = schemaName;
+ this.transactions = transactions;
+ this.explicitTransaction = explicitTransaction;
+ this.statements = prepareStatementsQueue(parsedResults, params);
+ }
+
+ CompletableFuture<AsyncSqlCursor<List<Object>>> processNext() {
+ ScriptStatementParameters parameters = statements.poll();
+
+ if (parameters == null) {
+ return CompletableFuture.completedFuture(null);
+ }
+
+ ParsedResult parsedResult = parameters.parsedResult;
+ Object[] dynamicParams = parameters.dynamicParams;
+ CompletableFuture<AsyncSqlCursor<List<Object>>> cursorFuture =
parameters.cursorFuture;
+
+ try {
+ if (cursorFuture.isDone()) {
+ return cursorFuture;
+ }
+
+ QueryTransactionWrapper txWrapper =
wrapTxOrStartImplicit(parsedResult.queryType(), transactions,
explicitTransaction);
Review Comment:
Overall, I agree with you, but since I remember that there were a LOT of
discussions on this topic previously
(https://github.com/apache/ignite-3/pull/2449) and since this task is not
directly related to current issue? I filled another ticket to resolve this
separately: https://issues.apache.org/jira/browse/IGNITE-20855
--
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]