gpt4 book ai didi

amazon-web-services - AVRO 模式的 JSON 看起来有效但返回 Input is not a valid Avro schema

转载 作者:行者123 更新时间:2023-12-04 15:38:52 24 4
gpt4 key购买 nike

我正在尝试将数据上传到 AWS Personalize 中的用户数据集。该架构包含我的 CSV 的结构。我在线检查了它的 JSON,它显示了有效的 JSON。

{
"type": "record",
"name": "Users",
"namespace": "com.amazonaws.personalize.schema",
"fields": [
{
"name": "user_id",
"type": "string"
},
{
"name": "address",
"type": "record",
"fields" : [
{"name": "address1", "type": "string"},
{"name": "address2", "type": "string"},
{"name": "city", "type": "string"},
{"name": "state", "type": "string"},
{"name": "postalCode", "type": "int"},
{"name": "coordinates", "type": "record",
"fields" : [
{"name": "lat", "type": "float"},
{"name": "lng", "type": "float"}
]}
]
},
{
"name": "firstName",
"type": "string"
},
{
"name": "followRequestId",
"type": "array",
"items": "string"
},
{
"name": "followers",
"type": "array",
"items": "string"
},
{
"name": "fullName",
"type": "string"
},
{
"name": "gender",
"type": "string"
},
{
"name": "interests",
"type": "array",
"items": "string"
},
{
"name": "lastActive",
"type": "long"
},
{
"name": "lastName",
"type": "string"
},
{
"name": "network",
"type": "list"
},
{
"name": "paymentDetails",
"type": "int"
},
{
"name": "personalOccasions",
"type": "array",
"items": "string"
},
{
"name": "productLikeDislike",
"type": "array",
"items": "string"
},
{
"name": "registrationDate",
"type": "long"
},
{
"name": "rewardId",
"type": "string"
},
{
"name": "wishList",
"type": "array",
"items": "string"
}
],
"version": "1.0"
}

最佳答案

您没有正确编写记录字段。

例子:

...
{
"name":"address1",
"type":{
"type":"record",
"name": "address",
"fields": [...]
}
}
...

因此,当您将记录写成字段时,首先是字段名称,然后是“通用”记录(类似于类:address1 是变量,address 是类)。

关于amazon-web-services - AVRO 模式的 JSON 看起来有效但返回 Input is not a valid Avro schema,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58766368/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com