Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ public Function<SqlDialect, String> sql(Properties connectionProperties) throws
RelDataType targetRowType = sinkRowType;
if (targetRowType == null) {
targetRowType = query.getRowType();
} else {
// Assert target fields exist in the sink schema when the sink schema is known (partial view use case)
for (String fieldName : targetFields.rightList()) {
if (!targetRowType.getFieldNames().contains(fieldName)) {
throw new IllegalArgumentException("Field " + fieldName + " not found in sink schema");
}
}
}
Map<String, String> sinkConfigs = ConnectionService.configure(sink, connectionProperties);
script = script.database(sink.schema());
Expand Down