Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
This repository was archived by the owner on Feb 7, 2026. It is now read-only.

Several issues with stateless queries #1399

@alex-statsig

Description

@alex-statsig

Very excited by #1337, but ran into two main issues:

  1. The types seem to be incorrect for client.query(query, options) (and client.query(query)). The types indicate the return type is [ResultsArray, IJob] (note in particular that job is not nested under a key "job" for the second value), whereas in practice I'm seeing a return shape of [ResultsArray, {job: IJob}, JobStatistics]. I'm unsure if the signature will change, so would like to make sure the types/return value is correct before using this
  2. jobTimeoutMs cannot be set (only timeoutMs). Additionally, timeoutMs does not behave as expected. It seems like the request should max out at timeoutMs or some duration near that (perhaps RTT + timeoutMs). In reality, I'm observing it last for much longer if the job takes a while. It seems like the timeout is used for the initial jobsQuery request, then it is removed and the job continues to be awaited. This is critical to having some safety net for the maximum duration the fetch will take (jobTimeoutMs would be the preferred mechanism though).

Environment details

  • OS: n/a
  • Node.js version: n/a
  • npm version: n/a
  • @google-cloud/bigquery version: 7.8.0

Steps to reproduce

  1. (Optionally) enable QUERY_PREVIEW_ENABLED env variable. I believe the issues reproduce without this too though
    For the first bug,
  2. Call client.query(jobOptions) (such as client.query({query: '<sql>'}))
  3. Observe that three elements are returned instead of two, and the shape is incorrect
    For the second bug,
  4. Call client.query(jobOptions, { timeoutMs: 1000 }) with a job that would take >10s to execute.
  5. Observe that the request hangs for >10s rather than aborting at 1s

Very excited to try out these preview features, but these are the issues blocking me from actually using it currently

Metadata

Metadata

Assignees

Labels

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

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions