kettle资源库统计所有输出表对应的作业id(通过运行日志找目标表对应的任务执行时间)

SELECT 
  xx.value_str tablename, 
  yy.id_job jobid 
FROM 
  (
    SELECT 
      a.`value_str`, 
      c.`name`, 
      CONCAT('/', o.`directory_name`) directory_name 
    FROM 
      r_step_attribute a 
      LEFT JOIN r_step b ON a.`id_step` = b.`id_step` 
      LEFT JOIN `r_transformation` c ON b.`id_transformation` = c.`id_transformation` 
      LEFT JOIN `r_directory` o ON c.`id_directory` = o.`id_directory` 
    WHERE 
      b.`id_step_type` IN ('205', '151') 
      AND a.`code` = 'table'
  ) xx 
  LEFT JOIN (
    SELECT 
      DISTINCT k.`id_job`, 
      (
        SELECT 
          j.`value_str` 
        FROM 
          `r_jobentry_attribute` j 
        WHERE 
          j.`code` = 'name' 
          AND k.`id_jobentry` = j.`id_jobentry`
      ) AS exg_name, 
      (
        SELECT 
          j.`value_str` 
        FROM 
          `r_jobentry_attribute` j 
        WHERE 
          j.`code` = 'dir_path' 
          AND k.`id_jobentry` = j.`id_jobentry`
      ) AS dir_name 
    FROM 
      `r_jobentry` k 
      LEFT JOIN `r_jobentry_attribute` j ON k.`id_jobentry` = j.`id_jobentry` 
    WHERE 
      k.`id_jobentry_type` = '87' 
      AND j.`code` IN ('name', 'dir_path')
  ) yy ON xx.name = yy.exg_name 
  AND xx.directory_name = yy.dir_name

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值