是否可以在具有Avro的地图中使用非字符串作为键?
我发现了这个问题AVRO-680,该问题声称已添加了非字符串键支持,但是我找不到任何示例,也无法从补丁中弄清楚新支持如何与模式一起使用。
我想做这样的事情:
"name": "aThing","type": "record","fields": [
{ "name": "aMapOfThings","type": {
"type": "map","keys": "MyKeyType","values": "MyValueType"
}
}
]
或在avdl
中:
record aThing {
map<MyKeyType,MyValueType> aMapOfThings = [:];
}
就像这样的protobuf问题:Protobuf objects as Keys in Maps