[ 
https://issues.apache.org/jira/browse/CALCITE-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17550206#comment-17550206
 ] 

Ruben Q L commented on CALCITE-3658:
------------------------------------

[~jiajunbernoulli] I will take a look at CALCITE-5122's PR, but honestly I 
don't have too much experience with SqlToRelConverter, RelToSqlConverter or 
LogicalTableModify. I'd prefer, if possible, that the contributors that worked 
on the current ticket took also a look at the new one.
[[email protected]], [~hyuan], do you think you'd be able to take a look at 
the new [PR|https://github.com/apache/calcite/pull/2788] (which is supposed to 
complete the work done in this ticket)?

> 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)

Reply via email to