This is an automated email from the ASF dual-hosted git repository.
alexpl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 74d5d932089 IGNITE-25258 SQL Calcite: Fix assertion on subquery
correlated by two tables (#12111)
74d5d932089 is described below
commit 74d5d932089586495ae49ab8232c52dde0872a6b
Author: Aleksey Plekhanov <[email protected]>
AuthorDate: Tue Jun 17 21:34:19 2025 +0300
IGNITE-25258 SQL Calcite: Fix assertion on subquery correlated by two
tables (#12111)
---
.../processors/query/calcite/CalciteQueryProcessor.java | 5 +++++
.../calcite/integration/CorrelatesIntegrationTest.java | 15 +++++++++++++++
2 files changed, 20 insertions(+)
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessor.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessor.java
index 24e6099e854..da4a02cd857 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessor.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessor.java
@@ -139,6 +139,11 @@ public class CalciteQueryProcessor extends
GridProcessorAdapter implements Query
// org.apache.calcite.config.CalciteSystemProperty is loaded.
System.setProperty("calcite.volcano.dump.graphviz", "false");
System.setProperty("calcite.volcano.dump.sets", "false");
+
+ // TODO Workaround for
https://issues.apache.org/jira/browse/CALCITE-7009
+ // See Apache Calcite ticket for more information, assertion is
incorrect.
+ // FRAMEWORK_CONFIG initialize SqlToRelConverter class. Assertions
should be disabled before class initialization.
+
SqlToRelConverter.class.getClassLoader().setClassAssertionStatus(SqlToRelConverter.class.getName(),
false);
}
/**
diff --git
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/CorrelatesIntegrationTest.java
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/CorrelatesIntegrationTest.java
index 92784fe29a2..47a00cf07b0 100644
---
a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/CorrelatesIntegrationTest.java
+++
b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/CorrelatesIntegrationTest.java
@@ -122,4 +122,19 @@ public class CorrelatesIntegrationTest extends
AbstractBasicIntegrationTransacti
.returns(2, 2L)
.check();
}
+
+ /** */
+ @Test
+ public void testTwoTablesCorrelatedSubquery() {
+ sql("CREATE TABLE T1(ID INT, REF INT) WITH " + atomicity());
+ sql("CREATE TABLE T2(ID INT, REF INT) WITH " + atomicity());
+ sql("CREATE TABLE T3(ID1 INT, ID2 INT) WITH " + atomicity());
+
+ sql("INSERT INTO T1 VALUES(1, 1)");
+ sql("INSERT INTO T2 VALUES(1, 1)");
+ sql("INSERT INTO T3 VALUES(1, 1)");
+
+ assertQuery("SELECT T1.ID, T2.ID FROM T1 JOIN T2 ON (T1.ID = T2.ID) " +
+ "WHERE EXISTS (SELECT 1 FROM T3 WHERE T3.ID1 = T1.REF AND T3.ID2 =
T2.REF)").returns(1, 1).check();
+ }
}