Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-12736

Protobuf schema provider row functions break on camel-case field names

Details

    • Bug
    • Status: Open
    • P3
    • Resolution: Unresolved
    • 2.31.0
    • None
    • None

    Description

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chrishinds Chris Hinds
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Time Spent - 3h 10m Remaining Estimate - 20h 50m
                  20h 50m
                  Logged:
                  Time Spent - 3h 10m Remaining Estimate - 20h 50m
                  3h 10m