From bfbf18cb373cd6a88a22eec8db7033f6678df755 Mon Sep 17 00:00:00 2001 From: Derek Perkins Date: Wed, 2 Aug 2023 13:03:28 -0600 Subject: [PATCH] fix(bigquery): use JobFromProject for storage iterator (#8372) There's no guarantee that the provided client is in the same project or location as the job, so those details need to also be provided from the job object Co-authored-by: Alvaro Viebrantz --- bigquery/storage_iterator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigquery/storage_iterator.go b/bigquery/storage_iterator.go index 48f131be0c17..c0ef9fedfb37 100644 --- a/bigquery/storage_iterator.go +++ b/bigquery/storage_iterator.go @@ -67,7 +67,7 @@ func newStorageRowIteratorFromTable(ctx context.Context, table *Table, ordered b func newStorageRowIteratorFromJob(ctx context.Context, j *Job) (*RowIterator, error) { // Needed to fetch destination table - job, err := j.c.JobFromID(ctx, j.jobID) + job, err := j.c.JobFromProject(ctx, j.projectID, j.jobID, j.location) if err != nil { return nil, err }