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

Calcite. Unable to plan query with several correlated sub-queries in select list

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • sql

    Description

      Currently the query like below can't be planned by calcite-based sql engine:

      SELECT a+b*2,
             (a+b+c+d+e)/5,
             (SELECT count(*) FROM t1 AS x WHERE x.c>t1.c AND x.d<t1.d),
             (SELECT count(*) FROM t1 AS x WHERE x.b<t1.b),
             abs(b-c),
             a-b
        FROM t1
       WHERE EXISTS(SELECT 1 FROM t1 AS x WHERE x.b<t1.b)
         AND c>d
       ORDER BY 6,5,4,1,3,2
      

      Need to figure it out how to fix this.

      Attachments

        Issue Links

          Activity

            People

              zstan Evgeny Stanilovsky
              korlov Konstantin Orlov
              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 - 1h 40m
                  1h 40m