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

Improve coder inference for WithKeys.of(null)

Details

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

    Description

      WithKeys.<Void, String>of((Void) null)) should choose a VoidCoder as the key coder instead of erroring out.

      java.lang.IllegalStateException: Unable to return a default Coder for
      <transform> [PCollection]. Correct one of the following root causes:
        No Coder has been manually specified;  you may do so using .setCoder().
        Inferring a Coder from the CoderRegistry failed: Cannot provide coder for
      parameterized type org.apache.beam.sdk.values.KV<K, V>: Unable to provide a
      Coder for K.
      

      WithKeysTest#testConstantKeys but using a Void key type should pass coder inference.

      Attachments

        Issue Links

          Activity

            People

              danoliveira Daniel Oliveira
              lcwik Luke Cwik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: