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

[jira] [Resolved] (CALCITE-3606) batch insert failed

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

Danny Chen resolved CALCITE-3606.
---------------------------------
    Fix Version/s: 1.22.0
         Assignee: Danny Chen
       Resolution: Fixed

Fixed in [963a266|https://github.com/apache/calcite/commit/963a266d7b3859d141964217f4d16cae350b10e1], thanks for the PR, [~jinxing6042@126.com] !

> batch insert failed
> -------------------
>
>                 Key: CALCITE-3606
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3606
>             Project: Calcite
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 1.21.0
>            Reporter: Ran Cao
>            Assignee: Danny Chen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.22.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> when I try to execute sql like (insert into example_table (column1,column2) values (value1,value2),(value1,value2)), it will failed with error message like this: column "EXPR$0" of relation "example_table" does not exist. I find the reason is that when converting SqlNode(insert sql) to RelNode(TableModify), one of the steps is to change the column that stored in RelDataType from the fake column name (like "EXPR$0") to the real column name (like "id"). But when the values part in sql is more than one , the step above-mentioned will skip because the RelNode is instance of  LogicalUnion instead of Project, the code refered to org.apache.calcite.tools.RelBuilder line 1461:
> if (input instanceof Project && fieldNames != null) {
>     // change the column name
> }
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)