flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] dawidwys commented on issue #8187: [FLINK-12197] [Formats] Avro row deser for Confluent binary format
Date Tue, 23 Apr 2019 16:01:13 GMT
dawidwys commented 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 {
     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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message