Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
Now Calcite SqlToRelConverter throws an exception if found a subquery in ALL\SOME operator. See SubqueryRewriteRuleTest.testNonAllToSemiAntiJoinRule test and find stack trace below.
We have to either set flag "expand=false" and implement LogicalCorrelate converter
or some rules to overcome the issue.
However, setting flag "expand=false" makes query pass, but with wrong join type (left and inner instead of anti) and moreover it brakes other queries due to weird decorrelator behavior. Possibly there is bug in Calcite.
Caused by: java.lang.RuntimeException: ALL is only supported if expand = falseCaused by: java.lang.RuntimeException: ALL is only supported if expand = false at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:4814) at org.apache.calcite.sql2rel.SqlToRelConverter.convertWhere(SqlToRelConverter.java:1016) at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:662) at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:640) at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3384) at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:566) at org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.rel(IgnitePlanner.java:203) at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.optimize(ExecutionServiceImpl.java:618) at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepareExplain(ExecutionServiceImpl.java:644) at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepareSingle(ExecutionServiceImpl.java:573) at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepare0(ExecutionServiceImpl.java:531) ... 16 more
Attachments
Issue Links
- fixes
-
IGNITE-14537 Calcite engine. Nested arbitrary queries hangs on optimizing
- Resolved
- is caused by
-
IGNITE-12747 Calcite integration. Correlated queries support.
- Open
- is part of
-
IGNITE-12248 Apache Calcite based query execution engine
- Open
- links to