Sunil Srinivasa
08/22/2023, 5:12 PMOutputTag[AvroSpecificrecord] , AvroSpecificRecord is deeply nested object with multiple other record type:
I’ve tried passing TypeInformation like this:
1. new AvroTypeInfo[AvroSpecificRecord](classOf[AvroSpecificRecord])
2. AvroSchemaConverter.convertToTypeInfo(AvroSpecificRecord.getClassSchema.toString(true))
e.g: new OutputTag("side-output-1", AvroSchemaConverter.convertToTypeInfo(AvroSpecificRecord.getClassSchema.toString(true)))
But Flink is not using this TypeInformation and using reflection based type detection.
INFO org.apache.flink.api.java.typeutils.TypeExtractor [] - Field AvroSpecificRecord#field1 will be processed as GenericType. Please read the Flink documentation on "Data Types & Serialization" for details of the effect on performance and schema evolution
Please helpSameer Chandra
08/22/2023, 6:17 PMSunil Srinivasa
08/22/2023, 6:23 PMTypeInformation.of(classOf[AvroSpecificRecord])
type information like this, it will be automatically understood by Flink and not treated as Generic?Sunil Srinivasa
08/22/2023, 6:58 PMKafkaSink[AvroSpecificRecord]
It is treating OUT type as GenericTypeSunil Srinivasa
08/22/2023, 7:04 PMSunil Srinivasa
08/22/2023, 7:08 PMList<String> in the Avro Schema, that means Generic type. But I want to avoid issue by using Avro SerializerSunil Srinivasa
08/22/2023, 7:17 PMAvroSerializer based on the object type used in the OUT typeSameer Chandra
08/23/2023, 11:09 AMSameer Chandra
08/23/2023, 11:10 AMSpecificRecord and not SpecificRecordBase, Flink will not see this as an Avro type. Instead, it will use Kryo to de/serialize any objects which may be considerably slower.Sunil Srinivasa
08/23/2023, 12:32 PMAvroSpecificrecord extends SpecificRecordBase since it is auto generated Avro class from Maven PluginSunil Srinivasa
08/23/2023, 12:44 PMArdit Elezi
01/24/2024, 8:17 PM