ygerzhedovich commented on a change in pull request #9476:
URL: https://github.com/apache/ignite/pull/9476#discussion_r725095443



##########
File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessor.java
##########
@@ -267,13 +293,71 @@ public FailureProcessor failureProcessor() {
             qryPlanCache,
             exchangeSvc
         );
+
+        runningQrys.clear();
     }
 
     /** {@inheritDoc} */
     @Override public List<FieldsQueryCursor<List<?>>> query(@Nullable 
QueryContext qryCtx, @Nullable String schemaName,
-        String qry, Object... params) throws IgniteSQLException {
+        String sql, Object... params) throws IgniteSQLException {
+        QueryPlan plan = queryPlanCache().queryPlan(new 
CacheKey(schemaHolder.getDefaultSchema(schemaName).getName(), sql));
+
+        if (plan != null) {
+            RootQuery<Object[]> qry = new RootQuery<>(
+                sql,
+                schemaHolder.getDefaultSchema(schemaName),
+                params,
+                qryCtx,
+                exchangeSvc,
+                (q) -> unregister(q.id()),
+                log
+            );
+
+            register(qry);
 
-        return executionSvc.executeQuery(qryCtx, schemaName, qry, params);
+            return Collections.singletonList(executionSvc.executePlan(

Review comment:
       I see different approaches for execute cached singlestatement and for 
not cached plans. For cached singlestatement you do register and execute plan. 
For not cahed you added try/catch block with invoke unregister method.




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