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
Member

@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 a review from as a code owner Oct 8, 2021
@stephaniewang526 stephaniewang526 requested a review from tswast (assigned from googleapis/api-bigquery) Oct 8, 2021
@product-auto-label product-auto-label bot added the api: bigquery label Oct 8, 2021
@google-cla google-cla bot added the cla: yes 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

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 requested a review from tswast Oct 8, 2021
@stephaniewang526 stephaniewang526 added the kokoro:force-run label Oct 8, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run label Oct 8, 2021
tswast
tswast approved these changes Oct 8, 2021
tswast
tswast approved these changes Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants