[ https://issues.apache.org/jira/browse/CALCITE-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ruben Q L closed CALCITE-3658. ------------------------------ > TableModify of Update contains correlated variable by mistake. > -------------------------------------------------------------- > > Key: CALCITE-3658 > URL: https://issues.apache.org/jira/browse/CALCITE-3658 > Project: Calcite > Issue Type: Improvement > Reporter: Jin Xing > Priority: Major > Labels: pull-request-available > Fix For: 1.22.0 > > Time Spent: 0.5h > Remaining Estimate: 0h > > UPDATE clause like below > {code:java} > update emp set empno = empno + 1 > {code} > will be converted to > {code:java} > 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]]) > {code} > However the correlated variables $cor0.EMPNO should not exist in > *sourceExpressionList*. > It also brings trouble when convert TableModify back to Sql string. -- This message was sent by Atlassian Jira (v8.20.7#820007)