在Airflow DAG文件中的代码中手动添加autodetect参数。
示例代码:
from airflow.contrib.operators.bigquery_operator import BigQueryCreateExternalTableOperator
create_external_table = BigQueryCreateExternalTableOperator( task_id='create_external_table', bucket='your_bucketname', source_objects=['sales-*.csv'], schema_fields=[ {'name':'column1', 'type':'INTEGER'}, {'name':'column2', 'type':'STRING'}, {'name':'column3', 'type':'FLOAT'}, ], source_format='CSV', autodetect=False #手动添加autodetect参数 )
create_external_table.execute(context={})