Skip to content

Timestamp values are incorrectly rounded when retrieved from BigQuery #4031

Description

@sksk571

Environment details

  • OS: Windows
  • .NET version: .NET Core 2.2
  • Package name and version: Google.Cloud.BigQuery.V2 1.4.0

Steps to reproduce

  1. Store value 2004-07-26 15:25:28.173333 in a timestamp column in BigQuery
  2. Retrieve this value using BigQueryClient.ExecuteQueryAsync

The obtained value is 2004-07-26 15:25:28.173332

The issue is most likely in BigQueryRow.TimestampConverter. For the value above BigQuery returns 1090855528.1733329 as the number of seconds, which is 1090855528173332.9 microseconds. The decimal 9 is then truncated upon converting to long.

Metadata

Metadata

Assignees

Labels

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