Skip to content

BigQuery: Creating a job with an existing ID throws a NullPointerException #3034

@Lumenol

Description

@Lumenol

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: Ubuntu 22.04.3 LTS
  3. Java version: 21 Eclipse Temurin
  4. version(s): 2.35.0

Steps to reproduce

  1. Create a Job with an ID
  2. Create an other Job with the same ID

Code example

            BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
            LoadJobConfiguration jobConfiguration = LoadJobConfiguration.builder(
                            TableId.of("dataset", "table"), "gs://bucket/file")
                    .setFormatOptions(FormatOptions.json())
                    .setAutodetect(true)
                    .setWriteDisposition(WRITE_TRUNCATE)
                    .build();
            bigquery.create(JobInfo.of(JobId.of(jobId), jobConfiguration)).waitFor();
            bigquery.create(JobInfo.of(JobId.of(jobId), jobConfiguration)).waitFor();

Stack trace

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.NullPointerException: Cannot invoke "com.google.cloud.bigquery.Job.getStatistics()" because "job" is null] with root causejava.lang.NullPointerException: Cannot invoke "com.google.cloud.bigquery.Job.getStatistics()" because "job" is null
	at com.google.cloud.bigquery.BigQueryImpl.create(BigQueryImpl.java:442)
	at com.google.cloud.bigquery.BigQueryImpl.create(BigQueryImpl.java:363)

External references such as API reference guides

  • ?

Any additional information below

Following these steps guarantees the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigqueryIssues related to the googleapis/java-bigquery API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions