StarRocks / starrocks

The world's fastest open query engine for sub-second analytics both on and off the data lakehouse. With the flexibility to support nearly any scenario, StarRocks provides best-in-class performance for multi-dimensional analytics, real-time analytics, and ad-hoc queries. A Linux Foundation project.
https://starrocks.io
Apache License 2.0
9.03k stars 1.82k forks source link

the parameter of enclose or escape is chinese when load data #42944

Closed huoyue-git closed 1 month ago

huoyue-git commented 8 months ago

Steps to reproduce the behavior (Required)

  1. CREATE TABLE '...'
    
    CREATE TABLE `duplicate_table_with_null` (
                k0 int,v1 date,v2 datetime,v3 char(20),v4 varchar(40),v5 string
                ) ENGINE=OLAP
            DUPLICATE KEY(k0)
            COMMENT "OLAP"
            DISTRIBUTED BY HASH(k0) BUCKETS 3
            PROPERTIES (
                "replication_num" = "3",
                "storage_format" = "v2"
            );

enclose data 1,9999-12-31,9999-12-31 23:59:59,中beijin\tgaergertte中,中hai\ndian'sdv,gerwwge中,中asrew er中中hgeth中 2,0001-01-01,0001-01-01 00:00:01,中beij ing中,中haid\t\n\r&_#@#$)!_ian中,中saefwd 中中 中 3,2020-01-01,2020-01-01 00:00:01,中beij \ting中,中haid\t\n\r&_#@#$)!_ian中,中saefwd 中中

enclose is chinese curl --location-trusted -u "root:" -T ../chinese_enclose.csv -XPUT -H "label:stream_load_1710837373411_jhx" -H "column_separator:," -H "enclose:中" http://xxx.xx.xx.xxx:xxxx/api/test_db/duplicate_table_with_null/_stream_load

select * from duplicate_table_with_null;

escape data 1,9999-12-31,9999-12-31 23:59:59,beijin中\tgaergertte,hai中\ndian中'sdv中gerwwge,asrew er中\hgeth 2,0001-01-01,0001-01-01 00:00:01,beij ing,haid中\t中\n中\r&_#@#$)!_ian,saefwd 中* 3,2020-01-01,2020-01-01 00:00:01,beij 中\ting,haid中\t中\n中\r&_#@#$)!_ian,saefwd 中*

escape is chinese curl --location-trusted -u "root:" -T ../chinese_escape.csv -XPUT -H "label:stream_load_1710837374410_jhd" -H "column_separator:," -H "escape:中" http://xxx.xx.xx.xxx:xxxx/api/test_db/duplicate_table_with_null/_stream_load

select * from duplicate_table_with_null;



### Expected behavior (Required)

### Real behavior (Required)
![img_v3_0294_fd77ba5e-1e9e-4325-b30d-9a4b3e6ecb6g](https://github.com/StarRocks/starrocks/assets/91584973/a6da0c9b-e846-4973-8b3c-c16b184d2689)

![img_v3_0294_9f34603c-e544-416e-9de0-8b7c98d401bg](https://github.com/StarRocks/starrocks/assets/91584973/19c9a278-e08a-4bc6-bd56-b828785a6cd7)

### StarRocks version (Required)
 - You can get the StarRocks version by executing SQL `select current_version()`
github-actions[bot] commented 1 month ago

We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!