Skip to content

Conversation

@Fokko
Copy link
Contributor

@Fokko Fokko commented Feb 25, 2021

The left hand side of the comparison can be equal as well.

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.

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @iemejia).
  • Format the pull request title like [BEAM-11864] Fixes bug in ApproximateQuantiles, where you replace BEAM-11864 with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Dataflow Flink Samza Spark Twister2
Go Build Status --- Build Status --- Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status
Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
--- Build Status ---
XLang Build Status Build Status Build Status --- Build Status ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status --- --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@Fokko Fokko force-pushed the fd-add-objects-equals branch from a0c30ee to 6baa7d6 Compare February 25, 2021 13:34
The left hand side of the comparison can be equal as well
@Fokko Fokko force-pushed the fd-add-objects-equals branch 2 times, most recently from ba8a001 to 45b64d3 Compare February 25, 2021 14:55
@pabloem
Copy link
Member

pabloem commented Feb 25, 2021

thanks! LGTM.

@pabloem pabloem merged commit 6de53b4 into apache:master Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants