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

Improve coder inference for WithKeys.of(null)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0
    • Component/s: sdk-java-core
    • Labels:
      None

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: