Skip to content

Missing configuration for dryRun jobs causes NPE #525

Closed

Description

@mziccard

A query job created with dryRun = true has no configuration field. The following is the response I get from Jobs: insert.

{
 "kind": "bigquery#job",
 "etag": "\"Bop49sEVg6UBKwr7tLdL8AavHaw/LRPbO11E3VlTAE5UxM2F_Mfu01M\"",
 "jobReference": {
  "projectId": "gcloud-devel"
 },
 "status": {
  "state": "DONE"
 },
 "statistics": {
  "creationTime": "1452067884640",
  "totalBytesProcessed": "26",
  "query": {
   "totalBytesProcessed": "26",
   "totalBytesBilled": "0",
   "cacheHit": false
  }
 }
}

While if I create the same job with dryRun = false the configuration is present instead:

{
 "kind": "bigquery#job",
 "etag": "\"Bop49sEVg6UBKwr7tLdL8AavHaw/OI0lGTx2GlKc0VoAAYS-fIXHWok\"",
 "id": "gcloud-devel:job_nixqXTMu-mS9U26Ixnxr9KZxCyc",
 "selfLink": "https://www.googleapis.com/bigquery/v2/projects/gcloud-devel/jobs/job_nixqXTMu-mS9U26Ixnxr9KZxCyc",
 "jobReference": {
  "projectId": "gcloud-devel",
  "jobId": "job_nixqXTMu-mS9U26Ixnxr9KZxCyc"
 },
 "configuration": {
  "query": {
   "query": "select StringField from gcloud_test_dataset_temp_6c127c49_9574_4e17_ad2b_8e85071997aa.testing_table",
   "destinationTable": {
    "projectId": "gcloud-devel",
    "datasetId": "_6bb2fc157573f6bd0fed98f3b039c1e71f26d7d1",
    "tableId": "anon5f489e91b602aaed3dc62a46d51ba3c070e5d03f"
   },
   "createDisposition": "CREATE_IF_NEEDED",
   "writeDisposition": "WRITE_TRUNCATE"
  },
  "dryRun": false
 },
 "status": {
  "state": "RUNNING"
 },
 "statistics": {
  "creationTime": "1452070358348",
  "startTime": "1452070358585"
 },
 "user_email": "..."
}

While this does not affect the functionality itself I was wondering whether configuration should be returned also for dry-run jobs for consistency? /cc @jcondit @jtigani

For what concerns gcloud-java the absence of a configuration causes a NPE to be thrown at JobInfo:297.

Activity

  1. jcondit commented on Jan 6, 2016

    @jcondit

    Yeah, looks like a bug on our end. Thanks for the report!

  2. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jan 6, 2016
  3. added this to the milestone on Jan 6, 2016
  4. polleyg commented on Jan 12, 2017

    @polleyg
  5. jcondit commented on Jan 12, 2017

    @jcondit

    I've pinged our internal bug to see if we can get the API behavior straightened out.

    In the meantime, perhaps we can fix the NPE in the client library independently? @tswast

  6. jcondit commented on Jan 18, 2017

    @jcondit

    We've submitted a fix for this issue on the backend. It'll take a week or two to roll out.

  7. tswast commented on Feb 10, 2017

    @tswast
    Contributor

    Marking as blocking GA, just to make sure we double check that this is working and close this out. Sorry I didn't have time to make a quick fix.

  8. 22 remaining items

  9. added a commit that references this issue on Feb 24, 2026
  10. added a commit that references this issue on Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: bigqueryIssues related to the 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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions