-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Listing redacted BigQuery jobs results in an NPE #3739
Comments
Additionally it should be possible to list BigQuery jobs and be selective about the returned fields... currently we demand that the job's configuration always be returned via JobField.REQUIRED_FIELDS. When listing many jobs this field can be large. The client library overriding my choice and requesting that this field not be returned. |
Hello, @bmenasha |
I'm able to recreate with this:
Which I think is currently 1.46.0 Exception in thread "main" java.lang.NullPointerException thanks |
public static void main(String[] args){ |
@bmenasha, Current artifact id is google-cloud-bigquery Latest version dependency: Could you please try to reproduce with latest version? Will try to reproduce too |
Yes... occurs in
thanks |
Hi, In response to : #3739 As mention by bmenasha, BigQuery is redacting the metadata from these jobs as described on: https://cloud.google.com/bigquery/docs/managing-jobs Here it's clearly mentioned, Same can be found on https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/list also. Thanks |
…and toPb() methods
…and toPb() methods
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.cloud.bigquery.JobConfiguration com.google.cloud.bigquery.JobConfiguration.setProjectId(java.lang.String)' on a null object reference |
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
The text was updated successfully, but these errors were encountered: