If I have two avsc files the plugin would create different objects for records until 1.13.0. But since this version avro plugin throws Can’t redefine error in ParseContext.java.
1st schema:
{
"type": "record",
"name": "MessageKey",
"namespace": "com.example.domain",
"doc": "Kafka message key.",
"fields": [
{
"name": "id",
"type": {
"type": "string",
"avro.java.string": "String"
},
"doc": "The ID."
},
{
"name": "provenance",
"type": {
"name": "Provenance",
"type": "record",
"fields": [
{
"name": "orderId",
"type": "boolean"
}
]
}
}
]
}
2nd schema:
{
"type": "record",
"name": "Programme",
"namespace": "com.example.domain",
"doc": "A Programme.",
"fields": [
{
"name": "id",
"type": {
"type": "string",
"avro.java.string": "String"
},
"doc": "The id of the programme."
},
{
"name": "provenance",
"type": {
"name": "Provenance",
"type": "record",
"fields": [
{
"name": "orderId",
"type": "boolean"
}
]
}
}
]
}
Tried debugging, found that ParseContext throws “Can’t redefine: ” error in line 219. It checks visited objects, whether the same named schema’s structure is the same.
Already visited and expected object that it’s comparing is
{"name":"Provenance","type":"record","fields":[{"name":"orderId","type":"boolean"}]}
,
but then the same object is found a second time and it differs for some reason:
{"type":"record","name":"Provenance","namespace":"com.example.domain"}
John Bubbles is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1