maxcompute这两条语句都是取最大时间和最小时间,压缩数据量相差很大怎么解决?[阿里云MaxCompute]

maxcompute这两条语句都是取最大时间和最小时间,压缩数据量相差很大怎么解决? select app_name,corp_id,user_id,event_code, max(last_time)last_time,min(first_time)first_time, sum(cnt)cnt from ( select app_name,corp_id,user_id,event_code,last_time,first_time,cnt from dwd_user_burypoint_record_df_tmp union all select app_name,corp_id,user_id,event_code,last_time,first_time,cnt from dwd_user_burypoint_record_df where ds=to_char(dateadd(to_date(${bdp.system.bizdate},’yyyymmdd’),’-1′,’dd’),’yyyymmdd’) –and corp_id in (select corp_id from dwd_user_burypoint_record_df_tmp) ) as c group by app_name,corp_id,user_id,event_code

select
nvl(a.app_name , b.app_name ) app_name ,nvl(a.corp_id , b.corp_id ) corp_id ,nvl(a.user_id , b.user_id ) user_id ,nvl(a.event_code , b.event_code ) event_code ,greatest(nvl(a.last_time , b.last_time),nvl(b.last_time , a.last_time)) last_time ,least (nvl(a.first_time , b.first_time),nvl(b.first_time , a.first_time)) first_time ,nvl(a.cnt , 0 ) + nvl(b.cnt , 0 ) cnt from (select app_name,corp_id,user_id,event_code,last_time,first_time,cnt from dwd_user_burypoint_record_df_tmp ) a full join (select app_name,corp_id,user_id,event_code,last_time,first_time,cnt from dwd_user_burypoint_record_df where ds=to_char(dateadd(to_date(${bdp.system.bizdate},’yyyymmdd’),’-1′,’dd’),’yyyymmdd’) ) b on nvl(a.app_name,”) =nvl(b.app_name,”)
and nvl(a.corp_id ,”) =nvl(b.corp_id ,”)
and nvl(a.user_id,”)=nvl(b.user_id,”) and nvl(a.event_code,”) =nvl(b.event_code ,”) zorder by app_name,corp_id,user_id,event_code

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
=====这是一个广告位,招租中,联系qq 78315851====