Hi,
I've read the part "Schema Resolution" of the Avro Specification. So I
think that avro supports versioning of the schema.
But when I try to change to following schema, an AvroTypeException will
be thrown by reading data that was serialized with the old schema:
{
"name":"BrowserCountArray",
"type":"record",
"fields": [
{
"name":"BrowserCounts",
"type":
{
"type":"array",
"items": {
"name": "BrowserCount",
"type": "record",
"fields": [
{
"name":"Browser",
"type":"string"
}, {
"name":"Count",
"type":"int"
}]
}
}
}]
}
For example I add a new field to the BrowserCount record like this:
{
"name":"BrowserCountArray",
"type":"record",
"fields": [
{
"name":"BrowserCounts",
"type":
{
"type":"array",
"items": {
"name": "BrowserCount",
"type": "record",
"fields": [
{
"name":"Browser",
"type":"string"
}, {
"name":"Count",
"type":"int"
}, {
"name":"Blub",
"type":"int",
"default":"0"
}]
}
}
}]
}
Is it possible to add or remove fields from this record and read with
this new schema data, that was serialized with an old one.
Or is there another way to define an array of record which solves that
problem.
Thanks,
Robin