Currently, the materialized view in Doris is just same as Rollup, which is based on a singe table (aka base table). And the partition and bucket of materialized view(or rollup) must be same as base table. So we can not aggregate data from diffrent partition or bucket in a rollup. This is a disadvantage of current implementation, we are developing a new materialized view feature which can set different partition or buckets for a materialized view.
-- 此致!Best Regards 陈明雨 Mingyu Chen Email: morning...@apache.org 在 2022-11-22 17:04:13,"fl" <flzzj0...@163.com> 写道: >Hi, Apache Doris开发组: > > >在使用“物化视图”特性时,想到了下述问题,不明白其相关原理,故请教各位。 > > >对某表建物化视图时,该表设置了一定数量的副本数,那么物化视图聚合计算时,对这些分布在不同节点的tablet副本是如何处理呢? > > >即某个tablet有多个副本,按照partition维度聚合,对当前节点的该partition下的所有tablet聚合(比如sum)后,那么单个节点的partition > sum() 结果肯定是小于正确值的(部分tablet在其他节点),而多个节点的sum() >汇总结果又是大于正确值的(必定存在相同tablet分布在不同节点,被重复聚合)