oleg-vlsk commented on code in PR #11425: URL: https://github.com/apache/ignite/pull/11425#discussion_r1885432925
########## modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SqlPlanHistoryIntegrationTest.java: ########## @@ -291,141 +288,168 @@ public void testJdbcQueryFailed() throws Exception { /** Checks successful SqlFieldsQuery. */ @Test - public void testSqlFieldsQuery() { + public void testSqlFieldsQuery() throws Exception { runSuccessfulQuery(sqlFieldsQry); } /** Checks failed SqlFieldsQuery. */ @Test - public void testSqlFieldsQueryFailed() { + public void testSqlFieldsQueryFailed() throws Exception { runFailedQuery(sqlFieldsQryFailed); } /** Checks successful cross-cache SqlFieldsQuery. */ @Test - public void testSqlFieldsCrossCacheQuery() { + public void testSqlFieldsCrossCacheQuery() throws Exception { runSuccessfulQuery(sqlFieldsQryCrossCache); } /** Checks failed cross-cache SqlFieldsQuery. */ @Test - public void testSqlFieldsCrossCacheQueryFailed() { + public void testSqlFieldsCrossCacheQueryFailed() throws Exception { runFailedQuery(sqlFieldsQryCrossCacheFailed); } - /** Checks successful SqlFieldsQuery with reduce phase. */ + /** + * Checks successful SqlFieldsQuery with reduce phase. There should be 3 entries in SQL plan history on the + * reduce node (2 SELECT subqueries and 1 UNION/MERGE subquery) and 2 entries on the map node (2 SELECT subqueries). + */ @Test - public void testSqlFieldsQueryWithReducePhase() { + public void testSqlFieldsQueryWithReducePhase() throws Exception { runQueryWithReducePhase(() -> { - cacheQuery(sqlFieldsQryWithReducePhase.setLocal(loc), "pers"); + try { + startGridsMultiThreaded(1, 2); + + awaitPartitionMapExchange(); + } + catch (Exception e) { + throw new RuntimeException(e); + } + + cacheQuery(sqlFieldsQryWithReducePhase, "pers"); + + checkSqlPlanHistory(3); - checkSqlPlanHistory((!isClient && sqlEngine == IndexingQueryEngineConfiguration.ENGINE_NAME) ? 3 : 1); + for (int i = 1; i <= 2; i++) { + Map<SqlPlan, Long> sqlPlansOnMapNode = grid(i).context().query().runningQueryManager() + .planHistoryTracker().sqlPlanHistory(); + + assertNotNull(sqlPlansOnMapNode); + + checkMetrics(2, sqlPlansOnMapNode); + } }); } - /** Checks failed SqlFieldsQuery with reduce phase. */ + /** + * Checks failed SqlFieldsQuery with reduce phase. If the fisrt subquery fails, there should be only one entry in + * SQL plan history. If the fisrt subquery is successfully executed but the second one fails, the history should Review Comment: Test deleted. -- 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-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org