From 0fb49558231d3769b47e32015a5831f27325bbdb Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Wed, 14 Oct 2026 18:50:10 +0300 Subject: [PATCH 01/14] IGNITE-29117 Both engines must be available. Calcite default. --- assembly/dependencies-apache-ignite-lgpl.xml | 2 + assembly/dependencies-apache-ignite-slim.xml | 2 + assembly/dependencies-apache-ignite.xml | 2 + docs/_docs/setup.adoc | 4 +- ...eryEngineConfigurationIntegrationTest.java | 24 +++++-- .../SqlPlanHistoryIntegrationTest.java | 12 ++-- modules/calcite/README.txt | 4 +- .../CalciteOnlyNodeIntegrationTest.java | 12 ++-- .../configuration/SqlConfiguration.java | 5 +- .../processors/query/GridQueryProcessor.java | 64 +++++++++++++++---- modules/indexing/README.txt | 6 +- .../IndexingQueryEngineConfiguration.java | 3 +- 12 files changed, 97 insertions(+), 43 deletions(-) diff --git a/assembly/dependencies-apache-ignite-lgpl.xml b/assembly/dependencies-apache-ignite-lgpl.xml index 51754b12f58e1..fc875284fe867 100644 --- a/assembly/dependencies-apache-ignite-lgpl.xml +++ b/assembly/dependencies-apache-ignite-lgpl.xml @@ -34,6 +34,7 @@ ${project.groupId}:ignite-spring ${project.groupId}:ignite-calcite + ${project.groupId}:ignite-indexing ${project.groupId}:ignite-control-utility @@ -130,6 +131,7 @@ ${project.groupId}:ignite-extdata-pluggable ${project.groupId}:ignite-examples ${project.groupId}:ignite-calcite + ${project.groupId}:ignite-indexing ${project.groupId}:ignite-codegen ${project.groupId}:ignite-appserver-test ${project.groupId}:ignite-websphere-test diff --git a/assembly/dependencies-apache-ignite-slim.xml b/assembly/dependencies-apache-ignite-slim.xml index 68cfd59abbc72..c55073702894c 100644 --- a/assembly/dependencies-apache-ignite-slim.xml +++ b/assembly/dependencies-apache-ignite-slim.xml @@ -34,6 +34,7 @@ ${project.groupId}:ignite-spring ${project.groupId}:ignite-calcite + ${project.groupId}:ignite-indexing ${project.groupId}:ignite-control-utility @@ -130,6 +131,7 @@ ${project.groupId}:ignite-extdata-pluggable ${project.groupId}:ignite-examples ${project.groupId}:ignite-calcite + ${project.groupId}:ignite-indexing ${project.groupId}:ignite-codegen ${project.groupId}:ignite-schedule ${project.groupId}:ignite-appserver-test diff --git a/assembly/dependencies-apache-ignite.xml b/assembly/dependencies-apache-ignite.xml index cc6b475b106b9..bcfaad8417088 100644 --- a/assembly/dependencies-apache-ignite.xml +++ b/assembly/dependencies-apache-ignite.xml @@ -34,6 +34,7 @@ ${project.groupId}:ignite-spring ${project.groupId}:ignite-calcite + ${project.groupId}:ignite-indexing ${project.groupId}:ignite-control-utility @@ -131,6 +132,7 @@ ${project.groupId}:ignite-extdata-pluggable ${project.groupId}:ignite-examples ${project.groupId}:ignite-calcite + ${project.groupId}:ignite-indexing ${project.groupId}:ignite-codegen ${project.groupId}:ignite-schedule ${project.groupId}:ignite-appserver-test diff --git a/docs/_docs/setup.adoc b/docs/_docs/setup.adoc index 8cdb8bcc9e012..d70ce9a131c3a 100644 --- a/docs/_docs/setup.adoc +++ b/docs/_docs/setup.adoc @@ -151,8 +151,8 @@ Ignite ships with a number of modules and have a lot of extensions that provide You can enable modules or extensions one by one, as required. All modules are included in the binary distribution, but by default they -are disabled (except for the `ignite-core`, `ignite-spring`, `ignite-control-utility` and -`ignite-indexing` modules). Modules can be found in the `libs/optional` +are disabled (except for the `ignite-core`, `ignite-spring`, `ignite-control-utility`, +`ignite-calcite` and `ignite-indexing` modules). Modules can be found in the `libs/optional` directory of the distribution package (each module is located in a separate sub-directory). diff --git a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java index 272fb24019d52..75c144918a801 100644 --- a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java +++ b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java @@ -99,7 +99,7 @@ public void testInvalidConfiguration() { /** */ @Test public void testDefaultEngineConfiguration() throws Exception { - checkDefaultEngine(INDEXING_ENGINE); + checkDefaultEngine(CALCITE_ENGINE); checkDefaultEngine(INDEXING_ENGINE, new IndexingQueryEngineConfiguration(), new CalciteQueryEngineConfiguration()); @@ -149,22 +149,32 @@ public void testEngineByHint() throws Exception { } } - /** */ + /** Without an explicit configuration both engines on the classpath can be selected by name. */ @Test @SuppressWarnings("ThrowableNotThrown") public void testEngineWithoutConfiguration() throws Exception { try (Ignite ignite = startGrid(createConfiguration())) { IgniteCache cache = ignite.createCache("test"); - // Hint can't be used when engines is not configured. + checkEngine(cache, CALCITE_ENGINE, "SELECT QUERY_ENGINE()"); + + checkEngine(cache, INDEXING_ENGINE, "SELECT /*+ QUERY_ENGINE('" + INDEXING_ENGINE + "') */ QUERY_ENGINE()"); + + checkEngine(cache, CALCITE_ENGINE, "SELECT /*+ QUERY_ENGINE('" + CALCITE_ENGINE + "') */ QUERY_ENGINE()"); + + checkJdbcEngine(CALCITE_ENGINE, jdbcUrl, "SELECT QUERY_ENGINE()"); + + checkJdbcEngine(INDEXING_ENGINE, jdbcUrl + "?queryEngine=" + INDEXING_ENGINE, "SELECT QUERY_ENGINE()"); + + checkJdbcEngine(CALCITE_ENGINE, jdbcUrl + "?queryEngine=" + CALCITE_ENGINE, "SELECT QUERY_ENGINE()"); + + // Unknown engine. GridTestUtils.assertThrowsWithCause( - () -> cache.query(new SqlFieldsQuery( - "SELECT /*+ QUERY_ENGINE('" + INDEXING_ENGINE + "') */ QUERY_ENGINE()")).getAll(), + () -> cache.query(new SqlFieldsQuery("SELECT /*+ QUERY_ENGINE('noop') */ QUERY_ENGINE()")).getAll(), IgniteException.class); - // JDBC connection property can't be used when engines is not configured. GridTestUtils.assertThrowsWithCause( - () -> DriverManager.getConnection(jdbcUrl + "?queryEngine=" + INDEXING_ENGINE), + () -> DriverManager.getConnection(jdbcUrl + "?queryEngine=noop"), SQLException.class); } } diff --git a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SqlPlanHistoryIntegrationTest.java b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SqlPlanHistoryIntegrationTest.java index 54369aabf2e84..b4a02664bd68a 100644 --- a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SqlPlanHistoryIntegrationTest.java +++ b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SqlPlanHistoryIntegrationTest.java @@ -480,25 +480,25 @@ public void testResetPlanHistoryMetrics() throws Exception { } /** - * Checks that the actual SQL plan history remains empty and its size in {@link SqlConfiguration} equals {@code -1} - * when SQL is not explicitly configured. In such cases, H2 is used as the default engine. + * Checks that the SQL plan history is enabled with the default size when SQL is not explicitly configured. In such + * cases, both engines are on the classpath and Calcite is used as the default engine. */ @Test public void testNoSqlConfiguration() throws Exception { isSqlConfigured = false; - checkDefaultHistorySize(true, -1, 0, 1); + checkDefaultHistorySize(true, DFLT_SQL_PLAN_HISTORY_SIZE, DFLT_SQL_PLAN_HISTORY_SIZE, DFLT_SQL_PLAN_HISTORY_SIZE); } /** - * Checks that the actual SQL plan history remains empty and its size in {@link SqlConfiguration} equals {@code -1} - * when the SQL engine is not configured. In such cases, H2 is used as the default engine. + * Checks that the SQL plan history is enabled with the default size when the SQL engine is not configured. In such + * cases, both engines are on the classpath and Calcite is used as the default engine. */ @Test public void testNoSqlEngineConfiguration() throws Exception { isSqlEngineConfigured = false; - checkDefaultHistorySize(true, -1, 0, 1); + checkDefaultHistorySize(true, DFLT_SQL_PLAN_HISTORY_SIZE, DFLT_SQL_PLAN_HISTORY_SIZE, DFLT_SQL_PLAN_HISTORY_SIZE); } /** diff --git a/modules/calcite/README.txt b/modules/calcite/README.txt index 5b31619d75540..bdbe6ee0740d1 100644 --- a/modules/calcite/README.txt +++ b/modules/calcite/README.txt @@ -3,8 +3,8 @@ Apache Ignite Calcite Module Apache Ignite Calcite module provides Apache Calcite based query engine. -To enable Calcite based engine explicit `CalciteQueryEngineConfiguration` instance should be added to -`SqlConfiguration.QueryEnginesConfiguration` property (see `SqlConfiguration.setQueryEnginesConfiguration()`) or ./examples/config/example-sql.xml. +Calcite based engine is the default query engine. +If legacy mode required then `IndexingQueryEngineConfiguration` must be set as default. Config example: diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/CalciteOnlyNodeIntegrationTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/CalciteOnlyNodeIntegrationTest.java index 54de44b55a2b9..be47f1798b5da 100644 --- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/CalciteOnlyNodeIntegrationTest.java +++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/CalciteOnlyNodeIntegrationTest.java @@ -63,6 +63,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import static org.apache.ignite.internal.processors.query.GridQueryProcessor.INDEXING_ENGINE_NAME; import static org.apache.ignite.testframework.GridTestUtils.assertThrows; import static org.apache.ignite.testframework.GridTestUtils.assertThrowsAnyCause; @@ -80,9 +81,6 @@ public class CalciteOnlyNodeIntegrationTest extends GridCommonAbstractWrapperTes public static final String H2_ONLY_QRY_MSG = "is supported by the H2 query engine only. Add module " + "'ignite-indexing' to the classpath of all Ignite nodes"; - /** Name of the H2 engine, which is not available to the node. */ - private static final String H2_ENGINE_NAME = "h2"; - /** */ private static final String[] CLASS_PATH_PROPS = {"java.class.path", "surefire.test.class.path"}; @@ -291,9 +289,9 @@ public void testJdbcQueryEngineProperty() throws Exception { public void testJdbcH2QueryEngineProperty() { assertThrowsAnyCause( log, - () -> DriverManager.getConnection(JDBC_URL + "?queryEngine=" + H2_ENGINE_NAME), + () -> DriverManager.getConnection(JDBC_URL + "?queryEngine=" + INDEXING_ENGINE_NAME), SQLException.class, - "Not found configuration for query engine: " + H2_ENGINE_NAME + "Not found configuration for query engine: " + INDEXING_ENGINE_NAME ); } @@ -314,7 +312,7 @@ public void testQueryEngineHint() throws Exception { /** The H2 engine cannot be selected by the query hint. */ @Test public void testH2QueryEngineHint() throws Exception { - String qry = "SELECT /*+ QUERY_ENGINE('" + H2_ENGINE_NAME + "') */ QUERY_ENGINE()"; + String qry = "SELECT /*+ QUERY_ENGINE('" + INDEXING_ENGINE_NAME + "') */ QUERY_ENGINE()"; try (Connection conn = DriverManager.getConnection(JDBC_URL); Statement stmt = conn.createStatement() @@ -323,7 +321,7 @@ public void testH2QueryEngineHint() throws Exception { log, () -> stmt.executeQuery(qry), SQLException.class, - "Query engine not found: " + H2_ENGINE_NAME + "Query engine not found: " + INDEXING_ENGINE_NAME ); } } diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/SqlConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/SqlConfiguration.java index 7bead0b04e7a2..af440ad2d4d13 100644 --- a/modules/core/src/main/java/org/apache/ignite/configuration/SqlConfiguration.java +++ b/modules/core/src/main/java/org/apache/ignite/configuration/SqlConfiguration.java @@ -229,8 +229,9 @@ public SqlConfiguration setValidationEnabled(boolean validationEnabled) { * {@code QUERY_ENGINE('engineName')} SQL query hint. If no query engine is explicitly chosen, default query engine * will be used (see {@link QueryEngineConfiguration#setDefault(boolean)}). *

- * When this property is not set, the query engine cannot be chosen in run-time, and the engine provided by the - * ignite-indexing module will be used for all queries. + * When this property is not set, the query engines found on the classpath are used: the Calcite-based engine + * (the ignite-calcite module) is the default one and the H2-based engine (the ignite-indexing module), if present, + * can be chosen in run-time. If only one of the modules is on the classpath, its engine is used for all queries. * * @param enginesConfiguration Query engines configuration. * @return {@code this} for chaining. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java index c64e2e4f7247a..0a6c85193884a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java @@ -202,6 +202,9 @@ public class GridQueryProcessor extends GridProcessorAdapter { public static final String INDEXING_DISABLED_MSG = "Failed to execute query because indexing is disabled " + "(consider adding module '" + INDEXING.module() + "' to classpath or moving it from 'optional' to 'libs' folder)."; + /** */ + public static final String INDEXING_ENGINE_NAME = "h2"; + /** */ private static final ThreadLocal requestTopVer = new ThreadLocal<>(); @@ -562,19 +565,7 @@ private void initQueryEngines() throws IgniteCheckedException { QueryEngineConfiguration[] qryEnginesCfg = ctx.config().getSqlConfiguration().getQueryEnginesConfiguration(); if (F.isEmpty(qryEnginesCfg)) { - // No query engines explicitly configured - indexing will be used. - // If indexing is disabled, try to find any query engine in components. - if (!indexingEnabled()) { - for (GridComponent cmp : ctx.components()) { - if (cmp instanceof QueryEngine qryEngine && qryEngine.config() != null) { - qryEngines = new QueryEngine[] {qryEngine}; - dfltQryEngine = qryEngine; - this.qryEnginesCfg = new QueryEngineConfigurationEx[] {qryEngine.config()}; - - break; - } - } - } + initImplicitQueryEngines(); return; } @@ -639,6 +630,53 @@ private void initQueryEngines() throws IgniteCheckedException { dfltQryEngine = qryEngines[dfltQryEngineIdx]; } + /** + * Registers the query engines found on the classpath. + * A query engine component that provides its own configuration (the Calcite-based engine) becomes the default engine. + * The indexing (H2) engine, if it is on the classpath too, remains available by name. + */ + private void initImplicitQueryEngines() { + QueryEngine qryEngine = null; + + for (GridComponent cmp : ctx.components()) { + if (cmp instanceof QueryEngine qryEngine0 && qryEngine0.config() != null) { + qryEngine = qryEngine0; + + break; + } + } + + if (qryEngine == null) + return; + + if (indexingEnabled()) { + qryEngines = new QueryEngine[] {qryEngine, null}; + qryEnginesCfg = new QueryEngineConfigurationEx[] {qryEngine.config(), new QueryEngineConfigurationEx() { + @Override public String engineName() { + return INDEXING_ENGINE_NAME; + } + + @Override public Class engineClass() { + return IndexingQueryEngine.class; + } + + @Override public boolean isDefault() { + return false; + } + + @Override public QueryEngineConfiguration setDefault(boolean isDflt) { + throw new UnsupportedOperationException("Implicit query engine configuration is read-only."); + } + }}; + } + else { + qryEngines = new QueryEngine[] {qryEngine}; + qryEnginesCfg = new QueryEngineConfigurationEx[] {qryEngine.config()}; + } + + dfltQryEngine = qryEngine; + } + /** * @return Information about secondary indexes inline size. Key is a full index name, value is a effective inline size. * @see IndexProcessor#secondaryIndexesInlineSize() diff --git a/modules/indexing/README.txt b/modules/indexing/README.txt index f0ea6ba8d0b13..fadbaba566d40 100644 --- a/modules/indexing/README.txt +++ b/modules/indexing/README.txt @@ -4,9 +4,9 @@ Apache Ignite Indexing Module Apache Ignite indexing module provides capabilities to index cache context and run SQL, full text or individual field queries against these indexes. -To enable indexing module when starting a standalone node, move 'optional/ignite-indexing' folder to -'libs' folder before running 'ignite.{sh|bat}' script. The content of the module folder will -be added to classpath in this case. +The module is located in the 'libs' folder of the binary distribution and is enabled by default. It provides +the H2-based SQL engine. When the Calcite-based engine (the 'ignite-calcite' module) is on the classpath too and +`SqlConfiguration.QueryEnginesConfiguration` is not set, the Calcite-based engine is the default one. Importing indexing Module In Maven Project ------------------------------------------ diff --git a/modules/indexing/src/main/java/org/apache/ignite/indexing/IndexingQueryEngineConfiguration.java b/modules/indexing/src/main/java/org/apache/ignite/indexing/IndexingQueryEngineConfiguration.java index cfba6aa376a35..878f22b6d52cf 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/indexing/IndexingQueryEngineConfiguration.java +++ b/modules/indexing/src/main/java/org/apache/ignite/indexing/IndexingQueryEngineConfiguration.java @@ -17,6 +17,7 @@ package org.apache.ignite.indexing; +import org.apache.ignite.internal.processors.query.GridQueryProcessor; import org.apache.ignite.internal.processors.query.IndexingQueryEngine; import org.apache.ignite.internal.processors.query.QueryEngine; import org.apache.ignite.internal.processors.query.QueryEngineConfigurationEx; @@ -26,7 +27,7 @@ */ public class IndexingQueryEngineConfiguration implements QueryEngineConfigurationEx { /** Query engine name. */ - public static final String ENGINE_NAME = "h2"; + public static final String ENGINE_NAME = GridQueryProcessor.INDEXING_ENGINE_NAME; /** */ private boolean isDflt; From a74b879f5ef9a10db3d922de1a3242a2149702e5 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Wed, 14 Oct 2026 19:11:06 +0300 Subject: [PATCH 02/14] IGNITE-29117 Both engines must be available. Calcite default. --- .../integration/QueryEngineConfigurationIntegrationTest.java | 4 ---- modules/calcite/README.txt | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java index 75c144918a801..24cb8f4d2b1f9 100644 --- a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java +++ b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java @@ -157,15 +157,11 @@ public void testEngineWithoutConfiguration() throws Exception { IgniteCache cache = ignite.createCache("test"); checkEngine(cache, CALCITE_ENGINE, "SELECT QUERY_ENGINE()"); - checkEngine(cache, INDEXING_ENGINE, "SELECT /*+ QUERY_ENGINE('" + INDEXING_ENGINE + "') */ QUERY_ENGINE()"); - checkEngine(cache, CALCITE_ENGINE, "SELECT /*+ QUERY_ENGINE('" + CALCITE_ENGINE + "') */ QUERY_ENGINE()"); checkJdbcEngine(CALCITE_ENGINE, jdbcUrl, "SELECT QUERY_ENGINE()"); - checkJdbcEngine(INDEXING_ENGINE, jdbcUrl + "?queryEngine=" + INDEXING_ENGINE, "SELECT QUERY_ENGINE()"); - checkJdbcEngine(CALCITE_ENGINE, jdbcUrl + "?queryEngine=" + CALCITE_ENGINE, "SELECT QUERY_ENGINE()"); // Unknown engine. diff --git a/modules/calcite/README.txt b/modules/calcite/README.txt index bdbe6ee0740d1..854e2c680d252 100644 --- a/modules/calcite/README.txt +++ b/modules/calcite/README.txt @@ -3,7 +3,7 @@ Apache Ignite Calcite Module Apache Ignite Calcite module provides Apache Calcite based query engine. -Calcite based engine is the default query engine. +Calcite based engine is default. If legacy mode required then `IndexingQueryEngineConfiguration` must be set as default. Config example: From ac9f8292d1a64ab381164d5bc0453efc583b3ddc Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Wed, 14 Oct 2026 19:52:14 +0300 Subject: [PATCH 03/14] IGNITE-29117 Both engines must be available. Calcite default. --- .../ignite/internal/processors/query/GridQueryProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java index 0a6c85193884a..62b463306217a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java @@ -667,7 +667,7 @@ private void initImplicitQueryEngines() { @Override public QueryEngineConfiguration setDefault(boolean isDflt) { throw new UnsupportedOperationException("Implicit query engine configuration is read-only."); } - }}; + } }; } else { qryEngines = new QueryEngine[] {qryEngine}; From 7cf02b2caa195e1a9199886c634539d6940a8f22 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 15 Oct 2026 12:41:41 +0300 Subject: [PATCH 04/14] IGNITE-29117 Both engines must be available. Calcite default. --- modules/calcite-testing/pom.xml | 6 + .../config/jdbc-client-driver-calcite.xml | 48 ++++++++ .../src/test/config/jdbc-client-driver-h2.xml | 60 ++++++++++ .../JdbcClientDriverDefaultEngineTest.java | 111 ++++++++++++++++++ .../testsuites/CalciteAndH2TestSuite.java | 2 + .../internal/jdbc2/JdbcBatchUpdateTask.java | 4 +- .../JdbcQueryMultipleStatementsTask.java | 4 +- .../ignite/internal/jdbc2/JdbcQueryTask.java | 8 +- modules/platforms/dotnet/build.ps1 | 11 +- 9 files changed, 244 insertions(+), 10 deletions(-) create mode 100644 modules/calcite-testing/src/test/config/jdbc-client-driver-calcite.xml create mode 100644 modules/calcite-testing/src/test/config/jdbc-client-driver-h2.xml create mode 100644 modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java diff --git a/modules/calcite-testing/pom.xml b/modules/calcite-testing/pom.xml index ab7ed13e5f260..b0381ed85e41d 100644 --- a/modules/calcite-testing/pom.xml +++ b/modules/calcite-testing/pom.xml @@ -66,6 +66,12 @@ test + + ${project.groupId} + ignite-spring + test + + ${project.groupId} ignite-calcite diff --git a/modules/calcite-testing/src/test/config/jdbc-client-driver-calcite.xml b/modules/calcite-testing/src/test/config/jdbc-client-driver-calcite.xml new file mode 100644 index 0000000000000..fa8c77493d0dd --- /dev/null +++ b/modules/calcite-testing/src/test/config/jdbc-client-driver-calcite.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + 127.0.0.1:47500..47509 + + + + + + + + diff --git a/modules/calcite-testing/src/test/config/jdbc-client-driver-h2.xml b/modules/calcite-testing/src/test/config/jdbc-client-driver-h2.xml new file mode 100644 index 0000000000000..fe23fe67a29ab --- /dev/null +++ b/modules/calcite-testing/src/test/config/jdbc-client-driver-h2.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + 127.0.0.1:47500..47509 + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java new file mode 100644 index 0000000000000..8f166685d3cf3 --- /dev/null +++ b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java @@ -0,0 +1,111 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.processors.query.calcite.jdbc; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.Statement; +import java.util.List; +import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.apache.ignite.calcite.CalciteQueryEngineConfiguration; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.configuration.SqlConfiguration; +import org.apache.ignite.indexing.IndexingQueryEngineConfiguration; +import org.apache.ignite.internal.util.typedef.internal.U; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.Parameter; +import org.junit.jupiter.params.ParameterizedClass; +import org.junit.jupiter.params.provider.ValueSource; + +/** Checks that the JDBC Client Driver ({@code jdbc:ignite:cfg://}) works with any default SQL engine of the client node it starts. */ +@ParameterizedClass(name = "Engine={0}") +@ValueSource(strings = {IndexingQueryEngineConfiguration.ENGINE_NAME, CalciteQueryEngineConfiguration.ENGINE_NAME}) +public class JdbcClientDriverDefaultEngineTest extends AbstractJdbcTest { + /** Directory with the Spring XML configurations of the client node started by the driver. */ + private static final String CFG_DIR = "modules/calcite-testing/src/test/config/"; + + /** Name of the default engine. */ + @Parameter(0) + private String dfltEngine; + + /** */ + private Connection conn; + + /** {@inheritDoc} */ + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); + + if (dfltEngine.equals(IndexingQueryEngineConfiguration.ENGINE_NAME)) { + cfg.setSqlConfiguration(new SqlConfiguration().setQueryEnginesConfiguration( + new IndexingQueryEngineConfiguration().setDefault(true), + new CalciteQueryEngineConfiguration())); + } + + return cfg; + } + + /** {@inheritDoc} */ + @BeforeEach + @Override protected void beforeTest() throws Exception { + startGrid(0); + + serverSql("CREATE TABLE test (id INT PRIMARY KEY, val VARCHAR)"); + serverSql("INSERT INTO test VALUES (1, 'val1'), (2, 'val2')"); + + conn = DriverManager.getConnection("jdbc:ignite:cfg://" + CFG_DIR + "jdbc-client-driver-" + dfltEngine + ".xml"); + + conn.setSchema("PUBLIC"); + } + + /** {@inheritDoc} */ + @AfterEach + @Override protected void afterTest() throws Exception { + U.closeQuiet(conn); + + stopAllGrids(); + } + + /** */ + @Test + public void testSelect() throws Exception { + List> res = executeQuery(conn, "SELECT id, val FROM test ORDER BY id"); + + assertEquals(2, res.size()); + assertEquals(1, res.get(0).get(0)); + assertEquals("val1", res.get(0).get(1)); + assertEquals(2, res.get(1).get(0)); + assertEquals("val2", res.get(1).get(1)); + } + + /** */ + @Test + public void testDml() throws Exception { + try (Statement stmt = conn.createStatement()) { + assertEquals(1, stmt.executeUpdate("INSERT INTO test VALUES (3, 'val3')")); + } + + assertEquals(3L, serverSql("SELECT COUNT(*) FROM test").get(0).get(0)); + } + + /** Executes a query on the server node with its default engine. */ + private List> serverSql(String sql) { + return grid(0).context().query().querySqlFields(new SqlFieldsQuery(sql), false).getAll(); + } +} diff --git a/modules/calcite-testing/src/test/java/org/apache/ignite/testsuites/CalciteAndH2TestSuite.java b/modules/calcite-testing/src/test/java/org/apache/ignite/testsuites/CalciteAndH2TestSuite.java index df0f41142436a..6ad50c4702863 100644 --- a/modules/calcite-testing/src/test/java/org/apache/ignite/testsuites/CalciteAndH2TestSuite.java +++ b/modules/calcite-testing/src/test/java/org/apache/ignite/testsuites/CalciteAndH2TestSuite.java @@ -24,6 +24,7 @@ import org.apache.ignite.internal.processors.query.calcite.integration.SqlPlanHistoryIntegrationTest; import org.apache.ignite.internal.processors.query.calcite.integration.TimeoutIntegrationTest; import org.apache.ignite.internal.processors.query.calcite.integration.ViewsIntegrationTest; +import org.apache.ignite.internal.processors.query.calcite.jdbc.JdbcClientDriverDefaultEngineTest; import org.apache.ignite.internal.processors.query.calcite.jdbc.JdbcCrossEngineTest; import org.apache.ignite.internal.processors.query.calcite.thin.MultiLineQueryTest; import org.apache.ignite.internal.processors.tx.TxWithExceptionalInterceptorTest; @@ -36,6 +37,7 @@ @Suite @SelectClasses({ JdbcCrossEngineTest.class, + JdbcClientDriverDefaultEngineTest.class, MultiLineQueryTest.class, TimeoutIntegrationTest.class, TxWithExceptionalInterceptorTest.class, diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcBatchUpdateTask.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcBatchUpdateTask.java index d3a1ce3cb45f8..6c4f345cb2c8f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcBatchUpdateTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcBatchUpdateTask.java @@ -27,8 +27,8 @@ import org.apache.ignite.IgniteLogger; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.IgniteKernal; -import org.apache.ignite.internal.processors.cache.QueryCursorImpl; import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode; +import org.apache.ignite.internal.processors.cache.query.QueryCursorEx; import org.apache.ignite.internal.processors.cache.query.SqlFieldsQueryEx; import org.apache.ignite.internal.processors.query.IgniteSQLException; import org.apache.ignite.internal.util.typedef.F; @@ -174,7 +174,7 @@ private Integer doSingleUpdate(IgniteCache cache, String sqlText, List> qryCursor = (QueryCursorImpl>)cache.withKeepBinary().query(qry); + QueryCursorEx> qryCursor = (QueryCursorEx>)cache.withKeepBinary().query(qry); if (qryCursor.isQuery()) { throw createJdbcSqlException(getError("Query produced result set", qry), diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsTask.java index 9b0ae1935d5da..975d31d50b03b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryMultipleStatementsTask.java @@ -29,7 +29,7 @@ import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.GridKernalContext; import org.apache.ignite.internal.IgniteKernal; -import org.apache.ignite.internal.processors.cache.QueryCursorImpl; +import org.apache.ignite.internal.processors.cache.query.QueryCursorEx; import org.apache.ignite.internal.processors.cache.query.SqlFieldsQueryEx; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.S; @@ -136,7 +136,7 @@ public JdbcQueryMultipleStatementsTask(Ignite ignite, String schemaName, String throw new SQLException("COPY command is currently supported only in thin JDBC driver."); } - QueryCursorImpl> cur = (QueryCursorImpl>)cur0; + QueryCursorEx> cur = (QueryCursorEx>)cur0; long updCnt = -1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTask.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTask.java index 773976bc74edf..9493e31039ce2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTask.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcQueryTask.java @@ -36,7 +36,7 @@ import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.IgniteKernal; -import org.apache.ignite.internal.processors.cache.QueryCursorImpl; +import org.apache.ignite.internal.processors.cache.query.QueryCursorEx; import org.apache.ignite.internal.processors.cache.query.SqlFieldsQueryEx; import org.apache.ignite.internal.processors.query.GridQueryFieldMetadata; import org.apache.ignite.internal.util.typedef.CAX; @@ -178,7 +178,7 @@ public JdbcQueryTask(Ignite ignite, String cacheName, String schemaName, String throw new SQLException("COPY command is currently supported only in thin JDBC driver."); } - QueryCursorImpl> qryCursor = (QueryCursorImpl>)fldQryCursor; + QueryCursorEx> qryCursor = (QueryCursorEx>)fldQryCursor; if (isQry == null) isQry = qryCursor.isQuery(); @@ -362,8 +362,8 @@ public boolean hasNext() { /** * @return Cursor. */ - public QueryCursorImpl> queryCursor() { - return (QueryCursorImpl>)cursor; + public QueryCursorEx> queryCursor() { + return (QueryCursorEx>)cursor; } } } diff --git a/modules/platforms/dotnet/build.ps1 b/modules/platforms/dotnet/build.ps1 index 7dfbe8b7b4c61..022134baaffdd 100644 --- a/modules/platforms/dotnet/build.ps1 +++ b/modules/platforms/dotnet/build.ps1 @@ -84,7 +84,7 @@ param ( [ValidateSet("Release", "Debug")] [string]$configuration="Release", [string]$mavenOpts="-U -P-lgpl,-scala,-spark-2.4,-examples,-test,-benchmarks -Dmaven.javadoc.skip=true", - [string]$jarDirs="modules\indexing\target,modules\core\target,modules\spring\target", + [string]$jarDirs="modules\indexing\target,modules\core\target,modules\spring\target,modules\calcite\target", [string]$version="", [string]$versionSuffix="" ) @@ -172,11 +172,18 @@ $libsDir = "$PSScriptRoot\bin\libs" Make-Dir($libsDir) Get-ChildItem $jarDirs.Split(',') *.jar -recurse ` - -include "ignite-core*","ignite-indexing*","ignite-spring*","lucene*","h2*","cache-api*","commons-*","spring*" ` + -include "ignite-core*","ignite-indexing*","ignite-spring*","ignite-calcite*","lucene*","h2*","cache-api*","commons-*","spring*" ` -exclude "*-sources*","*-javadoc*","*-tests*" ` | ? { $_.FullName -inotmatch '[\\/]optional[\\/]' } ` | % { Copy-Item -Force $_ $libsDir } +# Dependencies of the Calcite SQL engine (the same set as libs\ignite-calcite in the binary distribution). +$calciteLibsDir = "modules\calcite\target\libs" + +if ([IO.Directory]::Exists($calciteLibsDir)) { + Get-ChildItem $calciteLibsDir *.jar | % { Copy-Item -Force $_ $libsDir } +} + # Restore directory cd $PSScriptRoot From 080b4e0b9b44bee1c93243102eb05f6f4416d81f Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 15 Oct 2026 12:43:19 +0300 Subject: [PATCH 05/14] IGNITE-29117 Both engines must be available. Calcite default. --- .../query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java index 8f166685d3cf3..c26a2bff6c40a 100644 --- a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java +++ b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java @@ -35,7 +35,7 @@ import org.junit.jupiter.params.provider.ValueSource; /** Checks that the JDBC Client Driver ({@code jdbc:ignite:cfg://}) works with any default SQL engine of the client node it starts. */ -@ParameterizedClass(name = "Engine={0}") +@ParameterizedClass(name = "engine={0}") @ValueSource(strings = {IndexingQueryEngineConfiguration.ENGINE_NAME, CalciteQueryEngineConfiguration.ENGINE_NAME}) public class JdbcClientDriverDefaultEngineTest extends AbstractJdbcTest { /** Directory with the Spring XML configurations of the client node started by the driver. */ From ec8bed505eca63e7d8be63eb275293f99d05b284 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 15 Oct 2026 14:30:14 +0300 Subject: [PATCH 06/14] IGNITE-29117 Both engines must be available. Calcite default. --- ...Apache.Ignite.Core.Tests.DotNetCore.csproj | 1 + .../Apache.Ignite.Core.Tests.csproj | 1 + .../Cache/Query/Linq/CacheLinqTest.Base.cs | 5 ++- .../Config/query-engine-h2-default.xml | 43 +++++++++++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/query-engine-h2-default.xml diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.DotNetCore.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.DotNetCore.csproj index 99fd2689f5e60..627e0814de71f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.DotNetCore.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.DotNetCore.csproj @@ -58,6 +58,7 @@ + diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj index 7f2df3da76b78..6fe497fefb577 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj @@ -78,6 +78,7 @@ + diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Base.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Base.cs index 209184505b5dc..0f10183b6fb08 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Base.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Base.cs @@ -28,6 +28,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Linq { using System; using System.Collections; + using System.IO; using System.Linq; using System.Linq.Expressions; using System.Threading; @@ -131,7 +132,9 @@ private IgniteConfiguration GetConfig(string gridName = null) { NameMapper = GetNameMapper() }, - IgniteInstanceName = gridName + IgniteInstanceName = gridName, + // LINQ provider generates SQL in the H2 dialect: run the tests on the H2 engine. + SpringConfigUrl = Path.Combine("Config", "query-engine-h2-default.xml") }; } diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/query-engine-h2-default.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/query-engine-h2-default.xml new file mode 100644 index 0000000000000..4658325642b31 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/query-engine-h2-default.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + From 882750a6d6a378cf6149d86b831ed1690adcd093 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 15 Oct 2026 14:47:05 +0300 Subject: [PATCH 07/14] IGNITE-29117 Both engines must be available. Calcite default. --- .../cpp/core-test/src/cache_query_schema_test.cpp | 8 ++++---- modules/platforms/cpp/core/src/ignition.cpp | 2 ++ .../dotnet/Apache.Ignite.Core/Impl/Unmanaged/Jni/Jvm.cs | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/platforms/cpp/core-test/src/cache_query_schema_test.cpp b/modules/platforms/cpp/core-test/src/cache_query_schema_test.cpp index b7964645160ca..764c736464e8b 100644 --- a/modules/platforms/cpp/core-test/src/cache_query_schema_test.cpp +++ b/modules/platforms/cpp/core-test/src/cache_query_schema_test.cpp @@ -275,10 +275,10 @@ BOOST_AUTO_TEST_CASE(TestBasicOpsDiffSchemas) Sql("SELECT * FROM " + Q_SCHEMA_NAME_3 + '.' + TABLE_NAME); Sql("SELECT * FROM " + SCHEMA_NAME_4 + '.' + TABLE_NAME); - Sql("SELECT * FROM " + SCHEMA_NAME_1 + '.' + TABLE_NAME - + " JOIN " + SCHEMA_NAME_2 + '.' + TABLE_NAME - + " JOIN " + Q_SCHEMA_NAME_3 + '.' + TABLE_NAME - + " JOIN " + SCHEMA_NAME_4 + '.' + TABLE_NAME); + Sql("SELECT * FROM " + SCHEMA_NAME_1 + '.' + TABLE_NAME + " t1" + + " JOIN " + SCHEMA_NAME_2 + '.' + TABLE_NAME + " t2 ON t1.s1_key = t2.s2_key" + + " JOIN " + Q_SCHEMA_NAME_3 + '.' + TABLE_NAME + " t3 ON t2.s2_key = t3.s3_key" + + " JOIN " + SCHEMA_NAME_4 + '.' + TABLE_NAME + " t4 ON t3.s3_key = t4.s4_key"); QueryFieldsCursor cursor = Sql("SELECT SCHEMA_NAME, KEY_ALIAS FROM SYS.TABLES ORDER BY SCHEMA_NAME"); diff --git a/modules/platforms/cpp/core/src/ignition.cpp b/modules/platforms/cpp/core/src/ignition.cpp index 40e3b7ffa4d45..367b290f19682 100644 --- a/modules/platforms/cpp/core/src/ignition.cpp +++ b/modules/platforms/cpp/core/src/ignition.cpp @@ -171,6 +171,8 @@ namespace ignite opts.push_back(CopyChars("--add-opens=java.base/java.lang.invoke=ALL-UNNAMED")); opts.push_back(CopyChars("--add-opens=java.base/java.math=ALL-UNNAMED")); opts.push_back(CopyChars("--add-opens=java.sql/java.sql=ALL-UNNAMED")); + opts.push_back(CopyChars("--add-opens=java.base/java.time=ALL-UNNAMED")); + opts.push_back(CopyChars("--add-opens=java.base/java.text=ALL-UNNAMED")); opts.push_back(CopyChars("--add-opens=java.logging/java.util.logging=ALL-UNNAMED")); } } diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/Jni/Jvm.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/Jni/Jvm.cs index ac9c52404f2e6..9246f3ce336bd 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/Jni/Jvm.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/Jni/Jvm.cs @@ -70,6 +70,8 @@ internal sealed unsafe partial class Jvm "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED", "--add-opens=java.base/java.math=ALL-UNNAMED", "--add-opens=java.sql/java.sql=ALL-UNNAMED", + "--add-opens=java.base/java.time=ALL-UNNAMED", + "--add-opens=java.base/java.text=ALL-UNNAMED", "--add-opens=java.logging/java.util.logging=ALL-UNNAMED" }; From bb2e17b50fefe06fc7300cd99837511292ebad9c Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 15 Oct 2026 16:29:20 +0300 Subject: [PATCH 08/14] IGNITE-29117 Both engines must be available. Calcite default. --- .../Binary/Serializable/SqlDmlTest.cs | 4 +++- .../Cache/CacheQueryMetricsTest.cs | 6 +++++- .../Cache/Query/CacheDmlQueriesTest.cs | 4 +++- .../Cache/Query/CacheDmlQueriesTestSchema.cs | 4 +++- .../Client/Cache/SqlQueryTestBase.cs | 13 +++++++++++++ .../Config/cache-query-continuous.xml | 14 ++++++++++++++ .../Config/cache-query.xml | 14 ++++++++++++++ 7 files changed, 55 insertions(+), 4 deletions(-) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs index b368d811d5aa3..800051353ec52 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Binary/Serializable/SqlDmlTest.cs @@ -21,6 +21,7 @@ namespace Apache.Ignite.Core.Tests.Binary.Serializable { using System; + using System.IO; using System.Linq; using System.Runtime.Serialization; using System.Threading; @@ -52,7 +53,8 @@ public void FixtureSetUp() { NameMapper = new BinaryBasicNameMapper {IsSimpleName = true} }, - Logger = new ListLogger(new TestUtils.TestContextLogger()) {EnabledLevels = new[] {LogLevel.Warn}} + Logger = new ListLogger(new TestUtils.TestContextLogger()) {EnabledLevels = new[] {LogLevel.Warn}}, + SpringConfigUrl = Path.Combine("Config", "query-engine-h2-default.xml") }; _ignite = Ignition.Start(cfg); diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheQueryMetricsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheQueryMetricsTest.cs index 70eba6f0d067c..63cf94f12e8f7 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheQueryMetricsTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheQueryMetricsTest.cs @@ -20,6 +20,7 @@ namespace Apache.Ignite.Core.Tests.Cache { using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; + using System.IO; using System.Linq; using Apache.Ignite.Core.Cache; using Apache.Ignite.Core.Cache.Configuration; @@ -39,7 +40,10 @@ public class CacheQueryMetricsTest [TestFixtureSetUp] public void FixtureSetUp() { - Ignition.Start(TestUtils.GetTestConfiguration()); + Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration()) + { + SpringConfigUrl = Path.Combine("Config", "query-engine-h2-default.xml") + }); } ///

diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheDmlQueriesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheDmlQueriesTest.cs index b9a5798b5e159..16a7326a878eb 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheDmlQueriesTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheDmlQueriesTest.cs @@ -20,6 +20,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query { using System; + using System.IO; using System.Linq; using Apache.Ignite.Core.Binary; using Apache.Ignite.Core.Cache.Configuration; @@ -44,7 +45,8 @@ public void FixtureSetUp() BinaryConfiguration = new BinaryConfiguration(typeof(Foo), typeof(Key), typeof(Key2), typeof(KeyAll)) { NameMapper = GetNameMapper() - } + }, + SpringConfigUrl = Path.Combine("Config", "query-engine-h2-default.xml") }; Ignition.Start(cfg); diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheDmlQueriesTestSchema.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheDmlQueriesTestSchema.cs index f0f5611620910..371c1a99d74d2 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheDmlQueriesTestSchema.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheDmlQueriesTestSchema.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query { using System; using System.Collections.Generic; + using System.IO; using System.Linq; using Apache.Ignite.Core.Cache.Query; using Apache.Ignite.Core.Common; @@ -53,7 +54,8 @@ public void FixtureSetUp() SchemaName2, QSchemaName4, SchemaName4 - } + }, + SpringConfigUrl = Path.Combine("Config", "query-engine-h2-default.xml") }; Ignition.Start(cfg); diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTestBase.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTestBase.cs index 7efcb9c4a0687..51b0107417080 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTestBase.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTestBase.cs @@ -17,6 +17,7 @@ namespace Apache.Ignite.Core.Tests.Client.Cache { + using System.IO; using System.Linq; using Apache.Ignite.Core.Cache.Configuration; @@ -52,6 +53,18 @@ public override void TestSetUp() InitCache(CacheName2); } + /** */ + protected override IgniteConfiguration GetIgniteConfiguration() + { + var cfg = base.GetIgniteConfiguration(); + + // The tests check the H2 semantics of the distributed joins flag, and the LINQ provider generates SQL + // in the H2 dialect: run the server nodes on the H2 engine. + cfg.SpringConfigUrl = Path.Combine("Config", "query-engine-h2-default.xml"); + + return cfg; + } + /// /// Initializes the cache. /// diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml index 903091aaa940e..abed2f08d396e 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml @@ -29,6 +29,20 @@ + + + + + + + + + + + + + + diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml index 87e65a23ee596..a9251409c918d 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml @@ -47,6 +47,20 @@ + + + + + + + + + + + + + + From 3a8d3074ad7853316e209b4afb293080a2002409 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 15 Oct 2026 16:45:28 +0300 Subject: [PATCH 09/14] IGNITE-29117 Both engines must be available. Calcite default. --- .../core-test/config/cache-identity-default.xml | 14 ++++++++++++++ .../config/cache-query-schema-default.xml | 14 ++++++++++++++ .../cpp/core-test/src/cache_query_schema_test.cpp | 8 ++++---- .../odbc-test/config/queries-schema-default.xml | 14 ++++++++++++++ .../config/sql-query-fields-default.xml | 14 ++++++++++++++ 5 files changed, 60 insertions(+), 4 deletions(-) diff --git a/modules/platforms/cpp/core-test/config/cache-identity-default.xml b/modules/platforms/cpp/core-test/config/cache-identity-default.xml index a73d0bbd3928a..848896cd2939f 100644 --- a/modules/platforms/cpp/core-test/config/cache-identity-default.xml +++ b/modules/platforms/cpp/core-test/config/cache-identity-default.xml @@ -29,6 +29,20 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> + + + + + + + + + + + + + + diff --git a/modules/platforms/cpp/core-test/config/cache-query-schema-default.xml b/modules/platforms/cpp/core-test/config/cache-query-schema-default.xml index 84c12e12331df..fe70b72eb68b6 100644 --- a/modules/platforms/cpp/core-test/config/cache-query-schema-default.xml +++ b/modules/platforms/cpp/core-test/config/cache-query-schema-default.xml @@ -29,6 +29,20 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> + + + + + + + + + + + + + + diff --git a/modules/platforms/cpp/core-test/src/cache_query_schema_test.cpp b/modules/platforms/cpp/core-test/src/cache_query_schema_test.cpp index 764c736464e8b..b7964645160ca 100644 --- a/modules/platforms/cpp/core-test/src/cache_query_schema_test.cpp +++ b/modules/platforms/cpp/core-test/src/cache_query_schema_test.cpp @@ -275,10 +275,10 @@ BOOST_AUTO_TEST_CASE(TestBasicOpsDiffSchemas) Sql("SELECT * FROM " + Q_SCHEMA_NAME_3 + '.' + TABLE_NAME); Sql("SELECT * FROM " + SCHEMA_NAME_4 + '.' + TABLE_NAME); - Sql("SELECT * FROM " + SCHEMA_NAME_1 + '.' + TABLE_NAME + " t1" - + " JOIN " + SCHEMA_NAME_2 + '.' + TABLE_NAME + " t2 ON t1.s1_key = t2.s2_key" - + " JOIN " + Q_SCHEMA_NAME_3 + '.' + TABLE_NAME + " t3 ON t2.s2_key = t3.s3_key" - + " JOIN " + SCHEMA_NAME_4 + '.' + TABLE_NAME + " t4 ON t3.s3_key = t4.s4_key"); + Sql("SELECT * FROM " + SCHEMA_NAME_1 + '.' + TABLE_NAME + + " JOIN " + SCHEMA_NAME_2 + '.' + TABLE_NAME + + " JOIN " + Q_SCHEMA_NAME_3 + '.' + TABLE_NAME + + " JOIN " + SCHEMA_NAME_4 + '.' + TABLE_NAME); QueryFieldsCursor cursor = Sql("SELECT SCHEMA_NAME, KEY_ALIAS FROM SYS.TABLES ORDER BY SCHEMA_NAME"); diff --git a/modules/platforms/cpp/odbc-test/config/queries-schema-default.xml b/modules/platforms/cpp/odbc-test/config/queries-schema-default.xml index bcdaec578c578..ff291af6e84a0 100644 --- a/modules/platforms/cpp/odbc-test/config/queries-schema-default.xml +++ b/modules/platforms/cpp/odbc-test/config/queries-schema-default.xml @@ -29,6 +29,20 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> + + + + + + + + + + + + + + diff --git a/modules/platforms/cpp/thin-client-test/config/sql-query-fields-default.xml b/modules/platforms/cpp/thin-client-test/config/sql-query-fields-default.xml index 5a2c6abd0a100..25bd492838405 100644 --- a/modules/platforms/cpp/thin-client-test/config/sql-query-fields-default.xml +++ b/modules/platforms/cpp/thin-client-test/config/sql-query-fields-default.xml @@ -29,6 +29,20 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> + + + + + + + + + + + + + + From 33f34b988e6b1561a5ae87991cb2af2771e6aa3d Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 15 Oct 2026 18:03:32 +0300 Subject: [PATCH 10/14] IGNITE-29117 Both engines must be available. Calcite default. --- .../src/test/config/jdbc-client-driver-calcite.xml | 4 ---- .../calcite-testing/src/test/config/jdbc-client-driver-h2.xml | 3 --- .../platforms/cpp/core-test/config/cache-identity-default.xml | 1 - .../cpp/core-test/config/cache-query-schema-default.xml | 1 - .../platforms/cpp/odbc-test/config/queries-schema-default.xml | 1 - .../cpp/thin-client-test/config/sql-query-fields-default.xml | 1 - .../Cache/Query/Linq/CacheLinqTest.Base.cs | 1 - .../Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTestBase.cs | 2 -- .../Config/cache-query-continuous.xml | 1 - .../dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml | 1 - .../Config/query-engine-h2-default.xml | 4 ---- 11 files changed, 20 deletions(-) diff --git a/modules/calcite-testing/src/test/config/jdbc-client-driver-calcite.xml b/modules/calcite-testing/src/test/config/jdbc-client-driver-calcite.xml index fa8c77493d0dd..64f8a2074f595 100644 --- a/modules/calcite-testing/src/test/config/jdbc-client-driver-calcite.xml +++ b/modules/calcite-testing/src/test/config/jdbc-client-driver-calcite.xml @@ -17,10 +17,6 @@ limitations under the License. --> - - diff --git a/modules/platforms/cpp/core-test/config/cache-query-schema-default.xml b/modules/platforms/cpp/core-test/config/cache-query-schema-default.xml index fe70b72eb68b6..724130bb70437 100644 --- a/modules/platforms/cpp/core-test/config/cache-query-schema-default.xml +++ b/modules/platforms/cpp/core-test/config/cache-query-schema-default.xml @@ -29,7 +29,6 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> - diff --git a/modules/platforms/cpp/odbc-test/config/queries-schema-default.xml b/modules/platforms/cpp/odbc-test/config/queries-schema-default.xml index ff291af6e84a0..4f09b1ffc64cd 100644 --- a/modules/platforms/cpp/odbc-test/config/queries-schema-default.xml +++ b/modules/platforms/cpp/odbc-test/config/queries-schema-default.xml @@ -29,7 +29,6 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> - diff --git a/modules/platforms/cpp/thin-client-test/config/sql-query-fields-default.xml b/modules/platforms/cpp/thin-client-test/config/sql-query-fields-default.xml index 25bd492838405..72d39a9571f3d 100644 --- a/modules/platforms/cpp/thin-client-test/config/sql-query-fields-default.xml +++ b/modules/platforms/cpp/thin-client-test/config/sql-query-fields-default.xml @@ -29,7 +29,6 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> - diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Base.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Base.cs index 0f10183b6fb08..dc84f6449c282 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Base.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Base.cs @@ -133,7 +133,6 @@ private IgniteConfiguration GetConfig(string gridName = null) NameMapper = GetNameMapper() }, IgniteInstanceName = gridName, - // LINQ provider generates SQL in the H2 dialect: run the tests on the H2 engine. SpringConfigUrl = Path.Combine("Config", "query-engine-h2-default.xml") }; } diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTestBase.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTestBase.cs index 51b0107417080..db65247c309bc 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTestBase.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/SqlQueryTestBase.cs @@ -58,8 +58,6 @@ protected override IgniteConfiguration GetIgniteConfiguration() { var cfg = base.GetIgniteConfiguration(); - // The tests check the H2 semantics of the distributed joins flag, and the LINQ provider generates SQL - // in the H2 dialect: run the server nodes on the H2 engine. cfg.SpringConfigUrl = Path.Combine("Config", "query-engine-h2-default.xml"); return cfg; diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml index abed2f08d396e..1527e000765af 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query-continuous.xml @@ -29,7 +29,6 @@ - diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml index a9251409c918d..3968319786170 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/cache-query.xml @@ -47,7 +47,6 @@ - diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/query-engine-h2-default.xml b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/query-engine-h2-default.xml index 4658325642b31..3dbe305fc8357 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/query-engine-h2-default.xml +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/query-engine-h2-default.xml @@ -17,10 +17,6 @@ limitations under the License. --> - + + + + + + + + + + + + + diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ThickExamplesExternalNodeTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ThickExamplesExternalNodeTest.cs index 1cb23c2cf8424..dd12897664429 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ThickExamplesExternalNodeTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ThickExamplesExternalNodeTest.cs @@ -17,6 +17,7 @@ namespace Apache.Ignite.Core.Tests.Examples { + using System.IO; using System.Linq; using NUnit.Framework; @@ -37,7 +38,10 @@ public class ThickExamplesExternalNodeTest : ExamplesTestBase [TestFixtureSetUp] public void FixtureSetUp() { - Ignition.Start(TestUtils.GetTestConfiguration(name: "server")); + Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration(name: "server")) + { + SpringConfigUrl = Path.Combine("Config", "query-engine-h2-default.xml") + }); } /// diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ThinExamplesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ThinExamplesTest.cs index b9cd45092377c..3642425921b52 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ThinExamplesTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Examples/ThinExamplesTest.cs @@ -17,6 +17,7 @@ namespace Apache.Ignite.Core.Tests.Examples { + using System.IO; using System.Linq; using System.Reflection; using NUnit.Framework; @@ -57,7 +58,10 @@ public void FixtureSetUp() { for (int i = 0; i < _serverCount; i++) { - Ignition.Start(TestUtils.GetTestConfiguration(name: i.ToString())); + Ignition.Start(new IgniteConfiguration(TestUtils.GetTestConfiguration(name: i.ToString())) + { + SpringConfigUrl = Path.Combine("Config", "query-engine-h2-default.xml") + }); } // Init default services. diff --git a/modules/platforms/dotnet/examples/Shared/Shared.csproj b/modules/platforms/dotnet/examples/Shared/Shared.csproj index 1dda71ff5f62e..aabf07103ef0c 100644 --- a/modules/platforms/dotnet/examples/Shared/Shared.csproj +++ b/modules/platforms/dotnet/examples/Shared/Shared.csproj @@ -6,6 +6,10 @@ CS0649 + + + + diff --git a/modules/platforms/dotnet/examples/Shared/Utils.cs b/modules/platforms/dotnet/examples/Shared/Utils.cs index cae754b47d3e1..dba28334ea1f1 100644 --- a/modules/platforms/dotnet/examples/Shared/Utils.cs +++ b/modules/platforms/dotnet/examples/Shared/Utils.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Examples.Shared { using System; using System.Collections.Generic; + using System.IO; using Apache.Ignite.Core; using Apache.Ignite.Core.Cache; using Apache.Ignite.Core.Client; @@ -54,6 +55,7 @@ public static IgniteConfiguration GetServerNodeConfiguration() // * Logging options reduce console output return new IgniteConfiguration { + SpringConfigUrl = Path.Combine(Path.GetDirectoryName(typeof(Utils).Assembly.Location), "ignite-config.xml"), Localhost = "127.0.0.1", DiscoverySpi = new TcpDiscoverySpi { diff --git a/modules/platforms/dotnet/examples/Shared/ignite-config.xml b/modules/platforms/dotnet/examples/Shared/ignite-config.xml new file mode 100644 index 0000000000000..6abef02eb613c --- /dev/null +++ b/modules/platforms/dotnet/examples/Shared/ignite-config.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + From 5ae573334c2e24ec0524b5b83fdc8eabcb3d2938 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Thu, 15 Oct 2026 19:18:50 +0300 Subject: [PATCH 12/14] IGNITE-29117 Both engines must be available. Calcite default. --- .../examples/odbc-example/config/example-odbc.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/platforms/cpp/examples/odbc-example/config/example-odbc.xml b/modules/platforms/cpp/examples/odbc-example/config/example-odbc.xml index d170d6b68ee28..244fc511f6f65 100644 --- a/modules/platforms/cpp/examples/odbc-example/config/example-odbc.xml +++ b/modules/platforms/cpp/examples/odbc-example/config/example-odbc.xml @@ -26,6 +26,19 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> + + + + + + + + + + + + + From 370cd9358a56b7ff1cc5572e096a8cd454277d45 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 16 Oct 2026 10:47:23 +0300 Subject: [PATCH 13/14] IGNITE-29117 Both engines must be available. Calcite default. --- .../QueryEngineConfigurationIntegrationTest.java | 6 +++--- .../calcite/jdbc/JdbcClientDriverDefaultEngineTest.java | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java index 24cb8f4d2b1f9..2ba8c0a118b92 100644 --- a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java +++ b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java @@ -49,7 +49,7 @@ public class QueryEngineConfigurationIntegrationTest extends GridCommonAbstractW private static final String INDEXING_ENGINE = IndexingQueryEngineConfiguration.ENGINE_NAME; /** */ - private static final String CALCITE_ENGINE = CalciteQueryEngineConfiguration.ENGINE_NAME; + public static final String CALCITE_ENGINE = CalciteQueryEngineConfiguration.ENGINE_NAME; /** */ @Test @@ -229,7 +229,7 @@ private void checkDefaultEngine(String engineName, QueryEngineConfiguration... e } /** */ - private void checkEngine(IgniteCache cache, String engineName, String sql) throws Exception { + public static void checkEngine(IgniteCache cache, String engineName, String sql) throws Exception { // Check by cache API. List> res = cache.query(new SqlFieldsQuery(sql)).getAll(); @@ -242,7 +242,7 @@ private void checkEngine(IgniteCache cache, String engineName, String sql) } /** */ - private void checkJdbcEngine(String engineName, String url, String sql) throws Exception { + private static void checkJdbcEngine(String engineName, String url, String sql) throws Exception { try (Connection conn = DriverManager.getConnection(url)) { conn.setSchema("PUBLIC"); try (Statement stmt = conn.createStatement()) { diff --git a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java index c26a2bff6c40a..838d4d4993ada 100644 --- a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java +++ b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java @@ -34,6 +34,8 @@ import org.junit.jupiter.params.ParameterizedClass; import org.junit.jupiter.params.provider.ValueSource; +import static org.apache.ignite.internal.processors.query.calcite.integration.QueryEngineConfigurationIntegrationTest.checkEngine; + /** Checks that the JDBC Client Driver ({@code jdbc:ignite:cfg://}) works with any default SQL engine of the client node it starts. */ @ParameterizedClass(name = "engine={0}") @ValueSource(strings = {IndexingQueryEngineConfiguration.ENGINE_NAME, CalciteQueryEngineConfiguration.ENGINE_NAME}) @@ -85,6 +87,8 @@ public class JdbcClientDriverDefaultEngineTest extends AbstractJdbcTest { /** */ @Test public void testSelect() throws Exception { + checkEngine(grid(0).getOrCreateCache(DEFAULT_CACHE_NAME), dfltEngine, "SELECT QUERY_ENGINE()"); + List> res = executeQuery(conn, "SELECT id, val FROM test ORDER BY id"); assertEquals(2, res.size()); From e1f025347cee22f8063a29d2885c76e4d05b6d63 Mon Sep 17 00:00:00 2001 From: Nikolay Izhikov Date: Fri, 16 Oct 2026 11:11:00 +0300 Subject: [PATCH 14/14] IGNITE-29117 Both engines must be available. Calcite default. --- .../QueryEngineConfigurationIntegrationTest.java | 6 +++--- .../jdbc/JdbcClientDriverDefaultEngineTest.java | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java index 2ba8c0a118b92..24cb8f4d2b1f9 100644 --- a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java +++ b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/QueryEngineConfigurationIntegrationTest.java @@ -49,7 +49,7 @@ public class QueryEngineConfigurationIntegrationTest extends GridCommonAbstractW private static final String INDEXING_ENGINE = IndexingQueryEngineConfiguration.ENGINE_NAME; /** */ - public static final String CALCITE_ENGINE = CalciteQueryEngineConfiguration.ENGINE_NAME; + private static final String CALCITE_ENGINE = CalciteQueryEngineConfiguration.ENGINE_NAME; /** */ @Test @@ -229,7 +229,7 @@ private void checkDefaultEngine(String engineName, QueryEngineConfiguration... e } /** */ - public static void checkEngine(IgniteCache cache, String engineName, String sql) throws Exception { + private void checkEngine(IgniteCache cache, String engineName, String sql) throws Exception { // Check by cache API. List> res = cache.query(new SqlFieldsQuery(sql)).getAll(); @@ -242,7 +242,7 @@ public static void checkEngine(IgniteCache cache, String engineName, Strin } /** */ - private static void checkJdbcEngine(String engineName, String url, String sql) throws Exception { + private void checkJdbcEngine(String engineName, String url, String sql) throws Exception { try (Connection conn = DriverManager.getConnection(url)) { conn.setSchema("PUBLIC"); try (Statement stmt = conn.createStatement()) { diff --git a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java index 838d4d4993ada..e9af8fd7941e7 100644 --- a/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java +++ b/modules/calcite-testing/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcClientDriverDefaultEngineTest.java @@ -19,6 +19,7 @@ import java.sql.Connection; import java.sql.DriverManager; +import java.sql.SQLException; import java.sql.Statement; import java.util.List; import org.apache.ignite.cache.query.SqlFieldsQuery; @@ -34,8 +35,6 @@ import org.junit.jupiter.params.ParameterizedClass; import org.junit.jupiter.params.provider.ValueSource; -import static org.apache.ignite.internal.processors.query.calcite.integration.QueryEngineConfigurationIntegrationTest.checkEngine; - /** Checks that the JDBC Client Driver ({@code jdbc:ignite:cfg://}) works with any default SQL engine of the client node it starts. */ @ParameterizedClass(name = "engine={0}") @ValueSource(strings = {IndexingQueryEngineConfiguration.ENGINE_NAME, CalciteQueryEngineConfiguration.ENGINE_NAME}) @@ -87,7 +86,7 @@ public class JdbcClientDriverDefaultEngineTest extends AbstractJdbcTest { /** */ @Test public void testSelect() throws Exception { - checkEngine(grid(0).getOrCreateCache(DEFAULT_CACHE_NAME), dfltEngine, "SELECT QUERY_ENGINE()"); + checkEngine(); List> res = executeQuery(conn, "SELECT id, val FROM test ORDER BY id"); @@ -112,4 +111,12 @@ public void testDml() throws Exception { private List> serverSql(String sql) { return grid(0).context().query().querySqlFields(new SqlFieldsQuery(sql), false).getAll(); } + + /** */ + private void checkEngine() throws SQLException { + List> res = executeQuery(conn, "SELECT QUERY_ENGINE()"); + + assertEquals(1, res.size()); + assertEquals(dfltEngine, res.get(0).get(0)); + } }