Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13159

Calcite integration. Decorrelator support SOME and ALL operator.

    XMLWordPrintableJSON

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

          Activity

            People

              zstan Evgeny Stanilovsky
              amashenkov Andrey Mashenkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m