Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BigQuery client throws NullPointerException when estimatedFields is empty #3982

@lgajowy

Description

@lgajowy

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!

Metadata

Metadata

Assignees

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions