dawidwys edited a comment on issue #8187: [FLINK-12197] [Formats] Avro row 
deser for Confluent binary format
URL: https://github.com/apache/flink/pull/8187#issuecomment-485867174
 
 
   By wrapper I meant actual wrapper, by composition not through inheritance. I 
am pretty sure you can have. `AvroRowDeserializationSchema` that accepts e.g. 
   
   ```
   interface AvroDeserializationSchemaProvider {
     DeserializationSchema<GenericRecord> get(Schema schema);
   }
   ```
   This is to ensure the same schema is used for both the inner deserialization 
schema as well as for transforming from `GenericRecord` to `Row`.
   
   Then in the `AvroRowDeserializationSchema` you would have sth like:
   
   ```
   class AvroRowDeserializationSchema {
     
           private final DeserializationSchema<GenericRecord> 
innerDeserializationSchema;
   
           .....
   
        @Override
        public Row deserialize(byte[] message) throws IOException {
               GenericRecord row = 
innerDeserializationSchema.deserialize(message);
               return convertAvroRecordToRow(row);
           }
   
           ....
   }
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to