private RelNode convertDelete(SqlDelete call) { RelOptTable targetTable = getTargetTable(call); RelNode sourceRel = convertSelect(call.getSourceSelect(), false); return LogicalTableModify.create(targetTable, catalogReader, sourceRel, LogicalTableModify.Operation.DELETE, null, null, false); }
private RelNode convertDelete(SqlDelete call) { RelOptTable targetTable = getTargetTable(call); RelNode sourceRel = convertSelect(call.getSourceSelect(), false); return LogicalTableModify.create(targetTable, catalogReader, sourceRel, LogicalTableModify.Operation.DELETE, null, null, false); }
private RelNode convertDelete(SqlDelete call) { RelOptTable targetTable = getTargetTable(call); RelNode sourceRel = convertSelect(call.getSourceSelect(), false); return LogicalTableModify.create(targetTable, catalogReader, sourceRel, LogicalTableModify.Operation.DELETE, null, null, false); }
private RelNode convertDelete(SqlDelete call) { RelOptTable targetTable = getTargetTable(call); RelNode sourceRel = convertSelect(call.getSourceSelect(), false); return LogicalTableModify.create(targetTable, catalogReader, sourceRel, LogicalTableModify.Operation.DELETE, null, null, false); }
protected RelNode convertInsert(SqlInsert call) { RelOptTable targetTable = getTargetTable(call); final RelDataType targetRowType = validator.getValidatedNodeType(call); assert targetRowType != null; RelNode sourceRel = convertQueryRecursive(call.getSource(), false, targetRowType).project(); RelNode massagedRel = convertColumnList(call, sourceRel); return createModify(targetTable, massagedRel); }
protected RelNode convertInsert(SqlInsert call) { RelOptTable targetTable = getTargetTable(call); final RelDataType targetRowType = validator.getValidatedNodeType(call); assert targetRowType != null; RelNode sourceRel = convertQueryRecursive(call.getSource(), false, targetRowType).project(); RelNode massagedRel = convertColumnList(call, sourceRel); return createModify(targetTable, massagedRel); }
collectInsertTargets(call, sourceRef, targetColumnNames, columnExprs); final RelOptTable targetTable = getTargetTable(call); final RelDataType targetRowType = RelOptTableImpl.realRowType(targetTable); final List<RelDataTypeField> targetFields = targetRowType.getFieldList();
collectInsertTargets(call, sourceRef, targetColumnNames, columnExprs); final RelOptTable targetTable = getTargetTable(call); final RelDataType targetRowType = RelOptTableImpl.realRowType(targetTable); final List<RelDataTypeField> targetFields = targetRowType.getFieldList();
protected RelNode convertInsert(SqlInsert call) { RelOptTable targetTable = getTargetTable(call); final RelDataType targetRowType = validator.getValidatedNodeType(call); assert targetRowType != null; RelNode sourceRel = convertQueryRecursive(call.getSource(), false, targetRowType).project(); RelNode massagedRel = convertColumnList(call, sourceRel); return createModify(targetTable, massagedRel); }
protected RelNode convertInsert(SqlInsert call) { RelOptTable targetTable = getTargetTable(call); final RelDataType targetRowType = validator.getValidatedNodeType(call); assert targetRowType != null; RelNode sourceRel = convertQueryRecursive(call.getSource(), false, targetRowType).project(); RelNode massagedRel = convertColumnList(call, sourceRel); return createModify(targetTable, massagedRel); }
private RelNode convertUpdate(SqlUpdate call) { final SqlValidatorScope scope = validator.getWhereScope(call.getSourceSelect()); Blackboard bb = createBlackboard(scope, null, false); Builder<RexNode> rexNodeSourceExpressionListBuilder = ImmutableList.builder(); for (SqlNode n : call.getSourceExpressionList()) { RexNode rn = bb.convertExpression(n); rexNodeSourceExpressionListBuilder.add(rn); } RelOptTable targetTable = getTargetTable(call); // convert update column list from SqlIdentifier to String final List<String> targetColumnNameList = new ArrayList<>(); final RelDataType targetRowType = targetTable.getRowType(); for (SqlNode node : call.getTargetColumnList()) { SqlIdentifier id = (SqlIdentifier) node; RelDataTypeField field = SqlValidatorUtil.getTargetField( targetRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found"; targetColumnNameList.add(field.getName()); } RelNode sourceRel = convertSelect(call.getSourceSelect(), false); return LogicalTableModify.create(targetTable, catalogReader, sourceRel, LogicalTableModify.Operation.UPDATE, targetColumnNameList, rexNodeSourceExpressionListBuilder.build(), false); }
private RelNode convertUpdate(SqlUpdate call) { final SqlValidatorScope scope = validator.getWhereScope(call.getSourceSelect()); Blackboard bb = createBlackboard(scope, null, false); Builder<RexNode> rexNodeSourceExpressionListBuilder = ImmutableList.builder(); for (SqlNode n : call.getSourceExpressionList()) { RexNode rn = bb.convertExpression(n); rexNodeSourceExpressionListBuilder.add(rn); } RelOptTable targetTable = getTargetTable(call); // convert update column list from SqlIdentifier to String final List<String> targetColumnNameList = new ArrayList<>(); final RelDataType targetRowType = targetTable.getRowType(); for (SqlNode node : call.getTargetColumnList()) { SqlIdentifier id = (SqlIdentifier) node; RelDataTypeField field = SqlValidatorUtil.getTargetField( targetRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found"; targetColumnNameList.add(field.getName()); } RelNode sourceRel = convertSelect(call.getSourceSelect(), false); return LogicalTableModify.create(targetTable, catalogReader, sourceRel, LogicalTableModify.Operation.UPDATE, targetColumnNameList, rexNodeSourceExpressionListBuilder.build(), false); }
collectInsertTargets(call, sourceRef, targetColumnNames, columnExprs); final RelOptTable targetTable = getTargetTable(call); final RelDataType targetRowType = targetTable.getRowType(); final List<RelDataTypeField> targetFields =
collectInsertTargets(call, sourceRef, targetColumnNames, columnExprs); final RelOptTable targetTable = getTargetTable(call); final RelDataType targetRowType = targetTable.getRowType(); final List<RelDataTypeField> targetFields =
private RelNode convertUpdate(SqlUpdate call) { final SqlValidatorScope scope = validator.getWhereScope(call.getSourceSelect()); Blackboard bb = createBlackboard(scope, null, false); Builder<RexNode> rexNodeSourceExpressionListBuilder = ImmutableList.builder(); for (SqlNode n : call.getSourceExpressionList()) { RexNode rn = bb.convertExpression(n); rexNodeSourceExpressionListBuilder.add(rn); } RelOptTable targetTable = getTargetTable(call); // convert update column list from SqlIdentifier to String final List<String> targetColumnNameList = new ArrayList<>(); final RelDataType targetRowType = targetTable.getRowType(); for (SqlNode node : call.getTargetColumnList()) { SqlIdentifier id = (SqlIdentifier) node; RelDataTypeField field = SqlValidatorUtil.getTargetField( targetRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found"; targetColumnNameList.add(field.getName()); } RelNode sourceRel = convertSelect(call.getSourceSelect(), false); return LogicalTableModify.create(targetTable, catalogReader, sourceRel, LogicalTableModify.Operation.UPDATE, targetColumnNameList, rexNodeSourceExpressionListBuilder.build(), false); }
final List<String> targetColumnNames, List<RexNode> columnExprs) { final RelOptTable targetTable = getTargetTable(call); final RelDataType tableRowType = targetTable.getRowType(); SqlNodeList targetColumnList = call.getTargetColumnList();
final List<String> targetColumnNames, List<RexNode> columnExprs) { final RelOptTable targetTable = getTargetTable(call); final RelDataType tableRowType = targetTable.getRowType(); SqlNodeList targetColumnList = call.getTargetColumnList();
final List<String> targetColumnNames, List<RexNode> columnExprs) { final RelOptTable targetTable = getTargetTable(call); final RelDataType tableRowType = targetTable.getRowType(); SqlNodeList targetColumnList = call.getTargetColumnList();
private RelNode convertMerge(SqlMerge call) { RelOptTable targetTable = getTargetTable(call);
private RelNode convertUpdate(SqlUpdate call) { final SqlValidatorScope scope = validator.getWhereScope(call.getSourceSelect()); Blackboard bb = createBlackboard(scope, null, false); Builder<RexNode> rexNodeSourceExpressionListBuilder = ImmutableList.builder(); for (SqlNode n : call.getSourceExpressionList()) { RexNode rn = bb.convertExpression(n); rexNodeSourceExpressionListBuilder.add(rn); } RelOptTable targetTable = getTargetTable(call); // convert update column list from SqlIdentifier to String final List<String> targetColumnNameList = new ArrayList<>(); final RelDataType targetRowType = targetTable.getRowType(); for (SqlNode node : call.getTargetColumnList()) { SqlIdentifier id = (SqlIdentifier) node; RelDataTypeField field = SqlValidatorUtil.getTargetField( targetRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found"; targetColumnNameList.add(field.getName()); } RelNode sourceRel = convertSelect(call.getSourceSelect(), false); return LogicalTableModify.create(targetTable, catalogReader, sourceRel, LogicalTableModify.Operation.UPDATE, targetColumnNameList, rexNodeSourceExpressionListBuilder.build(), false); }