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

BigQuery client throws NullPointerException when estimatedFields is empty #3982

Closed
lgajowy opened this issue Nov 16, 2018 · 1 comment
Closed
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@lgajowy
Copy link

lgajowy commented Nov 16, 2018

Environment details

  • OS: linux /macos
  • Java version: 8
  • google-cloud-java version(s): ???

Steps to reproduce

  1. Run the following code:
BigQueryOptions options = BigQueryOptions.newBuilder().build();
BigQuery client = options.getService();

TableId tableId = TableId.of(projectId, dataset, tableName);

// no options - all table fields are fetched
client.getTable(tableId);

Stacktrace

Exception in thread "main"
java.lang.NullPointerException
at com.google.cloud.bigquery.StandardTableDefinition$StreamingBuffer.fromPb(StandardTableDefinition.java:116)
at com.google.cloud.bigquery.StandardTableDefinition.fromPb(StandardTableDefinition.java:225)
at com.google.cloud.bigquery.TableDefinition.fromPb(TableDefinition.java:155)
at com.google.cloud.bigquery.TableInfo$BuilderImpl.<init>(TableInfo.java:183)
at com.google.cloud.bigquery.Table.fromPb(Table.java:593)
at com.google.cloud.bigquery.BigQueryImpl.getTable(BigQueryImpl.java:410)
at org.apache.beam.sdk.testutils.publishing.BigQueryClient.createTableIfNotExists(BigQueryClient.java:74)
at org.apache.beam.sdk.nexmark.Main.savePerfsToBigQuery(Main.java:184)
at org.apache.beam.sdk.nexmark.Main.runAll(Main.java:148)
at org.apache.beam.sdk.nexmark.Main.runAll(Main.java:98)
at org.apache.beam.sdk.nexmark.Main.main(Main.java:423)

Any additional information below

This happens only if table.streamingBuffer.estimatedFields field is null in table. This is not allways the case but when it is null the exception appears.

See more info here: https://issues.apache.org/jira/browse/BEAM-6076

Thanks!

@chingor13 chingor13 added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Nov 16, 2018
@lgajowy
Copy link
Author

lgajowy commented Nov 20, 2018

Thanks for fixing this! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants