【发布时间】:2018-07-28 16:03:54
【问题描述】:
更新谷歌云 SDK 189.0.0 后,之前正常的命令bq query --nouse_legacy_sql " ... " 现在报错如下:
$ python --version
Python 2.7.13 :: Anaconda, Inc.
$ bq version
This is BigQuery CLI 2.0.29
$ bq query --nouse_legacy_sql "SELECT country, model, iid, version, count(*) as n, max(t) AS t FROM an6.sm GROUP BY country, model, iid, version ORDER BY t DESC LIMIT 10 "
bq.py should not be invoked. Use bq command instead.
$
恢复以前的版本再次工作。
$ gcloud components restore
Your Cloud SDK installation will be restored to its previous state.
Do you want to continue (Y/n)? Y
Restoring backup...
Performing post processing steps...done.
Restoration done!
$ bq query --nouse_legacy_sql "SELECT country, model, iid, version, count(*) as n, max(t) AS t FROM an6.sm GROUP BY country, model, iid, version ORDER BY t DESC LIMIT 10 "
Waiting on bqjob_r13976b38780fa35_00000161ab5076fe_1 ... (1s) Current
status: DONE
【问题讨论】:
-
我无法重现这个。升级到 189.0.0,它工作正常。使用的是什么 Python 版本?
-
我有完全相同的错误。发生这种情况的地方是我很久以前设置的一个在 Compute Engine 上运行的 VM。我正在调用的 bq 程序来自 /usr/local/bin/bq,它是 /usr/local/share/google/google-cloud-sdk/bin/bq 的符号链接 - 不确定这是否相关。
-
要添加更多关于我之前的评论,这里是一个版本列表:gist.github.com/ronoaldo/14dbb69184594fc0e59771f698b95a76
-
如果您删除 ~/.bigqueryrc 和相关的旧版 bigquery 凭据,它也会失败。
-
升级后我遇到了同样的错误...运行“恢复”解决了这个问题。我还注意到 bin/ 中的“bq”自 9 月以来没有改变。