You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/09/15 11:53:46 UTC

[GitHub] [beam] scwhittle commented on issue #20978: PubsubIO.readAvroGenericRecord creates SchemaCoder that fails to decode some Avro logical types

scwhittle commented on issue #20978:
URL: https://github.com/apache/beam/issues/20978#issuecomment-1248000367

   I don't think so, internal impl just replaces PubsubUnboundedSource which is before the ParseFn.
   I'm not even sure if this bug is really that pubsub specific or just a coder issue with SchemaCoder/AvroCoder compatibility.
   
   Unless the bug is just that PubsubIO is doing somethign wrong with the implementation of that method
   
       Schema schema = AvroUtils.getSchema(GenericRecord.class, avroSchema);
       AvroCoder<GenericRecord> coder = AvroCoder.of(GenericRecord.class, avroSchema);
       return Read.newBuilder(parsePayloadUsingCoder(coder))
           .setCoder(
               SchemaCoder.of(
                   schema,
                   TypeDescriptor.of(GenericRecord.class),
                   AvroUtils.getToRowFunction(GenericRecord.class, avroSchema),
                   AvroUtils.getFromRowFunction(GenericRecord.class)))
           .build();
   


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org