I am using Apache Avro.
My schema has map type:
{"name": "MyData",
"type" : {"type": "map",
"values":{
"type": "record",
"name": "Person",
"fields":[
{"name": "name", "type": "string"},
{"name": "age", "type": "int"},
]
}
}
}
After compile the schema, the genated Java class use CharSequence
as the key for the Map
MyData
.
It is very inconvenient to use CharSequence
in Map
as key, is there a way to generate String
type key for Map
in Apache Avro?
P.S.
Problem is that, for example dataMap.containsKey("SOME_KEY")
will returns false
even though there is such key there, just because it is CharSequence
. Besides, put an map entry with a existing key doesn't relpace the old one. That's why I say it is inconvenient to use CharSequence
as key.
Map
you get actually use non-String
keys?