首页 新闻 会员 周边 捐助

hive/spark sql格式化工具

0
[待解决问题]

在线或者图形化的SQL格式化工具,类似常见的传统数据库都有很多的格式化工具

---江北的主页 ---江北 | 菜鸟二级 | 园豆:208
提问于:2019-03-13 22:23
< >
分享
所有回答(1)
0

NSERT OVERWRITE table dw_elbs.f_sid_app_filter_agg_in_one_day PARTITION (bizdate=$startdate)
select
sid
,cast(oid_type as int)
,cast(client_id as int)
,app_json_list
,record_count
,first_get_time
,latest_get_time
,first_time
,latest_time
from
(
select
tb_all.oid as sid
,oid_type
,client_id
,app_json_list
,record_count
,first_get_time
,latest_get_time
,first_time
,latest_time
,case when (tb_ex_oid.oid is null) then 0
when (tb_ex_oid.oid is not null) then 1
end as exception
from
(
select
*
from device_base.m_oid_app_filter_agg_in_one_day
where bizdate=$startdate
) tb_all
left join
(
select
oid
from
(
select
oid
,count(1) as cnt
from
(
select
*
from device_base.m_oid_app_filter_agg_in_one_day
where bizdate=$startdate
) a
group by oid
) b
where b.cnt>=3
) tb_ex_oid
on tb_all.oid=tb_ex_oid.oid
) c
where c.exception=0;

北纬22度 | 园豆:202 (菜鸟二级) | 2021-05-17 16:21
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册