期望需求:异步物化视图支持日期分区及倒排索引

Viewed 63

期望doris能支持以下异步物化视图构建能力,其中user_id在基表中为倒排索引,在异步物化视图也同样可配置倒索索引:

CREATE MATERIALIZED VIEW view_flink_to_doris_month1 BUILD DEFERRED REFRESH AUTO ON MANUAL partition by(cur_time) DISTRIBUTED BY hash(user_id) BUCKETS 19 PROPERTIES (
  "replication_num" = "1",
  "dynamic_partition.enable" = "true",
  "dynamic_partition.time_unit" = "MONTH",
  "dynamic_partition.start" = "-48",
  "dynamic_partition.end" = "1",
  "dynamic_partition.prefix" = "m",
  "dynamic_partition.buckets" = "19"
) AS
select
  date_trunc(cur_time,'month'),
  hour(cur_time),
  user_id,
  device_code,
  big_type,
  alert_type,
  sum(alert_count) as alert_count
from
  test.flink_to_doris_month
group by
  date_trunc(cur_time,'month'),
  hour(cur_time),
  user_id,
  device_code,
  big_type,
  alert_type;
1 Answers

2.1.4 版本会开始支持为物化视图创建索引

另:无需为物化视图指定动态分区,物化视图在刷新任务运行前,会自动按照基表的分区来补全物化视图的分区