You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is in regards with Client lib for Google Big Query. We are using google-cloud-bigquery:1.44.0 library for one of the our use cases.
We have observed the following behavior:
When we try to fetch a table's metadata that does not have fields, API is
throwing a NPE.
Stack Trace:
Exception in thread "main" java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770)
at com.google.common.collect.Lists$TransformingSequentialList.(Lists.java:569)
at com.google.common.collect.Lists.transform(Lists.java:553)
at com.google.cloud.bigquery.FieldList.fromPb(FieldList.java:116)
at com.google.cloud.bigquery.Schema.fromPb(Schema.java:107)
at com.google.cloud.bigquery.TableDefinition$Builder.table(TableDefinition.java:128)
at com.google.cloud.bigquery.StandardTableDefinition.fromPb(StandardTableDefinition.java:238)
at com.google.cloud.bigquery.TableDefinition.fromPb(TableDefinition.java:163)
at com.google.cloud.bigquery.TableInfo$BuilderImpl.(TableInfo.java:183)
at com.google.cloud.bigquery.Table.fromPb(Table.java:603)
at com.google.cloud.bigquery.BigQueryImpl.getTable(BigQueryImpl.java:415)
at bigquery.BigQueryTest.main(BigQueryTest.java:24)
Page<Table> list = ds_with_empty_tables.list();
for(Table table : list.iterateAll()){
Table t = bqService.getTable(table.getTableId());
System.out.println(1);
}
}
}
#### Stacktrace
Exception in thread "main" java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770)
at com.google.common.collect.Lists$TransformingSequentialList.(Lists.java:569)
at com.google.common.collect.Lists.transform(Lists.java:553)
at com.google.cloud.bigquery.FieldList.fromPb(FieldList.java:116)
at com.google.cloud.bigquery.Schema.fromPb(Schema.java:107)
at com.google.cloud.bigquery.TableDefinition$Builder.table(TableDefinition.java:128)
at com.google.cloud.bigquery.StandardTableDefinition.fromPb(StandardTableDefinition.java:238)
at com.google.cloud.bigquery.TableDefinition.fromPb(TableDefinition.java:163)
at com.google.cloud.bigquery.TableInfo$BuilderImpl.(TableInfo.java:183)
at com.google.cloud.bigquery.Table.fromPb(Table.java:603)
at com.google.cloud.bigquery.BigQueryImpl.getTable(BigQueryImpl.java:415)
at bigquery.BigQueryTest.main(BigQueryTest.java:24)
This is in regards with Client lib for Google Big Query. We are using google-cloud-bigquery:1.44.0 library for one of the our use cases.
We have observed the following behavior:
When we try to fetch a table's metadata that does not have fields, API is
throwing a NPE.
Stack Trace:
Exception in thread "main" java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770)
at com.google.common.collect.Lists$TransformingSequentialList.(Lists.java:569)
at com.google.common.collect.Lists.transform(Lists.java:553)
at com.google.cloud.bigquery.FieldList.fromPb(FieldList.java:116)
at com.google.cloud.bigquery.Schema.fromPb(Schema.java:107)
at com.google.cloud.bigquery.TableDefinition$Builder.table(TableDefinition.java:128)
at com.google.cloud.bigquery.StandardTableDefinition.fromPb(StandardTableDefinition.java:238)
at com.google.cloud.bigquery.TableDefinition.fromPb(TableDefinition.java:163)
at com.google.cloud.bigquery.TableInfo$BuilderImpl.(TableInfo.java:183)
at com.google.cloud.bigquery.Table.fromPb(Table.java:603)
at com.google.cloud.bigquery.BigQueryImpl.getTable(BigQueryImpl.java:415)
at bigquery.BigQueryTest.main(BigQueryTest.java:24)
Sample Code :
public class BigQueryTest {
ServiceAccountCredentials.fromStream(new FileInputStream(""));
BigQueryOptions.newBuilder().setCredentials(googleCredentials).build().getService();
Dataset ds_with_empty_tables = bqService.getDataset("Native_table");
}
Can someone please explain this behavior. The same scenario seems to be
working in API Reference UI - https://cloud.google.com/bigquery/docs/reference/rest/v2/
#### Environment details
#### Steps to reproduce
Sample Code :
public class BigQueryTest {
ServiceAccountCredentials.fromStream(new FileInputStream(""));
BigQueryOptions.newBuilder().setCredentials(googleCredentials).build().getService();
Dataset ds_with_empty_tables = bqService.getDataset("Native_table");
}
#### Stacktrace
Exception in thread "main" java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770)
at com.google.common.collect.Lists$TransformingSequentialList.(Lists.java:569)
at com.google.common.collect.Lists.transform(Lists.java:553)
at com.google.cloud.bigquery.FieldList.fromPb(FieldList.java:116)
at com.google.cloud.bigquery.Schema.fromPb(Schema.java:107)
at com.google.cloud.bigquery.TableDefinition$Builder.table(TableDefinition.java:128)
at com.google.cloud.bigquery.StandardTableDefinition.fromPb(StandardTableDefinition.java:238)
at com.google.cloud.bigquery.TableDefinition.fromPb(TableDefinition.java:163)
at com.google.cloud.bigquery.TableInfo$BuilderImpl.(TableInfo.java:183)
at com.google.cloud.bigquery.Table.fromPb(Table.java:603)
at com.google.cloud.bigquery.BigQueryImpl.getTable(BigQueryImpl.java:415)
at bigquery.BigQueryTest.main(BigQueryTest.java:24)
#### Code snippet
public class BigQueryTest {
ServiceAccountCredentials.fromStream(new FileInputStream(""));
BigQueryOptions.newBuilder().setCredentials(googleCredentials).build().getService();
Dataset ds_with_empty_tables = bqService.getDataset("Native_table");
}
Thanks!
The text was updated successfully, but these errors were encountered: