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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]