[
https://issues.apache.org/jira/browse/BEAM-12464?focusedWorklogId=690393&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-690393
]
ASF GitHub Bot logged work on BEAM-12464:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Dec/21 00:06
Start Date: 04/Dec/21 00:06
Worklog Time Spent: 10m
Work Description: ibzib commented on pull request #14974:
URL: https://github.com/apache/beam/pull/14974#issuecomment-985921044
@reubenvanammers can you address this comment? There may not be an issue but
I wanted to make sure. Let's add your new test cases to
ProtoDynamicMessageSchemaTest as well and see what happens.
> 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]
Issue Time Tracking
-------------------
Worklog Id: (was: 690393)
Time Spent: 5.5h (was: 5h 20m)
> Change ProtoSchemaTranslator beam schema creation to match the order for
> protobufs containing Oneof fields
> ----------------------------------------------------------------------------------------------------------
>
> Key: BEAM-12464
> URL: https://issues.apache.org/jira/browse/BEAM-12464
> Project: Beam
> Issue Type: Improvement
> Components: extensions-java-protobuf
> Reporter: Reuben van Ammers
> Priority: P3
> Time Spent: 5.5h
> Remaining Estimate: 0h
>
> Currently, when ProtoSchemaTranslator creates the beam schema from a protobuf
> definition it always puts the Oneofs at the start of the beam schema due to
> Oneofs being created from the code first. This means that the order of the
> fields doesn't match the order of the protobuf defintion. As the schema
> generation is used when converting from beam rows to protobufs, it
> additionally means that it is impossible to convert from a beam row where the
> oneof fields are not the first fields in the beamrow.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)