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/06/04 21:01:52 UTC
[GitHub] [beam] damccorm opened a new issue, #21066: Protobuf schema provider row functions break on camel-case field names
damccorm opened a new issue, #21066:
URL: https://github.com/apache/beam/issues/21066
ProtoByteBuddyUtils.protoGetterName() _depends_ on field names being snake-case. But the Protobuf style guide only _recommends_ that field names are so defined.
Snake-case is not enforced by protoc and my team have always created proto field names in camel-case (perhaps we didn't understand that protoc would automatically rewrite field names for us). It is likely that we are not alone.
If one calls a row function against a proto instance whose field were defined in camel-case, an IllegalArgumentException results from the ProtoByteBuddyUtils snake-case assumption.
```
SerializableFunction myRowFunction = new ProtoMessageSchema().toRowFunction(new TypeDescriptor<MyDataModel.ProtoPayload>()
{});
MyDataModel.ProtoPayload payload = …
Row row = (Row) myRowFunction.apply(payload);
```
Imported from Jira [BEAM-12736](https://issues.apache.org/jira/browse/BEAM-12736). Original Jira may contain additional context.
Reported by: chrishinds.
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org