0

I have a class as given below

class A
{
private   Map<Long ,Set<Long>> x;
private   Map<Long ,Set<Long>> y;}

When avro tries to create schema using reflection it creates the schema having the name of the map as Pair620b9c15f622a7 for both the fields. ANd hence I get the exception

Schema s = ReflectData.get().getSchema(A.class);

I am not sure as of why I am getting this error , though the field names are completely different.

1 solution for this might be to explicitly define the name of x and y in the schema using @AvroSchema annotation, but that is very manual task and I have to do it for all such mappings in my code

1 Answers1

0

pretty similar to what I just answered here Generate Avro file based on java file. TRy using kite sdk util class

hlagos
  • 7,690
  • 3
  • 23
  • 41