Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3606

batch insert failed

    XMLWordPrintableJSON

Details

    Description

      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 }

       

      Attachments

        Issue Links

          Activity

            People

              danny0405 Danny Chen
              caoran Ran Cao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h