From 1e574298834c308bd064076a7beaeffc94c4cccf Mon Sep 17 00:00:00 2001 From: hffariel Date: Tue, 7 Dec 2021 11:48:51 +0800 Subject: [PATCH] don't set the columns header with json format --- .../starrockswriter/manager/StarRocksStreamLoadVisitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starrockswriter/src/main/java/com/starrocks/connector/datax/plugin/writer/starrockswriter/manager/StarRocksStreamLoadVisitor.java b/starrockswriter/src/main/java/com/starrocks/connector/datax/plugin/writer/starrockswriter/manager/StarRocksStreamLoadVisitor.java index 847635c8..38f66680 100644 --- a/starrockswriter/src/main/java/com/starrocks/connector/datax/plugin/writer/starrockswriter/manager/StarRocksStreamLoadVisitor.java +++ b/starrockswriter/src/main/java/com/starrocks/connector/datax/plugin/writer/starrockswriter/manager/StarRocksStreamLoadVisitor.java @@ -137,7 +137,7 @@ public class StarRocksStreamLoadVisitor { try (CloseableHttpClient httpclient = httpClientBuilder.build()) { HttpPut httpPut = new HttpPut(loadUrl); List cols = writerOptions.getColumns(); - if (null != cols && !cols.isEmpty()) { + if (null != cols && !cols.isEmpty() && StarRocksWriterOptions.StreamLoadFormat.CSV.equals(writerOptions.getStreamLoadFormat())) { httpPut.setHeader("columns", String.join(",", cols.stream().map(f -> String.format("`%s`", f)).collect(Collectors.toList()))); } if (null != writerOptions.getLoadProps()) {