在尝试使用doris自身湖仓功能往iceberg中写入数据的时候,发现数据变少了。我是有200个分区,一个分区一个分区的迁移。前100个分区,就固定存在数据变少的情况。但是后面100个分区没有变少。我在尝试数据doris往iceberg写入数据的时候,几乎数据都会变少。
doris:3.1.3_rc01 iceberg 1.16
在尝试使用doris自身湖仓功能往iceberg中写入数据的时候,发现数据变少了。我是有200个分区,一个分区一个分区的迁移。前100个分区,就固定存在数据变少的情况。但是后面100个分区没有变少。我在尝试数据doris往iceberg写入数据的时候,几乎数据都会变少。
doris:3.1.3_rc01 iceberg 1.16
我继续深入了一下,我尝试使用doris-spark-connector来做迁移,结果和doris自己做迁移的数据量一致。我的doris和iceberg的建表大致如下:
-- Doris中
create table ads_all_dns_1h (
query_domain VARCHAR(400),
answer_md5 VARCHAR(300),
partition_id INT,
answer_type VARCHAR(60),
etld_plus_one STRING,
answer STRING,
create_at DATETIME,
data_source STRING
)UNIQUE KEY(`query_domain`, `answer_md5`, `partition_id`, `answer_type`)
AUTO PARTITION BY LIST(partition_id, answer_type) ()
DISTRIBUTED BY HASH(`query_domain`) BUCKETS 30
PROPERTIES (
"replication_num" = "2",
"bloom_filter_columns" = "query_domain,etld_plus_one,answer",
"enable_unique_key_merge_on_write" = "true"
);
-- iceberg
create table iceberg.testDB.dwd_dns_domain (
partition_id int,
`domain` STRING,
answer_type STRING,
answer STRING
) PARTITION BY LIST(partition_id) ()
PROPERTIES(
"compression-codec" = "zstd",
"write-format" = "parquet"
);
-- ETL
insert into iceberg.testDB.dwd_dns_domain(
partition_id, domain, answer_type, answer
)
select
partition_id, query_domain, answer_type, answer
from ads_all_dns_1h where partition_id = xxx;
大致就是这样。但是发现其实,迁移的数据前后数据量不一样。
和用户对齐后,通过spark connector验证,从读出来的数据是正常的,写入iceberg 后出现了问题,目前已经排除 Doris的问题。