I am using Apache Avro .
My scheme has a map type:
{"name": "MyData", "type" : {"type": "map", "values":{ "type": "record", "name": "Person", "fields":[ {"name": "name", "type": "string"}, {"name": "age", "type": "int"}, ] } } }
After compiling the genated schema, the Java class uses CharSequence as the key for Map MyData .
It is very difficult to use CharSequence in the Map as the key, there is a way to generate a key String for the Map in the Apache the Avro ?
PS
The problem is that, for example, dataMap.containsKey("SOME_KEY") will return false , although there is such a key there, just because it is CharSequence . Also, put the record in the card with the existing key, do not move the old one. That's why I say that it is inconvenient to use CharSequence as a key.
source share