StarRocks/starrocks

support some complex type's output and input

Open

#62.913 aperta il 10 set 2025

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)Java (1246 fork)batch import
good first issueno-issue-activitytype/feature-request

Metriche repository

Star
 (5717 star)
Metriche merge PR
 (Merge medio 1g 5h) (1000 PR mergiate in 30 g)

Descrizione

Description

Sometimes we want to export complex(hll/bitmap/quantile_state/agg_state) types for data backup, and then reimport the exported data into SR to restore the data.

We can export the data of the serialized complex type to the file as binary, and then restore the binary to the complex type through deserialization. (e.g. DataTypeAggState::serialize/deserialize)

support stream load import

Use case


create table a_table(
    k1 int null,
    k2 agg_state<max_by(int not null,int)> generic,
    k3 agg_state<group_concat(string)> generic
)
aggregate key (k1)
distributed BY hash(k1) buckets 3
properties("replication_num" = "1");

insert into a_table values(1,max_by_state(3,1),group_concat_state('a'));
insert into a_table values(1,max_by_state(2,2),group_concat_state('bb'));
insert into a_table values(2,max_by_state(1,3),group_concat_state('ccc'));

select * from a_table INTO OUTFILE "file:///mnt/disk3/root/sr/tmp.csv";

LOAD DATA LOCAL INFILE 'tmp.csv*' INTO TABLE a_table COLUMNS TERMINATED BY ',' LINES TERMINATED BY '\n';

Guida contributor