Json 数据流作业异常
Json exception on dataflow job
我正在尝试使用数据流作业将数据从 json 文件加载到数据存储区,但出现错误
Error message from worker:
com.google.protobuf.InvalidProtocolBufferException:
com.google.gson.stream.MalformedJsonException: Unexpected value at
line 1 column 2 path $
com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1347)
com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:477)
com.google.cloud.teleport.templates.common.DatastoreConverters$EntityJsonParser.merge(DatastoreConverters.java:497)
com.google.cloud.teleport.templates.common.DatastoreConverters$JsonToEntity.processElement(DatastoreConverters.java
看起来错误是由于 json 格式错误造成的,但我的 json 如下所示,并已通过 jsonlint
验证
[{
"name1": "11",
"name2": "haha"
}, {
"name3": "value"
}]
有没有人分享一下这里出了什么问题。 PS 我在数据流
上使用模板 Datastore to Text Files on Cloud Storage
此模板要求输入为 json 格式的数据存储实体,而不仅仅是任何 json 对象,如此处所述:https://cloud.google.com/dataflow/docs/guides/templates/provided-batch#cloud-storage-text-to-datastore
您需要遵守的格式在这里:https://cloud.google.com/datastore/docs/reference/data/rest/v1/Entity
我正在尝试使用数据流作业将数据从 json 文件加载到数据存储区,但出现错误
Error message from worker: com.google.protobuf.InvalidProtocolBufferException: com.google.gson.stream.MalformedJsonException: Unexpected value at line 1 column 2 path $ com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1347) com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:477) com.google.cloud.teleport.templates.common.DatastoreConverters$EntityJsonParser.merge(DatastoreConverters.java:497) com.google.cloud.teleport.templates.common.DatastoreConverters$JsonToEntity.processElement(DatastoreConverters.java
看起来错误是由于 json 格式错误造成的,但我的 json 如下所示,并已通过 jsonlint
验证[{
"name1": "11",
"name2": "haha"
}, {
"name3": "value"
}]
有没有人分享一下这里出了什么问题。 PS 我在数据流
上使用模板Datastore to Text Files on Cloud Storage
此模板要求输入为 json 格式的数据存储实体,而不仅仅是任何 json 对象,如此处所述:https://cloud.google.com/dataflow/docs/guides/templates/provided-batch#cloud-storage-text-to-datastore
您需要遵守的格式在这里:https://cloud.google.com/datastore/docs/reference/data/rest/v1/Entity