korlov42 commented on code in PR #2192:
URL: https://github.com/apache/ignite-3/pull/2192#discussion_r1229458481
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java:
##########
@@ -383,121 +398,187 @@ private void registerIndexListener(IndexEvent evt,
AbstractIndexEventListener ls
private CompletableFuture<AsyncSqlCursor<List<Object>>> querySingle0(
SessionId sessionId,
- QueryContext context,
+ QueryContext queryContext,
String sql,
Object... params
) {
Session session = sessionManager.session(sessionId);
if (session == null) {
- return CompletableFuture.failedFuture(
+ return failedFuture(
new SqlException(SESSION_NOT_FOUND_ERR, format("Session
not found [{}]", sessionId)));
}
+ QueryCancel queryCancel = new QueryCancel();
+
+ try {
+ registerQueryCancel(session, new QueryCancel());
+ } catch (IllegalStateException ex) {
+ return failedFuture(new
IgniteInternalException(SESSION_EXPIRED_ERR,
+ format("Session has been expired [{}]",
session.sessionId()), ex));
+ }
+
String schemaName =
session.properties().get(QueryProperty.DEFAULT_SCHEMA);
- InternalTransaction outerTx =
context.unwrap(InternalTransaction.class);
+ InternalTransaction outerTx =
queryContext.unwrap(InternalTransaction.class);
+ boolean implicitTx = outerTx == null;
- QueryCancel queryCancel = new QueryCancel();
+ // TODO: IGNITE-19497 Switch to Catalog manager and uncomment next
lines.
+ long timestamp = outerTx == null ? clock.nowLong() :
outerTx.startTimestamp().longValue();
+ // int plannerCatalogVersion =
catalogManager.activeCatalogVersion(timestamp);
+ // int schemaId = catalogManager.schema(plannerCatalogVersion).id();
+ // SchemaPlus schema = sqlSchemaManager.schema(schemaName,
plannerCatalogVersion);
Review Comment:
Let's not jump to conclusions about how unrelated tickets might look like
--
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]