Reputation: 346
I have a nested JSON structure as shown below. When I do avro.schema.Parse using python3 I get an error.
avro.schema.SchemaParseException: Unknown named schema 'record', known names:[data.info]
{"namespace" : "data",
"type": "record",
"name": "info",
"doc": "A list of strings.",
"fields": [
{"name": "DATE", "type": "string"},
{"name": "file", "type": "string"},
{"name": "info", "type": "record", "fields": [
{"name": "START_DATE", "type": "string"},
{"name": "END_DATE", "type": "string"},
{"name": "other", "type": "array", "items":"string"}]}
]
}
Upvotes: 1
Views: 4049
Reputation: 346
The problem was with the nested avro sctructure, I could solve this by follwing Avro-nested schemas Also using avro-json-validator could help to find the problem as soon as we write the .avsc files. A successful conversion to JSON tells that the avro.schema.Parse would work fine.I validated the next further updates I did to the .avsc file using this which worked fine.
Upvotes: 2