Google cloud platform Composer GoogleCloudStorageToBigQueryOperator-添加其他字段值
我成功地使用我的第一个GoogleCloudStorageToBigQueryOperator将换行符分隔的JSON文件加载到bigQuery 代码的主要部分如下所示Google cloud platform Composer GoogleCloudStorageToBigQueryOperator-添加其他字段值,google-cloud-platform,google-bigquery,google-cloud-composer,Google Cloud Platform,Google Bigquery,Google Cloud Composer,我成功地使用我的第一个GoogleCloudStorageToBigQueryOperator将换行符分隔的JSON文件加载到bigQuery 代码的主要部分如下所示 default_args = { 'owner': 'airflow', 'start_date': start_date, 'email': email_alert, 'email_on_failure': True, 'email_on_retry': False } with DA
default_args = {
'owner': 'airflow',
'start_date': start_date,
'email': email_alert,
'email_on_failure': True,
'email_on_retry': False
}
with DAG(dag_id, schedule_interval=None,
default_args=default_args) as dag:
start = DummyOperator(task_id='start')
gcs_to_bq = GoogleCloudStorageToBigQueryOperator(
task_id='gcs_to_bq',
bucket=source_bucket
source_objects = [source_file],
destination_project_dataset_table=bq_table,
source_format=source_format,
write_disposition='WRITE_APPEND',
autodetect=True
)
start >> gcs_to_bq
这将成功地将数据从源文件(参数化)加载到BQ。在InsertedDate表(现在)和FileName表(文件名,在本例中为源文件)中有两个附加字段
有没有一种方法可以让我在composer中做到这一点