气流:为什么运营商会有起始日期? [英] Airflow: Why is there a start_date for operators?

查看:75
本文介绍了气流:为什么运营商会有起始日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白为什么我们需要操作员(任务实例)的开始日期。

I don't understand why do we need a 'start_date' for the operators(task instances). Shouldn't the one that we pass to the DAG suffice?

此外,如果当前时间是2018年2月7日世界标准时间8.30,现在我将开始日期设置为dag到2018年2月7日,上午0.00,我的cron表达式的计划间隔为30 9 * * *(每天上午9.30,即预计在接下来的1小时内运行)。我的DAG是在今天上午9.30还是明天(2月8日上午9.30)运行?

Also, if the current time is 7th Feb 2018 8.30 am UTC, and now I set the start_date of the dag to 7th Feb 2018 0.00 am with my cron expression for schedule interval being 30 9 * * * (daily at 9.30 am, i.e expecting to run in next 1 hour). Will my DAG run today at 9.30 am or tomorrow (8th Feb at 9.30 am )?

推荐答案

关于任务实例的start_date,我个人从未使用过,我始终只有一个DAG start_date。

Regarding start_date on task instance, personally I have never used this, I always just have a single DAG start_date.

不过,据我所知,这将允许您指定某些任务,这些任务要在与主DAG不同的时间开始。看来这是一项旧功能,通过阅读常见问题解答,他们建议使用时间传感器代替这种类型的事物,并且仅对通过DAG传递的所有任务使用一个开始日期。

However from what I can see this would allow you to specify certain tasks to start at a different time from the main DAG. It appears this is a legacy feature and from reading the FAQ they recommend using time sensors for that type of thing instead and just having one start_date for all tasks passed through the DAG.

您的第二个问题:

运行的执行日期始终是根据您的日程安排确定的上一个期间。

The execution date for a run is always the previous period based on your schedule.

从文档(气流文档)


请注意,如果您在一天的schedule_interval上运行DAG,则在2016-01-01T23:59之后不久将触发标记为2016-01-01的运行。换句话说,工作实例在其涵盖的期限结束后即开始。

Note that if you run a DAG on a schedule_interval of one day, the run stamped 2016-01-01 will be trigger soon after 2016-01-01T23:59. In other words, the job instance is started once the period it covers has ended.

要澄清一下:


  • 如果按每天的时间表设置,则在第8天将执行第7个。

  • 如果设置为每周运行的时间表在一个星期日,这个星期日的执行日期将是最后一个星期日。

这篇关于气流:为什么运营商会有起始日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆