Skip to content
Open
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 @@ -514,7 +514,15 @@ public StreamLoadProperties getProperties(@Nullable StarRocksSinkTable table) {
.enableUpsertDelete(supportUpsertDelete());

if (hasColumnMappingProperty()) {
defaultTablePropertiesBuilder.columns(streamLoadProps.get("columns"));
List<String> columns = new ArrayList<>(Arrays.asList(streamLoadProps.get("columns").split(",")));
if (supportUpsertDelete()) {
// auto add `__op` for primary key table even when user specified `sink.properties.columns`.
// in case user use a bitmap datatype and need set up `sink.properties.columns`, may forget to add `__op`.
if (columns.stream().noneMatch(it -> it.equals("__op"))) {
columns.add("__op");
}
}
defaultTablePropertiesBuilder.columns(String.join(",", columns));
} else if (getTableSchemaFieldNames() != null) {
// don't need to add "columns" header in following cases
// 1. use csv format but the flink and starrocks schemas are aligned
Expand Down