@Override
	public byte[] serialize(Tuple2<Boolean,Row> tuple2) {
		try {
			Row row = tuple2.f1;
			boolean change = tuple2.f0;

			// convert to record
			final GenericRecord record = convertRowToAvroRecord(schema, row);

			dealRetractField(change, record);

			arrayOutputStream.reset();
			datumWriter.write(record, encoder);
			encoder.flush();
			return arrayOutputStream.toByteArray();
		} catch (Exception e) {
			throw new RuntimeException("Failed to serialize row.", e);
		}
	}
Creates an Avro serialization schema for the given Avro schema string.

@param avroSchemaString Avro schema string used to serialize Flink's row to Avro's record
kafka-base/kafka-base-sink/src/main/java/com/dtstack/flink/sql/sink/kafka/serialization/AvroTuple2SerializationSchema.java