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

TableModify of Update contains correlated variable by mistake.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.22.0
    • None

    Description

      UPDATE clause like below

      update emp set empno = empno + 1
      

      will be converted to

      LogicalTableModify(table=[[CATALOG, SALES, EMP]], operation=[UPDATE], updateColumnList=[[EMPNO]], sourceExpressionList=[[+($cor0.EMPNO, 1)]], flattened=[true])
        LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3], HIREDATE=[$4], SAL=[$5], COMM=[$6], DEPTNO=[$7], SLACKER=[$8], EXPR$0=[+($0, 1)])
          LogicalTableScan(table=[[CATALOG, SALES, EMP]])
      

      However the correlated variables $cor0.EMPNO should not exist in sourceExpressionList.
      It also brings trouble when convert TableModify back to Sql string.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jinxing6042@126.com Jin Xing
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 0.5h
                  0.5h