You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2023/01/19 07:24:21 UTC

[GitHub] [ignite-3] korlov42 commented on a diff in pull request #1537: IGNITE-18227 Refactor scan nodes and add support RO index scans

korlov42 commented on code in PR #1537:
URL: https://github.com/apache/ignite-3/pull/1537#discussion_r1080887538


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/util/QueryChecker.java:
##########
@@ -367,73 +392,86 @@ public QueryChecker planEquals(String plan) {
      * Run checks.
      */
     public void check() {
-        // Check plan.
-        QueryProcessor qryProc = getEngine();
+        QueryProcessor queryEngine = getEngine();
 
-        var explainCursors = qryProc.queryAsync("PUBLIC", "EXPLAIN PLAN FOR " + qry, params);
+        SessionId sessionId = queryEngine.createSession(SESSION_IDLE_TIMEOUT, PropertiesHolder.fromMap(
+                Map.of(QueryProperty.DEFAULT_SCHEMA, "PUBLIC")
+        ));
 
-        var explainCursor = explainCursors.get(0).join();
-        var explainRes = getAllFromCursor(explainCursor);
-        String actualPlan = (String) explainRes.get(0).get(0);
+        QueryContext context = tx != null ? QueryContext.of(tx) : QueryContext.of();
 
-        if (!CollectionUtils.nullOrEmpty(planMatchers)) {
-            for (Matcher<String> matcher : planMatchers) {
-                assertThat("Invalid plan:\n" + actualPlan, actualPlan, matcher);
+        try {
+            if (!CollectionUtils.nullOrEmpty(planMatchers) || exactPlan != null) {
+                var explainCursors = queryEngine.queryAsync("PUBLIC",

Review Comment:
   we must use the same way to check the plan as we use to check the results (`queryAsync` --> 'querySingleAsync')



-- 
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-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org