Skip to content
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

[BigQuery: create(jobInfo)] QueryJob execution status is "DONE" but the destination table isn't created #3622

Open
sherrywan629 opened this issue Dec 21, 2024 · 1 comment
Assignees
Labels
api: bigquery Issues related to the googleapis/java-bigquery API.

Comments

@sherrywan629
Copy link

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please include as much information as possible:

Environment details

  1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
    BigQuery: create(jobInfo), with
    JobInfo jobInfo = JobInfo.newBuilder(queryConfig).setJobId(jobId).build();, so query config and job Id are generated in our code.
  2. OS type and version: MacOs Sequoia 15.2
  3. Java version: java 21
  4. version(s):

Steps to reproduce

To include more details:
In our query job, what we do is we construct a SQL command which will select a bunch of records from a table, then we'll construct a QueryJobConfiguration in our code like this:

      QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(sqlString)
          .setDefaultDataset(datasetId)
          .setDestinationTable(tempUnpartitionedTable)
          .build(); 
      JobInfo jobInfo = JobInfo.newBuilder(queryConfig).setJobId(jobId).build();

In 99% the case, it works very well. But recently we've hit some corner cases, where the queryJob's status returned as "DONE", however the destination table isn't created.
We made sure that the sql returns valid records so there're valid records to insert into destination table
We also leveraged bq show and confirmed that the query job "recordsRead":"1000","recordsWritten":"1000" are valid and look correct, but the destination table isn't created.

Code example

Provided above but let me know if you need more details.

Stack trace

A sample job Id, which has a DONE status but not bringing the selected records into destination table: copyToTempUnpartitionedTable_reconciliation-development_development_master_cleansed_payment_events_1_2024-04-09_00_0_1

External references such as API reference guides

Any additional information below

Following these steps guarantees the quickest resolution possible.

Thanks!

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/java-bigquery API. label Dec 21, 2024
@whuffman36 whuffman36 self-assigned this Jan 10, 2025
@whuffman36
Copy link
Contributor

whuffman36 commented Jan 13, 2025

Thanks for filing this issue @sherrywan629 . Just to clarify, are you explicitly creating the tempUnpartitionedTable table before sending the job to BigQuery, or are you expecting that the table be created implicitly during the job?

Also, when you mention that bq shows "recordsRead":"1000","recordsWritten":"1000", can you see where these records are being written to? If the destination table is not created, are the records written to an anonymous (unnamed) table?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/java-bigquery API.
Projects
None yet
Development

No branches or pull requests

2 participants