zac*_*ack 2 google-bigquery google-cloud-pubsub google-cloud-dataflow
我正在尝试使用 Dataflow、Pub/Sub 和 BigQuery 创建和导出合成数据流。我使用以下模式遵循合成数据生成说明:
{
"id": "{{uuid()}}",
"test_value": {{integer(1,50)}}
}
Run Code Online (Sandbox Code Playgroud)
该架构位于一个文件中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.
Run Code Online (Sandbox Code Playgroud)
在开始导出作业之前,我创建了一个空表<my-project>:<my-dataset>.<my-table>,其中的字段与上面的 JSON 架构匹配:
id STRING NULLABLE
test_value INTEGER NULLABLE
Run Code Online (Sandbox Code Playgroud)
我已经outputTableSpec设置为<my-project>:<my-dataset>.<my-table>.
如果 BQ 表名称以 形式给出project:dataset.table,则字符串中不能有任何连字符table。我在使用my-project.test.stream-data-102720时收到代码 400 错误。创建新表my-project.test.stream_data_102720并使用新名称重新运行作业解决了该问题。
| 归档时间: |
|
| 查看次数: |
2214 次 |
| 最近记录: |