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

NPE when registering fromRowFunction

Details

    • Bug
    • Status: Resolved
    • P1
    • Resolution: Fixed
    • None
    • 2.29.0
    • runner-dataflow
    • None

    Description

      When registering multiple coders, it will produce a NPE when checking if the fromRowFunction is already registered:
      ```
      [WARNING]
      java.lang.NullPointerException
      at org.apache.beam.sdk.schemas.utils.AvroUtils$RowToGenericRecordFn.equals (AvroUtils.java:559)
      at org.apache.beam.sdk.schemas.SchemaCoder.equals (SchemaCoder.java:208)
      at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Objects.equal (Objects.java:52)
      at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.HashBiMap.seekByKey (HashBiMap.java:224)
      at org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.HashBiMap.get (HashBiMap.java:254)
      at org.apache.beam.runners.core.construction.SdkComponents.registerCoder (SdkComponents.java:265)
      at org.apache.beam.runners.core.construction.PCollectionTranslation.toProto (PCollectionTranslation.java:35)
      at org.apache.beam.runners.core.construction.SdkComponents.registerPCollection (SdkComponents.java:227)
      at org.apache.beam.runners.core.construction.PTransformTranslation.translateAppliedPTransform (PTransformTranslation.java:479)
      at org.apache.beam.runners.core.construction.PTransformTranslation$KnownTransformPayloadTranslator.translate (PTransformTranslation.java:424)
      at org.apache.beam.runners.core.construction.PTransformTranslation.toProto (PTransformTranslation.java:239)
      at org.apache.beam.runners.core.construction.SdkComponents.registerPTransform (SdkComponents.java:175)
      at org.apache.beam.runners.core.construction.PipelineTranslation$1.visitPrimitiveTransform (PipelineTranslation.java:87)
      at org.apache.beam.sdk.runners.TransformHierarchy$Node.visit (TransformHierarchy.java:587)
      at org.apache.beam.sdk.runners.TransformHierarchy$Node.visit (TransformHierarchy.java:579)
      at org.apache.beam.sdk.runners.TransformHierarchy$Node.access$500 (TransformHierarchy.java:239)
      at org.apache.beam.sdk.runners.TransformHierarchy.visit (TransformHierarchy.java:213)
      at org.apache.beam.sdk.Pipeline.traverseTopologically (Pipeline.java:468)
      at org.apache.beam.runners.core.construction.PipelineTranslation.toProto (PipelineTranslation.java:59)
      at org.apache.beam.runners.dataflow.DataflowRunner.run (DataflowRunner.java:933)
      at org.apache.beam.runners.dataflow.DataflowRunner.run (DataflowRunner.java:196)
      at org.apache.beam.sdk.Pipeline.run (Pipeline.java:322)
      at ....PubsubToBigQuery.main (PubsubToBigQuery.java:98)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282)
      at java.lang.Thread.run (Thread.java:748)
      ```

      This is because when you register a GenericRecord, the schema will be null, resulting in the NPE above.

      Attachments

        Issue Links

          Activity

            People

              fokko Fokko Driesprong
              fokko Fokko Driesprong
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h