You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Haisheng Yuan (Jira)" <ji...@apache.org> on 2020/01/07 03:19:00 UTC

[jira] [Resolved] (CALCITE-3658) TableModify of Update contains correlated variable by mistake.

     [ https://issues.apache.org/jira/browse/CALCITE-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Haisheng Yuan resolved CALCITE-3658.
------------------------------------
    Fix Version/s: 1.22.0
       Resolution: Fixed

Fixed in https://github.com/apache/calcite/commit/ee1a70a7b74cb20d3a6dcae145171464ac05b28e.

> 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.3.4#803005)