maduris commented on pull request #14974:
URL: https://github.com/apache/beam/pull/14974#issuecomment-939391046


   hi @reubenvanammers,
   
   Glad you are already looking to the same issue we are facing.
   
   I believe the convert function needs to be also updated to use the 
identifier number instead of the enum index on line
   oneOfConvert has indices using the identifiers from proto definition where 
oneOf only has enum value.
   
   
https://github.com/apache/beam/blob/master/sdks/java/extensions/protobuf/src/main/java/org/apache/beam/sdk/extensions/protobuf/ProtoDynamicMessageSchema.java#L731
   
   Something like?
   
   `        @Override
           void setOnProtoMessage(Message.Builder message, OneOfType.Value 
oneOf) {
               int caseIndex = oneOf.getCaseType().getValue();
               int convertIndex =
                   
logicalType.getCaseEnumType().valueOf(logicalType.getCaseEnumType().getValues().get(caseIndex)).getValue();
               oneOfConvert.get(convertIndex).setOnProtoMessage(message, 
oneOf.getValue());
           }`
   
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to