englefly opened a new issue, #69262: URL: https://github.com/apache/doris/issues/69262
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version CREATE TABLE t (k1 INT, k2 INT) DUPLICATE KEY(k1) PARTITION BY RANGE(k1) (PARTITION p1 VALUES LESS THAN (10)) DISTRIBUTED BY HASH(k1) BUCKETS 1; ALTER TABLE t ADD TEMPORARY PARTITION tp1 VALUES LESS THAN (10); INSERT INTO t VALUES (1,1),(2,2),(3,3); -- 等 tablet_stat_update_interval_second 让 p1 上报 INSERT INTO t TEMPORARY PARTITION(tp1) VALUES (4,4),(5,5),(6,6),(7,7),(8,8); EXPLAIN SELECT * FROM t TEMPORARY PARTITION(tp1); -- 实际:cardinality = 3(p1 的行数),期望:≈ tp1 的 5 行 -- FE 日志同时出现 "Partition <tp1_id> not exist in table t" 修复方向: getRowCountForPartitionIndex 改成先 idToPartition、再 tempPartitions(temp 的 MaterializedIndex.rowCount 是有效的,TabletStatMgr 已经用 getAllPartitions() 更新过); getSelectedPartitionRowCount 的"未知分区按比例摊"只用于普通分区,且分母 getPartitionNum()(不含 temp)的语义要对齐; 测试:EXPLAIN SELECT * FROM t TEMPORARY PARTITION(tp1) 的 cardinality 应反映 tp1 的行数。 ### What's Wrong? TEMPORARY PARTITION 的行数不正确, 不是正常partition行数 3 ### What You Expected? 临时分区自己的行数 5 ### How to Reproduce? CREATE TABLE t (k1 INT, k2 INT) DUPLICATE KEY(k1) PARTITION BY RANGE(k1) (PARTITION p1 VALUES LESS THAN (10)) DISTRIBUTED BY HASH(k1) BUCKETS 1; ALTER TABLE t ADD TEMPORARY PARTITION tp1 VALUES LESS THAN (10); INSERT INTO t VALUES (1,1),(2,2),(3,3); -- 等 tablet_stat_update_interval_second 让 p1 上报 INSERT INTO t TEMPORARY PARTITION(tp1) VALUES (4,4),(5,5),(6,6),(7,7),(8,8); EXPLAIN SELECT * FROM t TEMPORARY PARTITION(tp1); -- 实际:cardinality = 3(p1 的行数),期望:≈ tp1 的 5 行 -- FE 日志同时出现 "Partition <tp1_id> not exist in table t" ### Anything Else? no ### Are you willing to submit PR? - [x] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
