i have a question. I made the following avro schema:
{
"namespace": "foo",
"fields": [
{
"type": [
"string",
"null"
],
"name": "narf"
},
{
"namespace": "foo.run",
"fields": [
{
"type": [
"string",
"null"
],
"name": "baz"
}
],
"type": "record",
"name": "foo"
}
],
"type": "record",
"name": "run"
}
When i try to compile this i get the following error:
/usr/bin/python3.4 /home/marius/PycharmProjects/AvroTest/avroTest.py Traceback (most recent call last): File "/home/marius/PycharmProjects/AvroTest/avroTest.py", line 11, in schema = avro.schema.Parse(open("simple.avsc").read())
File "/usr/local/lib/python3.4/dist-packages/avro_python3_snapshot-1.7.7-py3.4.egg/avro/schema.py", line 1283, in Parse return SchemaFromJSONData(json_data, names)
File "/usr/local/lib/python3.4/dist-packages/avro_python3_snapshot-1.7.7-py3.4.egg/avro/schema.py", line 1254, in SchemaFromJSONData return parser(json_data, names=names)
File "/usr/local/lib/python3.4/dist-packages/avro_python3_snapshot-1.7.7-py3.4.egg/avro/schema.py", line 1182, in _SchemaFromJSONObject other_props=other_props,
File "/usr/local/lib/python3.4/dist-packages/avro_python3_snapshot-1.7.7-py3.4.egg/avro/schema.py", line 1061, in init fields = make_fields(names=nested_names)
File "/usr/local/lib/python3.4/dist-packages/avro_python3_snapshot-1.7.7-py3.4.egg/avro/schema.py", line 1173, in MakeFields return tuple(RecordSchema._MakeFieldList(field_desc_list, names))
File "/usr/local/lib/python3.4/dist-packages/avro_python3_snapshot-1.7.7-py3.4.egg/avro/schema.py", line 986, in _MakeFieldList yield RecordSchema._MakeField(index, field_desc, names)
File "/usr/local/lib/python3.4/dist-packages/avro_python3_snapshot-1.7.7-py3.4.egg/avro/schema.py", line 957, in _MakeField names=names,
File "/usr/local/lib/python3.4/dist-packages/avro_python3_snapshot-1.7.7-py3.4.egg/avro/schema.py", line 1254, in SchemaFromJSONData return parser(json_data, names=names)
File "/usr/local/lib/python3.4/dist-packages/avro_python3_snapshot-1.7.7-py3.4.egg/avro/schema.py", line 1135, in _SchemaFromJSONString % (json_string, sorted(names.names)))
avro.schema.SchemaParseException: Unknown named schema 'record', known names: ['foo.run'].
And i have no idea why. In my mind the error is the record called "foo" but the namespace i gave ("foo.run") is in the namespacelist but ut raises an error anyways. I guess i misunderstand something regarding namespaces but i could not figure out what.
Greetings Marius