Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3244

RelDecorrelator unable to decorrelate expression with filter and aggregate on top

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 1.20.0
    • None
    • None

    Description

      Some very useful type of requests currently failed with:

      SYSTEM ERROR: UnsupportedOperationException: Adding Implicit RowID column is not supported for ValuesPrel operator 
      

      Examples from DRILL-7050:

      select t1.id,
           (select count(t2.id) 
           from (
               select 1 as id 
               union all 
               select 2 as id
           ) t2 where t2.id = t1.id)
       from (
           select 1 as id 
           union all 
           select 2 as id
       ) t1
      
      SELECT t,
      (SELECT count(*) FROM
       (SELECT split(r,' ') AS r FROM
        (SELECT sub.t AS r)) AS x
       ,LATERAL(SELECT $unnest AS u FROM unnest(x.r))
       /* WHERE ... */) t2
      FROM
      (SELECT 'unnest is useful' AS t) sub
      

       

      Please note that in 1.18 the error for these requests was:

      Error: PLAN ERROR: Cannot convert RexNode to equivalent Drill expression. RexNode Class: org.apache.calcite.rex.RexCorrelVariable, RexNode Digest: $cor0
      

      Attachments

        Issue Links

          Activity

            People

              danny0405 Danny Chen
              benj641 benj
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

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