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
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
MaxCompute(原ODPS)是一项面向分析的大数据计算服务,它以Serverless架构提供快速、全托管的在线数据仓库服务,消除传统数据平台在资源扩展性和弹性方面的限制,最小化用户运维投入,使您经济并高效的分析处理海量数据。