1

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"}]}
          ]
        }
Belphegor
  • 4,456
  • 11
  • 34
  • 59
spark_dream
  • 326
  • 2
  • 8
  • 23

1 Answers1

2

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.

spark_dream
  • 326
  • 2
  • 8
  • 23