don't set the columns header with json format

This commit is contained in:
hffariel 2021-12-07 11:48:51 +08:00
parent fa4505775d
commit 1e57429883

View File

@ -137,7 +137,7 @@ public class StarRocksStreamLoadVisitor {
try (CloseableHttpClient httpclient = httpClientBuilder.build()) {
HttpPut httpPut = new HttpPut(loadUrl);
List<String> 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()) {