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 2021/06/14 07:10:21 UTC

[GitHub] [beam] reubenvanammers edited a comment on pull request #14974: [BEAM-12464] Change ProtoSchemaTranslator beam schema creation to match the order for protobufs containing Oneof fields

reubenvanammers edited a comment on pull request #14974:
URL: https://github.com/apache/beam/pull/14974#issuecomment-859175251


   >  Can you explain the use case where this is necessary?
   
   How I noticed this was when I was trying to convert a Beam Row into a protobuf, with the OneOf not in the first position. During the conversion, the it converts in the order of the converters, which in turn is the order of the generated Schema. Because the OneOf field is first in the generated schema, the first field in the row is attempted to be converted to a proto OneOf,  which then fails. Basically this means that Rows containing OneOfs can't be converted to protos, except if all of the OneOfs are at the start of the row. 
   
   Obviously there are workarounds (I.e. reordering the beam row before converting to protobuf) , but I believe that the behaviour is surprising enough to warrant changing one way or the other. 


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