我正在尝试使用 Dataflow、Pub/Sub 和 BigQuery 创建和导出合成数据流。我关注了synthetic data generation instructions使用以下架构:
{
"id": "{{uuid()}}",
"test_value": {{integer(1,50)}}
}
架构位于文件 gs://my-folder/my-schema.json
中。该流似乎运行正常 - 我可以使用“导出到云存储”模板从相应的 Pub/Sub 主题导出到 GCS 存储桶。当我尝试使用“导出到 BigQuery”模板时,我不断收到此错误:
Request failed with code 400, performed 0 retries due to IOExceptions, performed 0 retries due to unsuccessful status codes, HTTP framework says request can be retried, (caller responsible for retrying): https://bigquery.googleapis.com/bigquery/v2/projects/<my-project>/datasets/<my-dataset>/tables/<my-table>/insertAll.
在开始导出作业之前,我创建了一个空表<my-project>:<my-dataset>.<my-table>
与上面的 JSON 模式匹配的字段:
id STRING NULLABLE
test_value INTEGER NULLABLE
我有outputTableSpec
设置为<my-project>:<my-dataset>.<my-table>
.
最佳答案
如果 BQ 表名称以 project:dataset.table
形式给出,则 table
字符串中不能有任何连字符。当我收到代码 400 错误时,我正在使用 my-project.test.stream-data-102720
。创建新表 my-project.test.stream_data_102720
并使用新名称重新运行作业解决了问题。
关于google-bigquery - 数据流导出到 Bigquery : insertAll error, 无效表引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64546569/