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.04k stars 1.82k forks source link

the parameter of enclose have two chartacter when load data #42943

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"
            )

curl --location-trusted -u "root:" -T ../csv/mutli_charact_enclose.csv -XPUT -H "label:stream_load_1710837373410_jhx" -H "column_separator:," -H "enclose:Q|" http://xxx.xx.xx.xxx:xxxx/api/test_db/duplicate_table_with_null/_stream_load

select * from duplicate_table_with_null;

data

1,9999-12-31,9999-12-31 23:59:59,Q|beijin\tgaergertteQ|,Q|hai\ndian'sdv,gerwwgeQ|,Q|asrew    erQ|Q|hgethQ|
2,0001-01-01,0001-01-01 00:00:01,Q|beij  ingQ|,Q|haid\t\n\r&*_#@#$)!_ianQ|,Q|saefwd *Q|Q|* Q|
3,2020-01-01,2020-01-01 00:00:01,Q|beij  \\tingQ|,Q|haid\t\n\r&*_#@#$)!_ianQ|,Q|saefwd *Q|Q|* Q|

img_v3_0294_fd8cffb5-ffee-4afa-8e82-a863e48edc4g

Expected behavior (Required)

Real behavior (Required)

mysql> select * from duplicate_table_with_null;
+------+------------+---------------------+----------------------+---------------------------+----------------------+
| k0   | v1         | v2                  | v3                   | v4                        | v5                   |
+------+------------+---------------------+----------------------+---------------------------+----------------------+
|    1 | 9999-12-31 | 9999-12-31 23:59:59 | |beijin\tgaergertteQ | |hai\ndian'sdv,gerwwgeQ   | |asrew    erQ||hgeth |
|    3 | 2020-01-01 | 2020-01-01 00:00:01 | |beij  \\tingQ       | |haid\t\n\r&*_#@#$)!_ianQ | |saefwd *Q||*        |
|    2 | 0001-01-01 | 0001-01-01 00:00:01 | |beij  ingQ          | |haid\t\n\r&*_#@#$)!_ianQ | |saefwd *Q||*        |
+------+------------+---------------------+----------------------+---------------------------+----------------------+
3 rows in set (0.01 sec)

StarRocks version (Required)

github-actions[bot] commented 2 months 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!