我一直在尝试使用 python google-cloud 包 from google.cloud import bigquery
将数据流式传输到 BigQuery。
我观察到的是它拒绝插入几行这样说
[{u'debugInfo': u'', u'reason': u'invalid', u'message': u'no such field.', u'location': u'user.new_user'}]}]
但是,我可以在架构 table.schema
中看到该列
[(u'USER', u'record', u'NULLABLE', None, (SchemaField(u'new_user', u'string', u'NULLABLE', None, ())))]
这是因为我尝试以比 BigQuery 文档中提到的更快的速度进行流式传输和更新吗?
我尝试在终端上运行同样的东西,但没有出现任何错误。当我尝试以更高的速率流式传输时,就会发生这种情况。
目前,我正在使用 as
self.bigquery_client.create_rows_json(table, batched_event,retry=bigquery.DEFAULT_RETRY.with_deadline(10),skip_invalid_rows=True, ignore_unknown_values=True)
最佳答案
如果您在使用流式传输时修改架构,流式传输系统不会立即获取架构更改。更多信息:
https://cloud.google.com/bigquery/troubleshooting-errors#metadata-errors-for-streaming-inserts
关于python - BigQuery 拒绝在流式传输时插入少量记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49516225/