Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix timestamp rounding issue #1645

Merged
merged 2 commits into from Oct 11, 2021

Conversation

stephaniewang526
Copy link
Contributor

@stephaniewang526 stephaniewang526 commented Oct 8, 2021

Towards #1644

Temp fix timestamp rounding error (to microsecond) which can be reproduced by setting query priority to INTERACTIVE.

@stephaniewang526 stephaniewang526 requested review from a team and tswast October 8, 2021 15:57
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/java-bigquery API. label Oct 8, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 8, 2021
@tswast tswast changed the title fix: fix timestamp ronuding issue fix: fix timestamp rounding issue Oct 8, 2021
Fixes googleapis#1644

remove unrelated test case

update test case
Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a complete fix. We should really be setting the formatOptions.useInt64Timestamp request parameters to avoid any need for rounding at all:

https://github.com/googleapis/python-bigquery/blob/b15b612ee7d642d663341989f0db1d6b9365e6e1/google/cloud/bigquery/client.py#L3741

Otherwise, BigQuery has an internal conversion to floating point, which likely can cause issues even with rounding.

Since Java allows exposing the raw string value, technically setting this would be a breaking change, so I'm okay with the current fix, but we should leave the issue open and consider taking a breaking change to fully address this.

@stephaniewang526 stephaniewang526 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 8, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/java-bigquery API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants