show alter table materialized view from
用的官网给的一模一样的例子
create table sales_records
(
record_id int,
seller_id int,
store_id int,
sale_date date,
sale_amt bigint
)
distributed by hash(record_id)
properties("replication_num" = "1");
-- 插入数据
insert into sales_records values(1,1,1,'2020-02-02',1);
create materialized view store_amt as
select store_id, sum(sale_amt) from sales_records group by store_id;
desc sales_records all;
show alter table materialized view from test_db;
explain select store_id, sum(sale_amt) from sales_records group by store_id;