Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-2406] Fix NullPointerException when writing an empty table #3293

Closed
wants to merge 2 commits into from

Conversation

reuvenlax
Copy link
Contributor

When writing to an empty table, BigQueryIO was throwing a NPE because WritePartitions was returning null. This was a regression in previous behavior.

R: @jkff

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 70.606% when pulling 2c6e4b4 on reuvenlax:fix_bq_npe into 0cba43e on apache:master.

Copy link
Contributor

@jkff jkff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will merge now.

@asfgit asfgit closed this in 09d75a0 Jun 5, 2017
@@ -79,6 +80,7 @@
public final DestinationT destination;

public Result(String filename, Long fileByteSize, DestinationT destination) {
checkNotNull(destination);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time, I'd suggest this.destination = checkNotNull(destination).

Sholudn't the filename and fileByteSize also be non-nullable?

@@ -126,8 +129,8 @@ public void processElement(ProcessContext c) throws Exception {
// Return a null destination in this case - the constant DynamicDestinations class will
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is out of date -- it doesn't return a null destination, it returns the default destination according to dynamiDestinations.getDestination(...)

@reuvenlax reuvenlax deleted the fix_bq_npe branch December 9, 2018 23:01
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.

None yet

4 participants