- Notifications
You must be signed in to change notification settings - Fork 128
Closed
Labels
api: bigqueryIssues related to the googleapis/java-bigquery API.Issues related to the googleapis/java-bigquery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- BigQuery API
- OS type and version: MacOS 10.15.5
- Java version: 13.0.2
- bigquery version(s): group: 'com.google.cloud', name: 'google-cloud-bigquery', version: '1.116.10'
Steps to reproduce
-
Create query:
DECLARE ids_filter ARRAY default ["1"];
SELECT TO_JSON_STRING(query)
from (
select * from TABLE
WHERE row.id IN UNNEST(ids_filter)
) as query -
results = job.getQueryResults( --> throws NullPointerException
BigQuery.QueryResultsOption.pageSize(10),
BigQuery.QueryResultsOption.startIndex(0);
);
Stack trace
java.lang.NullPointerException at com.google.cloud.bigquery.BigQueryImpl.listTableData(BigQueryImpl.java:1021) at com.google.cloud.bigquery.BigQueryImpl.listTableData(BigQueryImpl.java:1010) at com.google.cloud.bigquery.Job.getQueryResults(Job.java:312) ............. Any additional information below
Due to DECLARE statement and before the following reload, the destination table is null.
Once the job is reloaded it does not override current (this) job
Job job = this; if (job.getStatus() == null || !JobStatus.State.DONE.equals(job.getStatus().getState())) { job = reload(); } TableId table = ((QueryJobConfiguration) getConfiguration()).getDestinationTable(); and cause the crash later in listTableData while accessing tableId.getProject().
When DECLARE statement omitted, the query works OK, also, the response has relevant information responded by BigQuery.
In both cases, the destination table is not overridden but without DECLARE it is not null.
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/java-bigquery API.Issues related to the googleapis/java-bigquery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.