python - BigQuery 拒绝在流式传输时插入少量记录

标签 python google-cloud-platform google-bigquery streaming schema

我一直在尝试使用 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/

相关文章:

python - 如何在 sklearn 中使用 LassoLarsCV 获得可重复的分割?

python - Django Daphne 大文件上传

python - 在 Python 中分析子进程 Popen 调用

google-bigquery - 无法从 Bigquery 命令行工具创建 View

分布式应用的Python部署

用于创建 Google 项目的 Python 代码

python - 数据流中的值错误 : Invalid GCS location: None

python - 将 Base 64 字符串转换为 BytesIO

go - 需要更快的方法来列出项目中的所有数据集/表

sql - 在bigquery中查询hive