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

Calcite. Failed to plan EXISTS with subquery or nested subqueries.

    XMLWordPrintableJSON

Details

    Description

      statement ok
      CREATE TABLE integers(i INTEGER)
      
      statement ok
      INSERT INTO integers VALUES (1), (2), (3), (NULL)
      
      query IT
      SELECT i, EXISTS(SELECT i FROM integers WHERE i1.i>i OR i1.i IS NULL) FROM integers i1 ORDER BY i NULLS FIRST;
      ----
      NULL	true
      1	false
      2	true
      3	true
      
      statement ok
      CREATE TABLE integers(i INTEGER)
      
      statement ok
      INSERT INTO integers VALUES (1), (2), (3), (NULL)
      
      # nested correlated queries
      query II
      SELECT i, (SELECT (SELECT 42+i1.i)+42+i1.i) AS j FROM integers i1 ORDER BY i;
      ----
      NULL	NULL
      1	86
      2	88
      3	90
      
      [2021-09-24 10:25:41,982][ERROR][test-runner-#132%srv0%][org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImplc{1}] Unexpected error at query optimizer.
      org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There are not enough rules to produce a node with desired properties:
      
      /subquery/exists/test_correlated_exists.test[_ignore]
      /subquery/scalar/test_nested_correlated_subquery.test[_ignore]
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            zstan Evgeny Stanilovsky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: