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

CalciteSignature's ColumnMetaData for DELETE should be same as INSERT

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.0
    • Fix Version/s: 1.9.0
    • Component/s: core
    • Labels:
      None

      Description

      DELETE, as one type of TableModify operation, has the same RelDataType as INSERT, which is RelRecordType(ROWCOUNT INTEGER). But during "prepare" stage, the corresponding ColumnMetaData info becomes inconsistent, due to:

            preparedResult = preparingStmt.prepareSql(
                sqlNode, Object.class, validator, true);
            switch (sqlNode.getKind()) {
            case INSERT:
            case EXPLAIN:
              // FIXME: getValidatedNodeType is wrong for DML
              x = RelOptUtil.createDmlRowType(sqlNode.getKind(), typeFactory);
              break;
            default:
              x = validator.getValidatedNodeType(sqlNode);
            }
      

      I've noticed that there is a "FIXME: getValidatedNodeType is wrong for DML". Guess that's the root cause, and RelOptUtil.createDmlRowType() is probably a workaround? For now, we can simply include DELETE and other TableModify Operation in the first switch case.

        Attachments

          Activity

            People

            • Assignee:
              maryannxue Maryann Xue
              Reporter:
              maryannxue Maryann Xue
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: