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
Reactions are currently unavailable
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