2017-04-12 32 views
0

我今天在datalab筆記本中運行current_date()(2017年4月12日以UTC表示),偶然發現兩個方言的結果不一致。爲什麼?bigquery - current_date()不一致的結果?

其實我使用的是標準方言,想要得到確切的當前日期,UTC應該是2017-04-12,那麼我該如何實現呢?

enter image description here

回答

1

有在Google Cloud Datalab GitHub repositorybug recently reported和固定(8498fa6)。

此問題可能已在最新的Datalab版本中得到解決。您可以嘗試升級Google Cloud Datalab嗎?

在最新的Datalab版本中,日期/時間顯示爲正確(以UTC表示)。

如果問題仍然存在,這也將是有趣的,看看的

%%sql 
SELECT CURRENT_TIME() 

結果
%%sql -d standard 
SELECT CURRENT_TIME() 

,或者從新google.datalab庫相當於魔法命令的結果:

%bq query 
SELECT CURRENT_TIME() 

注意:舊版SQL方言不再支持根據datalabgoogle.datalabMigration Guide在Google Cloud Datalab中編輯,其鏈接到Release notes