【发布时间】:2017-10-23 14:20:50
【问题描述】:
我需要一个 BigQueryOperator 任务,如下所示:我需要将查询结果保存到分区表中。但是,"month_start" 需要从实际的 DAG execution_date 派生。我在我的 DAG 定义脚本(在 Python 中)中找不到有关如何读取 execution_date 的任何文档或示例。期待在这里得到一些帮助。
FYR:我使用 Airflow 1.8.2
t1_invalid_geohash_by_traffic = BigQueryOperator(
task_id='invalid_geohash_by_traffic',
bql='SQL/dangerous-area/InvalidGeohashByTraffic.sql',
params = params,
destination_dataset_table=
'mydataset.mytable${}'.format(month_start), write_disposition='WRITE_TRUNCATE',
bigquery_conn_id=CONNECTION_ID,
use_legacy_sql=False
)
【问题讨论】: