Search before asking
- I had searched in the issues and found no similar issues.
Version
0.14.13
What's Wrong?
create table sql:
CREATE TABLE core_doris_driver_cargo_action_funnel_di_driver
(driver_id
largeint COMMENT '司机id',is_click
largeint COMMENT '是否点击',is_call
int COMMENT '是否有拨打行为',is_fd
int COMMENT '是否有找货行为',is_deal
int COMMENT '是否成交',is_zq
int COMMENT '是否直抢',day
int COMMENT '发货日期',month
int(11) NULL COMMENT "月份",count
int(11) SUM NULL COMMENT "发货量"
)ENGINE=OLAP
AGGREGATE KEY(driver_id
,is_click
,is_call
,is_fd
,is_deal
,is_zq
,day
,month
)
COMMENT "司机行为"
PARTITION BY RANGE(day)
(
PARTITION p20191231 VALUES LESS THAN ('20200101'),
PARTITION p20201231 VALUES LESS THAN ('20210101'),
PARTITION p20210630 VALUES LESS THAN ('20210701'),
PARTITION p20210731 VALUES LESS THAN ('20210801'),
PARTITION p20210831 VALUES LESS THAN ('20210901'),
PARTITION p20210901 VALUES LESS THAN ('20210902'),
PARTITION p20210902 VALUES LESS THAN ('20210906'),
PARTITION p20210906 VALUES LESS THAN ('20210907'),
PARTITION p20211015 VALUES LESS THAN ('20211016'),
PARTITION p20211016 VALUES LESS THAN ('20211017'),
PARTITION p20211017 VALUES LESS THAN ('20211018'),
PARTITION p20211018 VALUES LESS THAN ('20211019'),
PARTITION p20211019 VALUES LESS THAN ('20211020'),
PARTITION p20211020 VALUES LESS THAN ('20211021'),
PARTITION p20211021 VALUES LESS THAN ('20211022'),
PARTITION p20211031 VALUES LESS THAN ('20211101'),
PARTITION p20211101 VALUES LESS THAN ('20211102'),
PARTITION p20211102 VALUES LESS THAN ('20211103'),
PARTITION p20211103 VALUES LESS THAN ('20211104'),
PARTITION p20211231 VALUES LESS THAN ('20220101'),
PARTITION p20220110 VALUES LESS THAN ('20220111'),
PARTITION p20220111 VALUES LESS THAN ('20220112'),
PARTITION p20220112 VALUES LESS THAN ('20220113'),
PARTITION p20220113 VALUES LESS THAN ('20220114'),
PARTITION p20220114 VALUES LESS THAN ('20220115'),
PARTITION p20220125 VALUES LESS THAN ('20220126'),
PARTITION p20220126 VALUES LESS THAN ('20220127'),
PARTITION p20220127 VALUES LESS THAN ('20220128'),
PARTITION p20220128 VALUES LESS THAN ('20220129')
)
DISTRIBUTED BY HASH(driver_id
) BUCKETS 12
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);
insert sql :
insert into core_doris_driver_cargo_action_funnel_di_driver values(1,1,1,1,1,1,20220101,202201,1)
MATERIALIZED VIEW sql:
create materialized view funnel_driver_day_is_fd as select day, driver_id, is_fd,
sum(count)
from core_doris_driver_cargo_action_funnel_di_driver group by day, driver_id, is_fd;
query sql:
select sum(if(is_fd =1, count, null)) from core_doris_driver_cargo_action_funnel_di_driver
where day between 20220101 and 20220201 不能命中物化视图
select sum(count) from core_doris_driver_cargo_action_funnel_di_driver
where day between 20220101 and 20220201 and is_fd = 1 可以命中物化视图
What You Expected?
select sum(count) from core_doris_driver_cargo_action_funnel_di_driver
where day between 20220101 and 20220201 and is_fd = 1 可以命中物化视图
How to Reproduce?
- No response*
Anything Else?
- No response*
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
暂无答案!
目前还没有任何答案,快来回答吧!