I am trying to serialize data with unsigned values to AVRO, but I see only signed int, long, float and double are supported by the AVRO libraries.
I could not find any native support for unsigned values in AVRO libraries.
Can you please help me in pointing to any references for serializing unsigned values with AVRO libraries or any workaround for this?
One workaround I can think of is, treat unsigned long as byte array and have custom methods to serialize and de-serialize it back to unsigned long.
In Avro schema, write it as
long
and while serializing cast original propertyulong
property aslong
.Original Property
Schema can be
Then Avro schema will generate a class with same data type and you have to serialize that with type casting.