-
Notifications
You must be signed in to change notification settings - Fork 639
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
The BigQuery TIMESTAMP has up to microseconds precision, but when converting to a JavaScript Date, it becomes up to milliseconds
A JavaScript Number is really only a FLOAT64, there is no real INT64, so during conversion some precision is lost:
$ node ./bigquery/queries.js sync 'SELECT ARRAY<INT64>[0x7fff1234deadbeef, -0x8000000000000000] AS example_array'
{ err: null,
rows: [ { example_array: [ 9223110580161593000, -9223372036854776000 ] } ],
nextQuery: null,
apiResponse:
{ kind: 'bigquery#queryResponse',
schema: { fields: [ { name: 'example_array', type: 'INTEGER', mode: 'REPEATED' } ] },
jobReference: { ... },
totalRows: '1',
rows: [ { f: [ { v: [ { v: '9223110580161593071' }, { v: '-9223372036854775808' } ] } ] } ],
totalBytesProcessed: '0',
jobComplete: true,
cacheHit: false } }
Received 1 row(s)!
[ { example_array: [ 9223110580161593000, -9223372036854776000 ] } ]I don't really have a solution, please suggest when application need this much precision
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.