Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

BigQuery.JobListOption.parentJobId does not seem to work #18

@shevek

Description

@shevek

Environment details

  1. Specify the API at the beginning of the title (for example, "BigQuery: ...")
    General, Core, and Other are also allowed as types
  2. OS type and version: Linux, Ubuntu 19.10
  3. Java version: 1.8.0_232-ea
  4. google-cloud-java version(s): 1.101.1

Steps to reproduce

Choose a job id with child jobs.
Run the below.

  1. Client lists ALL jobs, not just the (in my case, 3) children of the parent job. It looks as if the JobListOption.parentJobId is ignored.

Code example

    @Test
    public void testListChildren() throws Exception {
        String jobId = // ...
        BigQuery bigQuery = BigQueryOptions.getDefaultInstance().getService();
        Iterable<? extends Job> jobChildren = bigQuery.listJobs(
                BigQuery.JobListOption.parentJobId(jobId)
        ).iterateAll();
        for (Job job : jobChildren) {
            job = job.reload(BigQuery.JobOption.fields(BigQuery.JobField.CONFIGURATION, BigQuery.JobField.ID, BigQuery.JobField.STATISTICS, BigQuery.JobField.STATUS));
            LOG.debug("Child job: " + job.getJobId());
            LOG.debug("Child's parent is " + job.getStatistics().getParentJobId());
        }
    }

Any additional information below

(Edited: Calling reload() causes the job to show a parentId, but still lists jobs NOT under the given parent)

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the googleapis/java-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
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions