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

If arguments to a table function are correlation variables, SqlToRelConverter should eliminate duplicate variables

    XMLWordPrintableJSON

Details

    Description

      request like:

      select e.deptno, (select * from lateral table(DEDUP(e.deptno, e.deptno))) from emp e;
      

      shows 2 different correlates, while it only one.

      LogicalProject(DEPTNO=[$7], EXPR$1=[$SCALAR_QUERY({
      LogicalProject(NAME=[$0])
        LogicalTableFunctionScan(invocation=[DEDUP($cor0.DEPTNO, $cor1.DEPTNO)], rowType=[RecordType(VARCHAR(1024) NAME)])
      })])
        LogicalTableScan(table=[[CATALOG, SALES, EMP]])
      

      dev-list discussion

      Attachments

        1. code-sample-UDF-in-quidem.patch
          4 kB
          Stamatis Zampetakis

        Issue Links

          Activity

            People

              zstan Evgeny Stanilovsky
              zstan Evgeny Stanilovsky
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 10m
                  1h 10m