apache / apache/beam

Allow null as leftNullValue/rightNullValue in Join.fullOuterJoin()

Open
#18,869 0 comments 0 reactions 0 assignees View on GitHub
extensions improvement java join-library P3
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

When using the [Join.fullOuterJoin()](https://beam.apache.org/documentation/sdks/javadoc/2.4.0/org/apache/beam/sdk/extensions/joinlibrary/Join.html#fullOuterJoin-org.apache.beam.sdk.values.PCollection-org.apache.beam.sdk.values.PCollection-V1-V2-), a checkNotNull() is done for the [leftNullValue](https://github.com/apache/beam/blob/master/sdks/java/extensions/join-library/src/main/java/org/apache/beam/sdk/extensions/joinlibrary/Join.java#L207) and [rightNullValue](https://github.com/apache/beam/blob/master/sdks/java/extensions/join-library/src/main/java/org/apache/beam/sdk/extensions/joinlibrary/Join.java#L208).

However, it makes more sense to allow null values, since sometimes, if the key used for the join is not the same, you'd like to see that the value will become null. This should be decided by the developer, and not by the join library.

Looking at the source code, this is also supported by [KV.of()](https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/values/KV.java#L42) (it allows null values), which is used in Join.fullOuterJoin().

If required, I can create a pull request on GitHub.

Imported from Jira [BEAM-4114](https://issues.apache.org/jira/browse/BEAM-4114). Original Jira may contain additional context.
Reported by: rtrietsch.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.