【发布时间】:2019-10-27 22:23:33
【问题描述】:
我是 Dataflow 的新手。我有一个预定义的模式,其中包含一个名为“设备”的非重复记录字段:
device.configId: STRING
device.version: STRING
使用 ParDo 转换,我尝试使用这种字段插入 TableRow,如下所示:
TableRow row = new TableRow();
row.put("field1", "val1");
TableRow device = new TableRow();
device.put("configId", "conf1");
device.put("version", "1.2.3");
row.put("device", device);
out.output(row);
我记录了表格行,它看起来像这样:
{field1=val1, device={configId=conf1, version=1.2.3}}
我将其输出到标准转换:BigQueryIO.write()
但后者发出错误:
java.lang.RuntimeException: java.io.IOException:
Insert failed: [{"errors":[{
"debugInfo":"",
"location":"device.configid",
"message":"This field is not a record.",
"reason":"invalid"
}],"index":0}]
不知道为什么,但请注意位置拼写为小写的“configid” - 而不是原始日志中的驼峰式拼写。
关于如何将此类对象插入 BigQuery 的任何想法?
【问题讨论】:
标签: google-bigquery google-cloud-dataflow apache-beam