korlov42 commented on code in PR #1537:
URL: https://github.com/apache/ignite-3/pull/1537#discussion_r1080890009
##########
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",
+ "EXPLAIN PLAN FOR " + qry, params);
+
+ var explainCursor = explainCursors.get(0).join();
Review Comment:
I'd prefer to use
`org.apache.ignite.internal.testframework.IgniteTestUtils#await(java.util.concurrent.CompletionStage<T>)`
rather explicitly joining on the future, as it has the reasonable timeout that
prevents the whole test suite from being stuck forever
--
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]