CBO:“struct is not null“ gets evaluated as ‘nullable‘ always causing filter miss in the query

编程入门 行业动态 更新时间:2024-10-10 19:18:07

CBO:“struct is not <a href=https://www.elefans.com/category/jswz/34/1770810.html style=null“ gets evaluated as ‘nullable‘ always causing filter miss in the query"/>

CBO:“struct is not null“ gets evaluated as ‘nullable‘ always causing filter miss in the query

CBO:“struct is not null” gets evaluated as ‘nullable’ always causing filter miss in the query


HIVE4.0.0之前的版本有一個bug
在寫HQL中,過濾struct filter不生效
解決辦法:在HQL中取消CBO優化

set hive.cbo.enable=false;
insert overwrite table dwd_traffic_page_view_inc partition (dt='2020-06-14')
selectprovince_id,brand,channel,is_new,model,mid_id,operate_system,user_id,version_code,page_item,page_item_type,last_page_id,page_id,source_type,date_format(from_utc_timestamp(ts,'GMT+8'),'yyyy-MM-dd') date_id,date_format(from_utc_timestamp(ts,'GMT+8'),'yyyy-MM-dd HH:mm:ss') view_time,concat(mid_id,'-',last_value(session_start_point,true) over (partition by mid_id order by ts)) session_id,during_time
from
(selectcommon.ar area_code,common.ba brand,common.ch channel,common.is_new is_new,common.md model,common.mid mid_id,common.os operate_system,common.uid user_id,common.vc version_code,page.during_time,page.item page_item,page.item_type page_item_type,page.last_page_id,page.page_id,page.source_type,ts,if(page.last_page_id is null,ts,null) session_start_pointfrom ods_log_incwhere dt='2020-06-14'and page is not null
)log
left join
(selectid province_id,area_codefrom ods_base_province_fullwhere dt='2020-06-14'
)bp
on log.area_code=bp.area_code

更多推荐

CBO:“struct is not null“ gets evaluated as ‘nullable‘ always causing filter miss

本文发布于:2024-02-27 09:38:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1706059.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:null   evaluated   CBO   struct   filter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!