Skip to content

[java-bigquery] Analyze and fix timestamp rounding issue #12172

Open

Description

@stephaniewang526

Original ticket

Per Tim's comment, we should consider a more exhaustive approach to fix timestamp rounding issue.

Activity

  1. added
    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.
    on Oct 11, 2021
  2. added
    type: processA process-related concern. May include testing, release, or the like.
    and removed
    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.
    on Nov 5, 2021
  3. Neenu1995 commented on Aug 31, 2022

    @Neenu1995
    Contributor

    This fix requires a breaking change. Consider fixing for next major version bump.

  4. nineinchnick commented on Jan 15, 2024

    @nineinchnick

    Hi, I'm hitting this issue when trying to read the maximum possible timestamp from a BigQuery view. I expect a value of 253402300799.999999, but I'm getting a 253402300800.0. When querying the view in the web console, I'm getting the expected value of 9999-12-31 23:59:59.999999 UTC.

    I stumbled on this when working on trinodb/trino#12346

    I tried checking how formatOptions could be set, but that field doesn't exist in the QueryRequest model. It is mentioned in the API docs though: https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query
    I checked that the models are generated based on API specs generated from the Discovery service. formatOptions field is not present in the Discovery service: https://bigquery.googleapis.com/$discovery/rest?version=v2
    This is where I got stuck, I can't figure out if there are any public sources for the Discovery service.

    BTW Why this would be a breaking change? Maybe we could somehow expose formatOptions and leave the defaults as is.

  5. wendigo commented on Feb 14, 2024

    @wendigo

    Is anyone working on that?

  6. nineinchnick commented on Feb 22, 2024

    @nineinchnick

    I just found out there's a public issue tracker, so I reported it there too: https://issuetracker.google.com/u/1/issues/326260769

  7. changed the title [-]Analyze and fix timestamp rounding issue[/-] [+][java-bigquery] Analyze and fix timestamp rounding issue[/+] on Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigqueryIssues related to the BigQuery API.type: processA process-related concern. May include testing, release, or the like.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions