Google-cloud-go: BigQuery: upgrade to 1.11.0: cannot read from a non-query job

Created on 30 Sep 2020  路  4Comments  路  Source: googleapis/google-cloud-go

Client

BigQuery

Environment

Local machine (OSx), docker container: golang:1.13

Go Environment

$ go version
go1.15 darwin/amd64

Code

query := client.Query(rawQuery)
query.DisableQueryCache = true

rowIterator, err = query.Read(ctx)

Expected behavior

Run the query

Actual behavior

I get the error cannot read from a non-query job

Cause:
Started after upgrading from 1.9.0 to 1.11.0

Bug seems to be introduced in https://github.com/googleapis/google-cloud-go/pull/2560

The code will poll the job because the response has JobComplete:false

But the minimaljob created in the code does not have a config, therefore the j.isQuery() check below fails resulting in an error:

    if !j.isQuery() {
        return nil, errors.New("bigquery: cannot read from a non-query job")
    }

Link to code:
https://github.com/googleapis/google-cloud-go/blob/26c4a53b2150dc3cfd2e1bb09840072346039aa5/bigquery/job.go#L284

bigquery p1 bug

All 4 comments

Thanks for the report. Taking a look.

Will work on releasing a v1.12.0 to pick this up now

I misspoke on the version, this has been released as bigquery/v1.11.1 as there were no other significant changes pending.

Thanks for addressing this so quickly!

Was this page helpful?
0 / 5 - 0 ratings