That's just HTTP requests.
If your curl code works, what's difference with your java code?


why not print all your HTTP debug message and see the difference?
If you do need encode data, URLEncode may helps.




















--------------原始邮件--------------
发件人:"nan&nbsp;tu "<liu192048...@gmail.com&gt;;
发送时间:2022年2月8日(星期二) 晚上8:34
收件人:"dev" <dev@doris.apache.org&gt;;
主题:Re: Stream Load delete 包含中文删除失败
-----------------------------------

 This is not the point of the problem, the problem now is that the Chinese 
characters in the http header cannot be parsed because http uses ASCII. Even if 
I can use base64 encoding, doris doesn't know how to decode it, which is 
currently unsettable.

&gt; 2022年2月8日 下午2:20,brain <brain.d...@analyticservice.net&gt; 写道:
&gt; 
&gt; Is that a HttpPut method?
&gt;&gt;&gt; curl -v --location-trusted -u root: -H "column_separator:," -H 
"merge_type: MERGE" -H "columns: k1,k2" -H "delete: k1=2 and k2<=&gt;'上海'" -T 
1.txt http://127.0.0.1:8042/api/db1/tbl2/_stream_load
&gt; 
&gt; Without -X PUT
&gt; 
&gt;&gt; On Feb 7, 2022, at 8:40 PM, nan tu <liu192048...@gmail.com&gt; wrote:
&gt;&gt; 
&gt;&gt; 
感谢您的回复,中文引号是在写邮件时误加的,我试过curl命令也是可以的,但是使用Java代码,发送http请求却是不能正常删除,返回体没有报错。
&gt;&gt; 这是我的java代码:
&gt;&gt; try (CloseableHttpClient httpclient = 
HttpClientBuilder.create().build()) {
&gt;&gt;&nbsp; HttpPut httpPut = new 
HttpPut("http://127.0.0.1:8040/api/db/table1/_stream_load? 
<http://127.0.0.1:8040/api/db/table1/_stream_load?&gt;";);
&gt;&gt;&nbsp; httpPut.setHeader("Authorization", "Basic " + "cm9vdDo=");
&gt;&gt;&nbsp; httpPut.setHeader("Expect", "100-continue");
&gt;&gt;&nbsp; httpPut.setHeader("columns", "id,name");
&gt;&gt;&nbsp; httpPut.setHeader("merge_type", "MERGE");
&gt;&gt;&nbsp; httpPut.setHeader("delete", "id<=&gt;'1' and name<=&gt;'上海'");
&gt;&gt;&nbsp; httpPut.setHeader("column_separator", ",");
&gt;&gt;&nbsp; httpPut.setEntity(new ByteArrayEntity("1,上海".getBytes()));
&gt;&gt;&nbsp; CloseableHttpResponse httpResponse = httpclient.execute(httpPut);
&gt;&gt;&nbsp; int status = httpResponse.getStatusLine().getStatusCode();
&gt;&gt;&nbsp; HttpEntity entity = httpResponse.getEntity();
&gt;&gt;&nbsp; System.out.println("status: " + status);
&gt;&gt;&nbsp; System.out.println("entity: " +&nbsp; (entity != null ? 
EntityUtils.toString(entity) : ""));
&gt;&gt; }
&gt;&gt; 
&gt;&gt; <dependency&gt;
&gt;&gt;&nbsp;&nbsp; <groupId&gt;org.apache.httpcomponents</groupId&gt;
&gt;&gt;&nbsp;&nbsp; <artifactId&gt;httpclient</artifactId&gt;
&gt;&gt;&nbsp;&nbsp; <version&gt;4.5.3</version&gt;
&gt;&gt; </dependency&gt;
&gt;&gt; 
&gt;&gt; 
&gt;&gt;&gt; 2022年2月7日 下午7:03,陈明雨 <morning...@163.com&gt; 写道:
&gt;&gt;&gt; 
&gt;&gt;&gt; I tested it with curl command and utf8 encoded data file.
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; curl -v --location-trusted -u root: -H "column_separator:," -H 
"merge_type: MERGE" -H "columns: k1,k2" -H "delete: k1=2 and k2<=&gt;'上海'" -T 
1.txt http://127.0.0.1:8042/api/db1/tbl2/_stream_load
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; It works fine.
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; You problem may because you wrote a Chinese quota to wrap your 
data “中文”. 
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; --
&gt;&gt;&gt; 
&gt;&gt;&gt; 此致!Best Regards
&gt;&gt;&gt; 陈明雨 Mingyu Chen
&gt;&gt;&gt; 
&gt;&gt;&gt; Email:
&gt;&gt;&gt; chenmin...@apache.org
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; 在 2022-02-07 15:32:01,"nan tu" <liu192048...@gmail.com&gt; 写道:
&gt;&gt;&gt;&gt; Hi,如题所述:
&gt;&gt;&gt;&gt; 如下发送http请求批量导入数据,delete条件包含中文,已知http请求头不能识别中文,有什么方式可以处理这种情况吗?
&gt;&gt;&gt;&gt; ... columns: id, name" -H "merge_type: MERGE" -H "delete: 
id='1' AND name<=&gt; ‘中文'
&gt;&gt;&gt;&gt; Thanks!
&gt;&gt; 
&gt; 
&gt; 
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org
&gt; For additional commands, e-mail: dev-h...@doris.apache.org
&gt; 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org
For additional commands, e-mail: dev-h...@doris.apache.org

Reply via email to