foxwendy
foxwendy

Reputation: 2929

bigquery - current_date() inconsistent result?

I ran current_date() in datalab notebook today(2017 April 12 in UTC), found inconsistent results from two dialects by chance. Why is it?

Actually I am using standard dialect and wanted to get the exact current day in UTC which should be 2017-04-12, how should I accomplish it then?

enter image description here

Upvotes: 0

Views: 113

Answers (1)

Anthonios Partheniou
Anthonios Partheniou

Reputation: 1709

There was a bug recently reported and fixed (8498fa6) in the Google Cloud Datalab GitHub repository .

It's possible that this issue has already been resolved in the latest Datalab release. Could you try upgrading Google Cloud Datalab?

The date/times appear correct (in UTC) in the latest Datalab version.

If the issue still exists, it would also be interesting to see the results of

%%sql
SELECT CURRENT_TIME()

and

%%sql -d standard
SELECT CURRENT_TIME()

or, the results of the equivalent magic command from the new google.datalab library:

%bq query
SELECT CURRENT_TIME()

Note: The legacy SQL dialect is no longer supported in Google Cloud Datalab according to the datalab to google.datalab Migration Guide which is linked to from the Release notes.

Upvotes: 1

Related Questions