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
8.87k stars 1.78k forks source link

Try to load data from a csv into StarRocks。but the last `'` remains after loading #51725

Open asdfsx opened 2 weeks ago

asdfsx commented 2 weeks ago

Try to load data from a csv into StarRocks, below is one of them。After loading I find the data in StarRocks keep the last '

/wp-admin/edit.php?post_type=post,'[{"support": 1.0, "item": 23802228611909434500675223637494144312}, {"support": 1.0, "item": 174472487042906779548867851357749048616}, {"supp
ort": 0.967741935483871, "item": 218473117571251542901396678363898265937}, {"support": 0.967741935483871, "item": 231554223331928306785505632432118524085}, {"support": 0.93548
38709677419, "item": 251450111408553977209416691192262766043}, {"support": 0.8709677419354839, "item": 255844660388155386531595464064842665953}, {"support": 0.8709677419354839
, "item": 43431313178276204057415236603873012077}, {"support": 0.8387096774193549, "item": 134183800354940827219830043105011992932}, {"support": 0.8064516129032258, "item": 12
4252827735266096217734490785960544895}, {"support": 0.7741935483870968, "item": 308786225706730603494773708575056993695}, {"support": 0.7741935483870968, "item": 1075746400190
33010051536354268230337001}, {"support": 0.7419354838709677, "item": 257105383019231995168090203574525649981}, {"support": 0.7419354838709677, "item": 559424449179993410490394
93638467366617}, {"support": 0.7419354838709677, "item": 241284497872922364543607046042548588103}, {"support": 0.7096774193548387, "item": 224156408131500668504211608160659624
317}, {"support": 0.6774193548387096, "item": 178058453208626738767032585709146263373}, {"support": 0.7419354838709677, "item": 332783421630035866156352528202461149697}]'

Steps to reproduce the behavior (Required)

  1. create table
    create table test.frequent_itemset_str2(
    id bigint not null AUTO_INCREMENT,
    url STRING not NULL,
    itemsets STRING not NULL
    ) ENGINE = olap
    PRIMARY KEY (id);
  2. import data
    curl --location-trusted -u root             \
    -T ./test.csv        \
    -H "column_separator:,"                 \
    -H "skip_header:1"                      \
    -H "enclose:'"                         \
    -H "max_filter_ratio:1"                 \
    -H "columns: url, itemsets"                \
    -XPUT http://127.0.0.1:8030/api/test/frequent_itemset_str/_stream_load
  3. query

    SELECT id, url, parse_json(itemsets) FROM deepflow.frequent_itemset_str;
    id |url                                               |parse_json(itemsets)|
    ---+--------------------------------------------------+--------------------+
    609|/wp-admin/edit.php?post_type=post&trashed=1&ids=53|                    |
    610|/wp-admin/edit.php?post_type=post&trashed=1&ids=65|                    |
    608|/wp-admin/edit.php?post_type=post&author=1        |                    |

    contents in column itemsets should be json,but they failed to transform because of the '

image

Expected behavior (Required)

Real behavior (Required)

StarRocks version (Required)

3.3.0-19a3f66

asdfsx commented 6 days ago

A simple example The csv file & the load scripts image

Query table image

asdfsx commented 5 days ago

@jaogoy