SqlIdentifier id = (SqlIdentifier) node; RelDataTypeField targetField = SqlValidatorUtil.getTargetField( baseRowType, typeFactory, id, catalogReader, relOptTable); if (targetField == null) {
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); }
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); }
SqlIdentifier id = (SqlIdentifier) node; RelDataTypeField targetField = SqlValidatorUtil.getTargetField( baseRowType, typeFactory, id, catalogReader, relOptTable); if (targetField == null) {
SqlIdentifier id = (SqlIdentifier) node; RelDataTypeField targetField = SqlValidatorUtil.getTargetField( baseRowType, typeFactory, id, catalogReader, relOptTable); if (targetField == null) {
SqlIdentifier id = (SqlIdentifier) targetColumnList.get(i); RelDataTypeField field = SqlValidatorUtil.getTargetField( tableRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found";
SqlIdentifier id = (SqlIdentifier) targetColumnList.get(i); RelDataTypeField field = SqlValidatorUtil.getTargetField( tableRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found";
SqlIdentifier id = (SqlIdentifier) targetColumnList.get(i); RelDataTypeField field = SqlValidatorUtil.getTargetField( tableRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found";
SqlIdentifier id = (SqlIdentifier) targetColumnList.get(i); RelDataTypeField field = SqlValidatorUtil.getTargetField( tableRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found";
SqlIdentifier id = (SqlIdentifier) targetColumn; RelDataTypeField field = SqlValidatorUtil.getTargetField( targetRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found";
SqlIdentifier id = (SqlIdentifier) targetColumn; RelDataTypeField field = SqlValidatorUtil.getTargetField( targetRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found";
SqlIdentifier id = (SqlIdentifier) targetColumn; RelDataTypeField field = SqlValidatorUtil.getTargetField( targetRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found";
SqlIdentifier id = (SqlIdentifier) targetColumn; RelDataTypeField field = SqlValidatorUtil.getTargetField( targetRowType, typeFactory, id, catalogReader, targetTable); assert field != null : "column " + id.toString() + " not found";
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); }