Apache Avro: map uses CharSequence as key

前端 未结 6 1443
别跟我提以往
别跟我提以往 2020-12-05 15:42

I am using Apache Avro.

My schema has map type:

{\"name\": \"MyData\", 
  \"type\" :  {\"type\": \"map\", 
              \"values\":{
                        


        
6条回答
  •  情话喂你
    2020-12-05 16:24

    Apparently, by default, Avro uses CharSequence. I found a way to configure it to convert to String

    From Avro 1.6.0 onward, there is an option to have Avro always perform the conversion to String. There are a couple of ways to achieve this. The first is to set the avro.java.string property in the schema to String:

             { "type": "string", "avro.java.string": "String" }
    

    I have not tested this.

提交回复
热议问题