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

Missing LogicalSort for INSERT statement

    XMLWordPrintableJSON

    Details

      Description

      The following sql statement generates a wrong logical plan which missing the LogicalSort :

      insert into t select id*10,name from users order by name;

      the plan is :

      LogicalTableModify(table=[[t]], operation=[INSERT], flattened=[false])
        LogicalProject(id=[*($0, 10)], name=[$1])
          LogicalTableScan(table=[[users]])
      

      This issue is introduced by the issue https://issues.apache.org/jira/browse/CALCITE-2978 

      which removes the sort by in sub-query.However the query in insert statement is not a sub-query.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pzw2018 pengzhiwei
                Reporter:
                pzw2018 pengzhiwei
              • Votes:
                0 Vote for this issue
                Watchers:
                6 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 - 2h 10m
                  2h 10m