You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
For a given row in a BQ table, have a timestamp column value of 1970-01-01 00:00:00 UTC (aka timestamp 0)
Run a query + getQueryResults() to fetch the row
const[job]=awaitcreateQueryJob({query: "SELECT * FROM .... "});const[result]=awaitjob.getQueryResults();// ---- Error: TypeError: Cannot convert a BigInt value to a number at PreciseDate
Here's the stack trace of the error:
at new Date (<anonymous>)
at new PreciseDate (<{PATH}>/node_modules/@google-cloud/precise-date/build/src/index.js:95:26)
at new BigQueryTimestamp (<{PATH}>/node_modules/@google-cloud/bigquery/build/src/bigquery.js:1339:22)
at Function.timestamp (<{PATH}>/node_modules/@google-cloud/bigquery/build/src/bigquery.js:626:16)
at convert (<{PATH}>/node_modules/@google-cloud/bigquery/build/src/bigquery.js:374:38)
at <{PATH}>/node_modules/@google-cloud/bigquery/build/src/bigquery.js:310:29
at Array.map (<anonymous>)
at mergeSchema (<{PATH}>/node_modules/@google-cloud/bigquery/build/src/bigquery.js:301:26)
at Array.map (<anonymous>)
at Function.mergeSchemaWithRows_ (<{PATH}>/node_modules/@google-cloud/bigquery/build/src/bigquery.js:299:29)
at <{PATH}>/node_modules/@google-cloud/bigquery/build/src/job.js:368:44
at <{PATH}>/node_modules/@google-cloud/common/build/src/util.js:412:25
at Util.handleResp (<{PATH}>/node_modules/@google-cloud/common/build/src/util.js:161:9)
at <{PATH}>/node_modules/@google-cloud/common/build/src/util.js:534:22
at onResponse (<{PATH}>/node_modules/retry-request/index.js:259:7)
at <{PATH}>/node_modules/teeny-request/src/index.ts:333:11
at processTicksAndRejections (node:internal/process/task_queues:95:5)'
After investigating the issue, I noticed that the following statement is causing the error (class BigQueryTimestamp > constructor):
Environment details
@google-cloud/bigqueryversion: 7.5.2Steps to reproduce
1970-01-01 00:00:00 UTC(aka timestamp0)getQueryResults()to fetch the rowHere's the stack trace of the error:
After investigating the issue, I noticed that the following statement is causing the error (class
BigQueryTimestamp>constructor):If
value = "0",PreciseDate. constructorwill try to runnew Date(BigInt("0")), which throws an error.The issue was introduced by the client version 7.5.
Thanks!