protected RelDataType getLogicalTargetRowType( RelDataType targetRowType, SqlInsert insert) { if (insert.getTargetColumnList() == null && conformance.isInsertSubsetColumnsAllowed()) { // Target an implicit subset of columns. final SqlNode source = insert.getSource(); final RelDataType sourceRowType = getNamespace(source).getRowType(); final RelDataType logicalSourceRowType = getLogicalSourceRowType(sourceRowType, insert); final RelDataType implicitTargetRowType = typeFactory.createStructType( targetRowType.getFieldList() .subList(0, logicalSourceRowType.getFieldCount())); final SqlValidatorNamespace targetNamespace = getNamespace(insert); validateNamespace(targetNamespace, implicitTargetRowType); return implicitTargetRowType; } else { // Either the set of columns are explicitly targeted, or target the full // set of columns. return targetRowType; } }
if (query instanceof SqlInsert) { SqlInsert insert = (SqlInsert) query; if (insert.getTargetColumnList() != null) { return insert.getTargetColumnList().get(ordinal); } else { return getNthExpr(
createTargetRowType( table, insert.getTargetColumnList(), false);
targetRowType = createTargetRowType( table, call.getInsertCall().getTargetColumnList(), false);
final RelOptTable targetTable = getTargetTable(call); final RelDataType tableRowType = targetTable.getRowType(); SqlNodeList targetColumnList = call.getTargetColumnList(); if (targetColumnList == null) { if (validator.getConformance().isInsertSubsetColumnsAllowed()) {
final RelOptTable targetTable = getTargetTable(call); final RelDataType tableRowType = targetTable.getRowType(); SqlNodeList targetColumnList = call.getTargetColumnList(); if (targetColumnList == null) { if (validator.getConformance().isInsertSubsetColumnsAllowed()) {
final RelOptTable targetTable = getTargetTable(call); final RelDataType tableRowType = targetTable.getRowType(); SqlNodeList targetColumnList = call.getTargetColumnList(); if (targetColumnList == null) { if (validator.getConformance().isInsertSubsetColumnsAllowed()) {
final RelOptTable targetTable = getTargetTable(call); final RelDataType tableRowType = targetTable.getRowType(); SqlNodeList targetColumnList = call.getTargetColumnList(); if (targetColumnList == null) { if (validator.getConformance().isInsertSubsetColumnsAllowed()) {
protected RelDataType getLogicalTargetRowType( RelDataType targetRowType, SqlInsert insert) { if (insert.getTargetColumnList() == null && conformance.isInsertSubsetColumnsAllowed()) { // Target an implicit subset of columns. final SqlNode source = insert.getSource(); final RelDataType sourceRowType = getNamespace(source).getRowType(); final RelDataType logicalSourceRowType = getLogicalSourceRowType(sourceRowType, insert); final RelDataType implicitTargetRowType = typeFactory.createStructType( targetRowType.getFieldList() .subList(0, logicalSourceRowType.getFieldCount())); final SqlValidatorNamespace targetNamespace = getNamespace(insert); validateNamespace(targetNamespace, implicitTargetRowType); return implicitTargetRowType; } else { // Either the set of columns are explicitly targeted, or target the full // set of columns. return targetRowType; } }
protected RelDataType getLogicalTargetRowType( RelDataType targetRowType, SqlInsert insert) { if (insert.getTargetColumnList() == null && conformance.isInsertSubsetColumnsAllowed()) { // Target an implicit subset of columns. final SqlNode source = insert.getSource(); final RelDataType sourceRowType = getNamespace(source).getRowType(); final RelDataType logicalSourceRowType = getLogicalSourceRowType(sourceRowType, insert); final RelDataType implicitTargetRowType = typeFactory.createStructType( targetRowType.getFieldList() .subList(0, logicalSourceRowType.getFieldCount())); final SqlValidatorNamespace targetNamespace = getNamespace(insert); validateNamespace(targetNamespace, implicitTargetRowType); return implicitTargetRowType; } else { // Either the set of columns are explicitly targeted, or target the full // set of columns. return targetRowType; } }
if (query instanceof SqlInsert) { SqlInsert insert = (SqlInsert) query; if (insert.getTargetColumnList() != null) { return insert.getTargetColumnList().get(ordinal); } else { return getNthExpr(
if (query instanceof SqlInsert) { SqlInsert insert = (SqlInsert) query; if (insert.getTargetColumnList() != null) { return insert.getTargetColumnList().get(ordinal); } else { return getNthExpr(
createTargetRowType( table, insert.getTargetColumnList(), false);
createTargetRowType( table, insert.getTargetColumnList(), false);
writer.newlineAndIndent(); writer.keyword("WHEN NOT MATCHED THEN INSERT"); if (insertCall.getTargetColumnList() != null) { insertCall.getTargetColumnList().unparse(writer, opLeft, opRight);
writer.newlineAndIndent(); writer.keyword("WHEN NOT MATCHED THEN INSERT"); if (insertCall.getTargetColumnList() != null) { insertCall.getTargetColumnList().unparse(writer, opLeft, opRight);
targetRowType = createTargetRowType( table, call.getInsertCall().getTargetColumnList(), false);
targetRowType = createTargetRowType( table, call.getInsertCall().getTargetColumnList(), false);