我的AVRO架构有一个fileObject
记录,但是我需要将其更改为fileObject
的数组。我该怎么办?
{
"name": "file",
"type": ["null", {
"type": "record",
"name": "FileObject",
"doc": "file object",
"fields": [{
"name": "fileUrl",
"type": ["null", "string"],
"doc": "url of the file"
},
{
"name": "spId",
"type": ["null", "string"],
"doc": "space id"
},
{
"name": "contentId",
"type": ["null", "string"],
"doc": "content id of the file"
},
{
"name": "versionId",
"type": ["null", "string"],
"doc": "version id of the file"
}
]
}]
},
答案 0 :(得分:0)
我让它起作用
{
"name": "files",
"type": {
"type": "array",
"items":{
"name": "FileObjects",
"type": "record",
"fields":[{
"name": "fileUrl",
"type": ["null", "string"],
"doc": "url of the file"
},
{
"name": "sId",
"type": ["null", "string"],
"doc": "sid of the file"
},
{
"name": "contentId",
"type": ["null", "string"],
"doc": "content id of the file"
},
{
"name": "versionId",
"type": ["null", "string"],
"doc": "version id of the file"
}]
}
},
"default": []
}