BQ 命令行工具出错:没有项目 ID 无法启动作业

Error with BQ command line tool: Cannot start a job without a project id

我在使用 BQ 命令行工具时遇到问题。 特别是在尝试查询 dataset/table 时,无论是 public 数据集还是我自己的数据集,我都会收到错误消息:

查询操作中的 BigQuery 错误:没有项目 ID 无法启动作业。

根据随附的屏幕截图,我将项目 ID 设置为默认值。 如果您能提供任何帮助,我们将不胜感激。 :-)

谢谢

BigQuery> ls projectId friendlyName


de********nts          De********ing  

BigQuery> query 'select count(*) from publicdata:samples.shakespeare' BigQuery error in query operation: Cannot start a job without a project id. BigQuery> show publicdata:samples.shakespeare Table publicdata:samples.shakespeare

Last modified Schema Total Rows Total Bytes Expiration


22 Oct 07:27:07 |- word: string (required) 164656 6432064
|- word_count: integer (required)
|- corpus: string (required)
|- corpus_date: integer (required)

您应该先配置 gcloud 命令行工具:

gcloud config set project 'yourProjectId'

这个项目is billed查询不到public数据。

然后你可以运行你的查询:

bq query 'select count(*) from publicdata:samples.shakespeare'