8000 Listing redacted BigQuery jobs results in an NPE · Issue #3739 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content

Listing redacted BigQuery jobs results in an NPE #3739

@bmenasha

Description

@bmenasha

When run without "bigquery.jobs.listAll" permissions on a project (like "Viewer") that contains other user's jobs this program results in an NPE .

package com.bmenasha;

import com.google.cloud.Page;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQueryOptions;
import com.google.cloud.bigquery.Job;

public class Main {
public static void main(String[] args){
BigQuery service = BigQueryOptions.builder().projectId(args[0]).build().service();
Page jobPage = service.listJobs(BigQuery.JobListOption.allUsers());
for(Job job: jobPage.values()){
System.out.println("status:" + job.status());
}
}
}

Exception in thread "main" java.lang.NullPointerException
at com.google.cloud.bigquery.JobConfiguration.fromPb(JobConfiguration.java:132)
at com.google.cloud.bigquery.JobInfo$BuilderImpl.(JobInfo.java:166)
at com.google.cloud.bigquery.Job.fromPb(Job.java:264)
at com.google.cloud.bigquery.BigQueryImpl$19.apply(BigQueryImpl.java:498)
at com.google.cloud.bigquery.BigQueryImpl$19.apply(BigQueryImpl.java:495)
at com.google.common.collect.Iterators$8.transform(Iterators.java:817)
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
at com.bmenasha.Main.main(Main.java:16)

BigQuery is redacting the metadata from these jobs as described here:

https://cloud.google.com/bigquery/docs/managing-jobs

The libraries should be able to parse these redacted job responses and not error when the metadata is missing.
thanks

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.priority: p2Moderately-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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0