Skip to content

bigquery: drop timestamp string replacement#2647

Merged
stephenplusplus merged 3 commits intogoogleapis:masterfrom
c0b:fix/bigquery-timestamp
Oct 3, 2017
Merged

bigquery: drop timestamp string replacement#2647
stephenplusplus merged 3 commits intogoogleapis:masterfrom
c0b:fix/bigquery-timestamp

Conversation

@c0b
Copy link
Contributor

@c0b c0b commented Oct 3, 2017

since https://issuetracker.google.com/issues/35905946 is fixed, bq server side
now support RFC3339 format natively, hence no longer necessary to do string
replacement for timestamp RFC3339 format

$ node -p 'new Date().toJSON()'
2017-10-03T02:41:33.693Z
$ bq query --parameter ts:TIMESTAMP:'2017-10-03T02:41:33.693Z' '#standardSQL
SELECT FORMAT("%T", @ts) AS ts'
Waiting on bqjob_r....... (0s) Current status: DONE
+----------------------------------------+
|                   ts                   |
+----------------------------------------+
| TIMESTAMP "2017-10-03 02:41:33.693+00" |
+----------------------------------------+

with this change:

$ node -e 'const bigquery = require("./packages/bigquery")();
           bigquery.query(`#standardSQL
                       SELECT TIMESTAMP "2017-10-03T02:41:33.693Z" AS ts`)
           .then(([ res ]) => console.log(res))'
[ { ts: { value: '2017-10-03T02:41:33.693Z' } } ]

fixes #2631

@c0b c0b requested a review from lukesneeringer as a code owner October 3, 2017 02:59
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Oct 3, 2017
since https://issuetracker.google.com/issues/35905946 is fixed, bq server side
now support RFC3339 format natively, hence no longer necessary to do string
replacement for timestamp RFC3339 format

    $ node -p 'new Date().toJSON()'
    2017-10-03T02:41:33.693Z
    $ bq query --parameter ts:TIMESTAMP:'2017-10-03T02:41:33.693Z' '#standardSQL
    SELECT FORMAT("%T", @ts) AS ts'
    Waiting on bqjob_r....... (0s) Current status: DONE
    +----------------------------------------+
    |                   ts                   |
    +----------------------------------------+
    | TIMESTAMP "2017-10-03 02:41:33.693+00" |
    +----------------------------------------+

with this change:

    $ node -e 'const bigquery = require("@google-cloud/bigquery")();
               bigquery.query(`#standardSQL
                           SELECT TIMESTAMP "2017-10-03T02:41:33.693Z" AS ts`)
               .then(([ res ]) => console.log(res))'
    [ { ts: { value: '2017-10-03T02:41:33.693Z' } } ]

fixes googleapis#2631
@c0b c0b force-pushed the fix/bigquery-timestamp branch from 5458ce1 to baf97e5 Compare October 3, 2017 03:05
@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Oct 3, 2017
@c0b c0b requested a review from a team as a code owner October 3, 2017 14:05
@stephenplusplus stephenplusplus added the api: bigquery Issues related to the BigQuery API. label Oct 3, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 812fef5 on c0b:fix/bigquery-timestamp into 3ebaf5c on GoogleCloudPlatform:master.

@googleapis googleapis deleted a comment from coveralls Oct 3, 2017
@stephenplusplus stephenplusplus merged commit e851b8b into googleapis:master Oct 3, 2017
@stephenplusplus
Copy link
Contributor

Thank you!

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot googlebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Oct 3, 2017
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 BigQuery API. cla: no This human has *not* signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bigquery timestamp: could you drop the string replacement?

4 participants