我正在尝试使用Dataflow、Pub/Sub和BigQuery创建和导出合成数据流。我使用以下模式遵循合成数据生成指令:
{
"id": "{{uuid()}}",
"test_value": {{integer(1,50)}}
}
架构位于文件gs://my-folder/my-schema.json
中。流似乎运行正确-我可以使用";导出到云存储";样板当我尝试使用";导出到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
并使用新名称重新运行作业解决了问题。