Skip to content

Commit

Permalink
fix(bigquery): Query.Read fails with dry-run queries (#5753)
Browse files Browse the repository at this point in the history
To be aligned with documentation (see line 125), Query.Read must fail
with dry-run queries
  • Loading branch information
NoelM committed Mar 14, 2022
1 parent 853fe74 commit e279584
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bigquery/query.go
Expand Up @@ -368,6 +368,9 @@ func (q *Query) newJob() (*bq.Job, error) {
// is used in place of the jobs.insert path as this path does not expose a job
// object.
func (q *Query) Read(ctx context.Context) (it *RowIterator, err error) {
if q.QueryConfig.DryRun {
return nil, errors.New("bigquery: cannot evaluate Query.Read() for dry-run queries")
}
ctx = trace.StartSpan(ctx, "cloud.google.com/go/bigquery.Query.Run")
defer func() { trace.EndSpan(ctx, err) }()
queryRequest, err := q.probeFastPath()
Expand Down

0 comments on commit e279584

Please sign in to comment.