Stateless queries introduced in #9022 create QueryResults with an empty job ID when jobComplete is true (ref). When the result set spans multiple pages, rows() calls getQueryResults using that empty job ID, producing a 404:
GET /bigquery/v2/projects/{project}/queries/?pageToken=...
^ missing job ID
Steps to reproduce
$bq = new BigQueryClient(['keyFilePath' => '...']);
$job = $bq->query('SELECT * FROM `dataset.large_table`'); // >10k rows
$results = $bq->runQuery($job);
foreach ($results->rows() as $row) {
// 404 on second page fetch
}
Any query that (a) takes the stateless path and (b) returns enough rows to paginate will fail.
Version
google/cloud-bigquery v1.36.0 (first version with stateless queries)
Workaround
Set an explicit jobId to force isStateless() to return false:
$job = $bq->query('SELECT ...', [
'jobReference' => ['jobId' => 'some-id'],
]);
Stateless queries introduced in #9022 create QueryResults with an empty job ID when jobComplete is true (ref). When the result set spans multiple pages, rows() calls getQueryResults using that empty job ID, producing a 404:
Steps to reproduce
Any query that (a) takes the stateless path and (b) returns enough rows to paginate will fail.
Version
google/cloud-bigquery v1.36.0 (first version with stateless queries)
Workaround
Set an explicit jobId to force isStateless() to return false: