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

Create should take a TypeDescriptor as an alternative to explicitly specifying the Coder

Details

    • Improvement
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • None
    • 0.6.0
    • sdk-java-core

    Description

      getDefaultCreateCoder is provided with the Pipeline's CoderRegistry, which enables it to use standard Coder Inference. For the construction of the Default Create Coder, explicitly providing the TypeDescriptor allows it to ask the CoderRegistry directly rather than attempting to reconstruct the TypeDescriptor based on the elements within the Create.

      This also makes some coder specifications significantly more terse, as the type signature must be respecified but the entire coder need not be constructed (e.g. KvCoder.of(VarIntCoder.of(), StringUtf8Coder.of()); becomes new TypeDescriptor<KV<Integer, String>>() {};, which is at least somewhat simpler to type out.

      Attachments

        Issue Links

          Activity

            People

              aviemzur Aviem Zur
              tgroh Thomas Groh
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: