Skip to content

Instantly share code, notes, and snippets.

@staticor
Last active June 24, 2019 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staticor/05cb722b97c4c534c6611b5d66f9173c to your computer and use it in GitHub Desktop.
Save staticor/05cb722b97c4c534c6611b5d66f9173c to your computer and use it in GitHub Desktop.
Azkaban-Status统计
select ifnull( status , 'TOTAL') status, count( flow_id ) exec_num
from (
select exec_id, project_id, flow_id
, case
when status = 50 then 'success'
when status = 60 then 'killed'
when status = 70 then 'failed'
else status end status
, submit_user
, from_unixtime( end_time /1000, '%Y-%m-%d') as start_DT
, from_unixtime( start_time /1000, '%Y-%m-%d %H') as start_DH
-- , from_unixtime( end_time /1000, '%Y-%m-%d %H') as end_DH
, b.host as executor_host
from execution_flows a
join executors b on a.executor_id = b.id
where a.project_id not in (27)
-- 27 : personalization
-- 统计数据仓库小组的任务
and submit_user in ('admin', 'yangjinyong', 'liumeng')
and from_unixtime( start_time /1000, '%Y-%m-%d') between '2019-04-01' and '2019-06-30'
and substr(from_unixtime( end_time /1000, '%H'),1,1) ='0'
order by start_DT desc
) mid
group by status
with rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment