[
https://issues.apache.org/jira/browse/CALCITE-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530669#comment-17530669
]
Ruben Q L commented on CALCITE-3658:
------------------------------------
Thanks for update [~jiajunbernoulli]. I have linked the new ticket and the
current one.
Since the issue that you describe is going to be handled by this new ticket, I
wonder if the current one should not be re-opened and just kept closed (I am
not sure how the Calcite Jira workflow process is supposed to work in cases
like this one).
> 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)