python - 当 JSON 是源格式时,气流 GCS 到 BQ 运算符失败
问题描述
我有一个 GoogleCloudStorageToBigQueryOperator 运算符在 dag 中运行在气流上。它在处理 CSV 文件时效果很好......我现在正在尝试摄取 JSON 文件,但我收到错误:例如:
skipLeadingRows is not a valid src_fmt_configs for type NEWLINE_DELIMITED_JSON
奇怪的是,我没有打电话给skipLeadingRows
我。如下:
load_Users_to_GBQ = GoogleCloudStorageToBigQueryOperator(
task_id='Table1_GCS_to_GBQ',
bucket='bucket1',
source_objects=['table*.json'],
source_format='NEWLINE_DELIMITED_JSON',
destination_project_dataset_table='DB.table1',
autodetect=False,
schema_fields=[
{'name': 'fieldid', 'type': 'integer', 'mode': 'NULLABLE'},
{'name': 'filed2', 'type': 'integer', 'mode': 'NULLABLE'},
{'name': 'field3', 'type': 'string', 'mode': 'NULLABLE'},
{'name': 'field4', 'type': 'string', 'mode': 'NULLABLE'},
{'name': 'field5', 'type': 'string', 'mode': 'NULLABLE'}
],
write_disposition='WRITE_TRUNCATE',
google_cloud_storage_conn_id='Conn1',
bigquery_conn_id='Conn1',
dag=dag)
我错过了什么?谢谢
解决方案
推荐阅读
- android - 当功能发生代码更改时,我们可以只发布动态功能模块而不是再次发布整个应用程序吗?
- pyspark - Pyspark - groupby 按顺序连接字符串列
- python - 如何在一个模板中使用来自不同应用程序的两个模型
- client-server - 在 Vivado 中写入外设,然后输出到 LED
- django - Django admin import export - 'NoneType' 对象不可调用
- anylogic - 布尔变量可以控制状态图吗?
- javascript - 数组值的 Ramda 路径
- xamarin.forms - 好奇拍摄的条形码照片是否可以在 Xamarin 模拟器中使用
- java - 如何将此代码转换为switch语句
- webpack - 带有服务工作者的 Webpack 不能在 Angular 6 APP 中工作