[ 
https://issues.apache.org/jira/browse/IGNITE-29117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18124888#comment-18124888
 ] 

Nikolay Izhikov edited comment on IGNITE-29117 at 10/8/26 8:10 AM:
-------------------------------------------------------------------

While preparing this change I checked whether the Calcite module has tests for 
a node started *without* {{ignite-indexing}} on the classpath. It does not, so 
I wrote one: [^CalciteOnlyNodeIntegrationTest.java] (full patch incl. the Maven 
profile and suite registration: [^IGNITE-29117-calcite-only-tests.patch]).

The test starts a plain node with only {{ignite-calcite}} present and exercises 
the public SQL entry points. Since the kernel detects H2 with 
{{Class.forName}}, the only way to simulate its absence is to drop the jars 
from the surefire classpath, hence the new {{calcite-only}} profile in 
{{modules/calcite/pom.xml}}. On the regular classpath all tests are skipped by 
assumption.

Run command:
{code}
./mvnw test -pl :ignite-calcite -Pcalcite-only,surefire-fork-count-1 \
  -Dtest=CalciteOnlyNodeIntegrationTest -Dsurefire.failIfNoSpecifiedTests=false
{code}

Results on current master (f38a8b0412a), H2 excluded: *Tests run: 8, Failures: 
3, Errors: 4, Skipped: 0*.

||Test||What it checks||Result on master||
|{{testSqlFieldsQuery}}|{{SqlFieldsQuery}} via cache API and thin JDBC: 
{{QUERY_ENGINE()}} is {{calcite}}, {{CREATE TABLE}}, {{INSERT}}, {{SELECT}}, 
{{DROP TABLE}}|(/) pass|
|{{testSqlQuery}}|legacy {{SqlQuery}} via cache API|(x) {{NullPointerException: 
Cannot invoke "GridQueryIndexing.generateFieldsQuery(...)" because "this.idx" 
is null}}|
|{{testThinClientSqlQuery}}|legacy {{SqlQuery}} via thin client|(x) same NPE, 
surfaced to the client as server error 50000|
|{{testTextQuery}}|{{TextQuery}} fails with a message naming 
{{ignite-indexing}}|(x) {{Indexing is disabled.}} - module not named|
|{{testSetStreaming}}|{{SET STREAMING ON}} over thin JDBC fails with a message 
naming {{ignite-indexing}}|(x) {{Failed to parse query. Encountered " "ON" "ON 
""}} (Calcite parser), and then {{Connection.close()}} hangs forever|
|{{testCopy}}|{{COPY FROM ... FORMAT CSV}} over thin JDBC fails with a message 
naming {{ignite-indexing}}|(x) {{Failed to parse query. Non-query expression 
encountered in illegal context}} - module not named|
|{{testJdbcQueryEngineProperty}}|{{jdbc:ignite:thin://...?queryEngine=calcite}} 
without explicit {{SqlConfiguration.queryEnginesConfiguration}}|(x) {{Handshake 
failed ... Not found configuration for query engine: calcite}}|
|{{testQueryEngineHint}}|{{SELECT /\*+ QUERY_ENGINE('calcite') \*/ ...}} 
without explicit engines configuration|(x) {{Query engines not configured, but 
specified engine: calcite}}|

Without the profile (H2 on the classpath): *Tests run: 8, Skipped: 8*. 
Checkstyle and RAT pass for {{:ignite-calcite}}.

One extra finding from {{testSetStreaming}}: a rejected {{SET STREAMING ON}} 
leaves the thin JDBC driver with {{streamState}} set but never started, because 
{{JdbcThinConnection.executeNative}} assigns the state before {{sendRequest}}. 
{{close()}} then goes through {{StreamState.close0() -> executeBatch(true) -> 
lastRespFut.get()}} and blocks forever. It is latent today (with H2 the command 
never fails) but becomes reachable on a Calcite-only node, so it needs a fix as 
part of this work. The test bounds the close with a 10s async wait so it fails 
instead of hitting the 5 minute JUnit timeout.

These tests are intentionally submitted without fixes: they document the 
current gap and should turn green as the H2-only paths are either ported to 
core or rejected with precise errors.


was (Author: nizhikov):
While preparing this change I checked whether the Calcite module has tests for 
a node started *without* \{{ignite-indexing}} on the classpath. It does not, so 
I wrote one: [^CalciteOnlyNodeIntegrationTest.java] (full patch incl. the Maven 
profile and suite registration: [^IGNITE-29117-calcite-only-tests.patch]).

The test starts a plain node with only \{{ignite-calcite}} present and 
exercises the public SQL entry points. Since the kernel detects H2 with 
\{{Class.forName}}, the only way to simulate its absence is to drop the jars 
from the surefire classpath, hence the new \{{calcite-only}} profile in 
\{{modules/calcite/pom.xml}}. On the regular classpath all tests are skipped by 
assumption.

Run command:
{code}
./mvnw test -pl :ignite-calcite -Pcalcite-only,surefire-fork-count-1 \
  -Dtest=CalciteOnlyNodeIntegrationTest -Dsurefire.failIfNoSpecifiedTests=false
{code}

Results on current master (f38a8b0412a), H2 excluded: *Tests run: 8, Failures: 
3, Errors: 4, Skipped: 0*.

||Test||What it checks||Result on master||
|\{{testSqlFieldsQuery}}|\{{SqlFieldsQuery}} via cache API and thin JDBC: 
\{{QUERY_ENGINE()}} is \{{calcite}}, \{{CREATE TABLE}}, \{{INSERT}}, 
\{{SELECT}}, \{{DROP TABLE}}|(/) pass|
|\{{testSqlQuery}}|legacy \{{SqlQuery}} via cache API|(x) 
\{{NullPointerException: Cannot invoke 
"GridQueryIndexing.generateFieldsQuery(...)" because "this.idx" is null}}|
|\{{testThinClientSqlQuery}}|legacy \{{SqlQuery}} via thin client|(x) same NPE, 
surfaced to the client as server error 50000|
|\{{testTextQuery}}|\{{TextQuery}} fails with a message naming 
\{{ignite-indexing}}|(x) \{{Indexing is disabled.}} - module not named|
|\{{testSetStreaming}}|\{{SET STREAMING ON}} over thin JDBC fails with a 
message naming \{{ignite-indexing}}|(x) \{{Failed to parse query. Encountered " 
"ON" "ON ""}} (Calcite parser), and then \{{Connection.close()}} hangs forever|
|\{{testCopy}}|\{{COPY FROM ... FORMAT CSV}} over thin JDBC fails with a 
message naming \{{ignite-indexing}}|(x) \{{Failed to parse query. Non-query 
expression encountered in illegal context}} - module not named|
|\{{testJdbcQueryEngineProperty}}|\{{jdbc:ignite:thin://...?queryEngine=calcite}}
 without explicit \{{SqlConfiguration.queryEnginesConfiguration}}|(x) 
\{{Handshake failed ... Not found configuration for query engine: calcite}}|
|\{{testQueryEngineHint}}|\{{SELECT /\*+ QUERY_ENGINE('calcite') \*/ ...}} 
without explicit engines configuration|(x) \{{Query engines not configured, but 
specified engine: calcite}}|

Without the profile (H2 on the classpath): *Tests run: 8, Skipped: 8*. 
Checkstyle and RAT pass for \{{:ignite-calcite}}.

One extra finding from \{{testSetStreaming}}: a rejected \{{SET STREAMING ON}} 
leaves the thin JDBC driver with \{{streamState}} set but never started, 
because \{{JdbcThinConnection.executeNative}} assigns the state before 
\{{sendRequest}}. \{{close()}} then goes through \{{StreamState.close0() -> 
executeBatch(true) -> lastRespFut.get()}} and blocks forever. It is latent 
today (with H2 the command never fails) but becomes reachable on a Calcite-only 
node, so it needs a fix as part of this work. The test bounds the close with a 
10s async wait so it fails instead of hitting the 5 minute JUnit timeout.

These tests are intentionally submitted without fixes: they document the 
current gap and should turn green as the H2-only paths are either ported to 
core or rejected with precise errors.

> Switch default SQL engine from H2 to Calcite
> --------------------------------------------
>
>                 Key: IGNITE-29117
>                 URL: https://issues.apache.org/jira/browse/IGNITE-29117
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Nikolay Izhikov
>            Assignee: Nikolay Izhikov
>            Priority: Major
>             Fix For: 2.19
>
>
> Calcite based SQL engine are read to become default.
> H2 module must be moved to optional.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to