EmmyMiao87 commented on issue #7008:
URL: 
https://github.com/apache/incubator-doris/issues/7008#issuecomment-968694069


   > 还有另一个问题也反馈一下,sum(case when)这种写法,也属于聚合函数里面用表达式 
当存在隐式转换时,也可能不会命中rollup,比如从int转化为bigint就命中不了了 猜测转换的原因是怕数据溢出吧
   > 
   > ```
   > explain
   > select dt,
   >       sum(arrived_waybill_cnt) as arrived_waybill_cnt
   >       , sum(case when delivery_type_second_level_code=2 then 
arrived_waybill_cnt end) as arrived_waybill_cnt_jiameng
   >  from bi_peisong.app_rider_model_ctl_sa_view_day
   > where dt > 20211022 and dt<= 20211109
   >   and delivery_type_second_level_code in (2,4)
   > group by dt
   > ```
   
   是这样的,目前物化视图选择器不支持 sum(expr) 其中 expr 不是一个列的情况。
   最主要的原因是,无法判断 expr 中的列物化视图是否满足要求。
   比如 bitmap_union_count(if(is_day_new_user=1,buy_user_id,null))
   其中需要检测,is_day_new_user, buy_user_id 是否能正确的从物化视图中读取出。
   由于 expr 千变万化,需要有表达式等价这类框架支持才能判断。顾目前都不支持聚合函数中出现表达式的物化视图选择。


-- 
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]

Reply via email to