-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fast generic serializer enums fixed #4
Conversation
For now marked as ignored due to: class com.linkedin.avro.fastserde.generated.avro.JustSimpleEnum cannot be cast to class org.apache.avro.generic.GenericData$EnumSymbol (com.linkedin.avro.fastserde.generated.avro.JustSimpleEnum and org.apache.avro.generic.GenericData$EnumSymbol are in unnamed module of loader 'app') java.lang.ClassCastException: class com.linkedin.avro.fastserde.generated.avro.JustSimpleEnum cannot be cast to class org.apache.avro.generic.GenericData$EnumSymbol (com.linkedin.avro.fastserde.generated.avro.JustSimpleEnum and org.apache.avro.generic.GenericData$EnumSymbol are in unnamed module of loader 'app') at com.linkedin.avro.fastserde.generated.serialization.AVRO_1_10.FastSerdeEnums_GenericSerializer_957378572.serializeFastSerdeEnums0(FastSerdeEnums_GenericSerializer_957378572.java:26) at com.linkedin.avro.fastserde.generated.serialization.AVRO_1_10.FastSerdeEnums_GenericSerializer_957378572.serialize(FastSerdeEnums_GenericSerializer_957378572.java:19) at com.linkedin.avro.fastserde.generated.serialization.AVRO_1_10.FastSerdeEnums_GenericSerializer_957378572.serialize(FastSerdeEnums_GenericSerializer_957378572.java:11) at com.linkedin.avro.fastserde.FastGenericSerializerGeneratorTest.dataAsBinaryDecoder(FastGenericSerializerGeneratorTest.java:615) at com.linkedin.avro.fastserde.FastGenericSerializerGeneratorTest.dataAsBinaryDecoder(FastGenericSerializerGeneratorTest.java:604) at com.linkedin.avro.fastserde.FastGenericSerializerGeneratorTest.shouldWriteSpecificRecordWithEnums(FastGenericSerializerGeneratorTest.java:192)
using fast-generic-serializer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Root cause: when FastGenericSerializer
serializes specific record then SchemaAssistant.classFromSchema()
returns
codeModel.ref(GenericData.EnumSymbol.class)
which is incorrect - specific record has its own Java-enum which inherits from GenericEnumSymbol
, not org.apache.avro.generic.GenericData.EnumSymbol
You could concisely clarify here what is the root cause of this problem and how it is resolved in the committed changes. |
specific record using fast-generic-serializer.
PR to source repository (linkedin) was created: |
It aims to fix below exception
There are some extra commits so that we can see the actual changes of generated classes (and normally these classes are in .gitignore).