danny0405 commented on a change in pull request #12919: URL: https://github.com/apache/flink/pull/12919#discussion_r458724014
########## File path: flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/AvroRowDataSerializationSchema.java ########## @@ -64,61 +41,59 @@ private static final long serialVersionUID = 1L; + /** Nested schema to serialize the {@link GenericRecord} into bytes. **/ + private final SerializationSchema<GenericRecord> nestedSchema; + /** * Logical type describing the input type. */ private final RowType rowType; - /** - * Runtime instance that performs the actual work. - */ - private final SerializationRuntimeConverter runtimeConverter; - /** * Avro serialization schema. */ private transient Schema schema; /** - * Writer to serialize Avro record into a Avro bytes. - */ - private transient DatumWriter<IndexedRecord> datumWriter; - - /** - * Output stream to serialize records into byte array. + * Runtime instance that performs the actual work. */ - private transient ByteArrayOutputStream arrayOutputStream; + private final RowDataToAvroConverters.RowDataToAvroConverter runtimeConverter; /** - * Low-level class for serialization of Avro values. + * Creates an Avro serialization schema with the given record row type. */ - private transient Encoder encoder; + public AvroRowDataSerializationSchema(RowType rowType) { Review comment: Why not, the avro row data format is default to SE/DE avro without schema, if other formats what to customize something, use the correct constructor. Write the same code everywhere just makes no sense. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org