【发布时间】:2015-09-16 19:55:56
【问题描述】:
我正在尝试使用 java 客户端库将 json 文件加载到 Bigquery 中。一些 Json 字段填充为空。并且加载失败,Bigquery 出现以下错误。
{
"reason": "invalid",
"location": "File: 0 / Offset:0 / Line:1 / Column:1666 / Field:field1",
"message": "flat value specified for record field"
}
我的架构是这样的。
{
"name": "field1",
"type": "RECORD",
"mode": "NULLABLE",
"fields": [{
"name": "field2",
"type": "TIMESTAMP",
"mode": "REQUIRED"
},
{
"name": "field3",
"type": "TIMESTAMP",
"mode": "REQUIRED"
}]
}
而我的Json就是这样的。
{
...
"field1": null,
...
}
我看到了这两个链接。
Import json data with null values 和 Loading nulls into bigquery with bq
不幸的是,我无法更改 json 以删除具有空值的字段。有没有办法在 Bigquery 中加载这样的 json?我在文档中找不到太多信息。请指点我一些文档或一些解决方法。感谢您的宝贵时间。
【问题讨论】:
标签: google-bigquery