diff --git a/extension/DataX/doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisStreamLoadObserver.java b/extension/DataX/doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisStreamLoadObserver.java index 3435b391d5..c3bcfadb19 100644 --- a/extension/DataX/doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisStreamLoadObserver.java +++ b/extension/DataX/doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisStreamLoadObserver.java @@ -64,6 +64,18 @@ public class DorisStreamLoadObserver { this.options = options; } + public String urlDecode(String outBuffer) { + String data = outBuffer; + try { + data = data.replaceAll("%(?![0-9a-fA-F]{2})", "%25"); + data = data.replaceAll("\\+", "%2B"); + data = URLDecoder.decode(data, "utf-8"); + } catch (Exception e) { + e.printStackTrace(); + } + return data; + } + public void streamLoad(WriterTuple data) throws Exception { String host = getLoadHost(); if(host == null){ @@ -77,6 +89,7 @@ public class DorisStreamLoadObserver { .append("/_stream_load") .toString(); LOG.info("Start to join batch data: rows[{}] bytes[{}] label[{}].", data.getRows().size(), data.getBytes(), data.getLabel()); + loadUrl = urlDecode(loadUrl); Map loadResult = put(loadUrl, data.getLabel(), addRows(data.getRows(), data.getBytes().intValue())); LOG.info("StreamLoad response :{}",JSON.toJSONString(loadResult)); final String keyStatus = "Status";