[
https://issues.apache.org/jira/browse/BEAM-1714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15959901#comment-15959901
]
Mark Shalda commented on BEAM-1714:
-----------------------------------
This looks like an issue in TableRow itself and not something in Beam. I'm able
to produce the NullPointerException with the following code:
{code}
new TableRow().set("name", null).hashCode();
{code}
That is, the TableRow object does not expect to be configured with any null
values. The right thing to do here is simply omit fields with null values when
creating the TableRow.
Though this is not a bug in Beam, it manifests in Beam because the DirectRunner
has new checks of pipeline sanity that call hashCode. The bug was present but
not triggered in 1.9.0. While the preferred solution is to not include these
fields in the TableRow in the first place, you may turn off the DirectRunner's
ImmutabilityEnforcement check by setting the --enforceImmutability=false
pipeline option to get the 1.9.0-equivalent behavior.
> Null Pointer Exception when outputting a TableRow with a Null value for a key
> -----------------------------------------------------------------------------
>
> Key: BEAM-1714
> URL: https://issues.apache.org/jira/browse/BEAM-1714
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-gcp
> Affects Versions: 0.5.0
> Reporter: Tobias Feldhaus
> Assignee: Mark Shalda
> Labels: newbie, starter
> Fix For: First stable release
>
>
> When outputting a TableRow that has a Null value for a key, a Null Pointer
> Exception is thrown. In the Dataflow SDK (1.9) this case is handled by
> outputting NULL for that field.
> I would expect the same behavior from the Beam SDK - since otherwise there is
> always a lot of Null checking necessary in the user code. (Especially when
> there are nested fields.)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)