doris icon indicating copy to clipboard operation
doris copied to clipboard

[Bug] 包含%导入报错

Open feng-kui opened this issue 3 years ago • 3 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

1.2.1

What's Wrong?

varchar类型字段的值中,包含%,stream load导入报错,如下:

{"timestamp":"2023-03-01T02:44:08.106+00:00","status":500,"error":"Internal Server Error","path":"/api/example_db/table20/_stream_load"}

但如果将数据放入本地文本文件,通过curl的方式stream load,没有报错,可正常写入

What You Expected?

stream load导入数据成功

How to Reproduce?

建表语句:

CREATE TABLE `table20` (
  `id` int(11) NULL,
  `name` varchar(32) NULL DEFAULT ""
) ENGINE=OLAP
UNIQUE KEY(`id`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`id`) BUCKETS 1;

导入:

header = {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Accept': 'application/json;charset=UTF-8',
'Expect': '100-continue',
"label": label,
"format": "json",
"strip_outer_array": "true"
}

data = [{"id":1,"name":'1'},{"id":2,"name":'a%'}]
rsp = requests.put(url=url, headers=header, auth=('root','123'), json=data)
be_url = rsp.url
rsp = requests.put(url=be_url, headers=header, auth=('root','123'), json=data)
print(rsp.text)

或

curl -XPUT  --location-trusted -u root:123 -H "label:test3" -H "timeout:10000" -H "format: csv" -H "columns: id,name" -H "column_separator:," -H "Expect: 100-continue" http://xxx:8031/api/example_db/table20/_stream_load -d '1,a
2,b
3,c
4,%'

Anything Else?

No response

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

feng-kui avatar Mar 01 '23 02:03 feng-kui

I test OK version 1.2 lts curl --location-trusted -u root:pass -H "label:test" -H "column_separator:," -H "format:csv" -H "columns: id,name" -T test.csv http://ip:8030/api/test/table20/_stream_load

image

LemonLiTree avatar Mar 16 '23 10:03 LemonLiTree

I test OK version 1.2 lts curl --location-trusted -u root:pass -H "label:test" -H "column_separator:," -H "format:csv" -H "columns: id,name" -T test.csv http://ip:8030/api/test/table20/_stream_load

image

not this way has problem

the following has problem

curl -XPUT --location-trusted -u root:123 -H "label:test3" -H "timeout:10000" -H "format: csv" -H "columns: id,name" -H "column_separator:," -H "Expect: 100-continue" http://xxx:8031/api/example_db/table20/_stream_load -d '1,a 2,b 3,c 4,%'

zhaifb avatar Mar 21 '23 06:03 zhaifb

https://github.com/apache/seatunnel/pull/4880

zy-kkk avatar Jun 08 '23 11:06 zy-kkk