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

beam:coder:row:v1 implementations should respect encoding_position

Details

    • Improvement
    • Status: Open
    • P3
    • Resolution: Unresolved
    • None
    • None
    • sdk-java-core, sdk-py-core

    Description

      Problem/Status

      The schema proto has an encoding_position field that is currently unused in every row coder implementation. The intention of this field is that it indicates an alternative order for the fields to be encoded in by beam:coder:row:v1 implementations. Currently all the implementations ignore this field, and always encode the fields in the order that they appear in the schema.

      Motivation

      The idea with the encoding position is that it will give runners a way to enforce schema compatibility (BEAM-9502), by re-ordering the way fields are encoded when the schema changes between two job submissions. Schema changes could be due to fields re-ordering, or field additions/deletions.

      Code pointers

      The Python beam:coder:row:v1 implementation lives in row_coder.py
      The Java implementation is a little more complicated, distributed between SchemaCoder, RowCoder, and RowCoderGenerator. RowCoderGenerator contains the code relevant to this jira - it uses bytebuddy to generate Java code for the coder. We need it to generate code that puts fields in the order specified by encoding_position.

      Testing

      Python and Java implementations should be tested with unit tests (RowCoderTest, row_coder_test). We should also test them for compatibility by adding test cases that exercise the encoding_position in standard_coders.yaml. These tests will be executed by CommonCoderTest and standard_coders_test. There's some example code for generating a new test case here.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bhulette Brian Hulette
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 31h 50m
                  31h 50m