【已解决】2.1.7,show partitions的rowCount数量不对

Viewed 106

版本:2.1.7
自动分区表
建表语句:

CREATE TABLE `tb_dwd_dm_rpt_mcl_user_mx_d_tozq` (
  `period_date` date NOT NULL COMMENT '账期',
  `month_id` text NULL COMMENT '月份',
  `area_name` text NULL COMMENT '业务区',
  `cnt_this_year` text NULL COMMENT '本年申请次数'
) ENGINE=OLAP
DUPLICATE KEY(`period_date`)
AUTO PARTITION BY RANGE (date_trunc(`period_date`, 'day'))
(PARTITION p20241231000000 VALUES [('2024-12-31'), ('2025-01-01')),
PARTITION p20250101000000 VALUES [('2025-01-01'), ('2025-01-02')),
PARTITION p20250102000000 VALUES [('2025-01-02'), ('2025-01-03')))
DISTRIBUTED BY HASH(`period_date`) BUCKETS 3
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"min_load_replica_num" = "-1",
"is_being_synced" = "false",
"storage_medium" = "hdd",
"storage_format" = "V2",
"inverted_index_storage_format" = "V1",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false",
"group_commit_interval_ms" = "10000",
"group_commit_data_bytes" = "134217728"
);

show partitions from tb_dwd_dm_rpt_mcl_user_mx_d_tozq;
image.png

select count(*) from tb_dwd_dm_rpt_mcl_user_mx_d_tozq where period_date = '2025-01-01' ;
image.png

1 Answers

这个行数本来就是不准的,比如如果用户做了删除操作,在doris的实现中是写入了一个delete predicate,然后在查询期间将数据过滤掉。

只有select count(*)才能提供完全准确的行数。