google-bigquery - 使用 bigQuery.jobs.insert API 时如何设置查询位置
问题描述
我正在使用 bigQuery.jobs.insert API,我需要设置查询的位置
在 bigQuery.jobs.query API中,我看到我可以将位置设置如下
curl --request POST \
'https://www.googleapis.com/bigquery/v2/projects/[PROJECTID]/queries' \
--header 'Authorization: Bearer [YOUR_BEARER_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"query":"select 5","location":"asia-northeast1"}' \
--compressed
但在 bigQuery.jobs.insert 我看不到这样的选项,我试过这个:
"resource": {
"projectId": "project",
"configuration": {
"query": {
"query": "SELECT 5",
"useLegacySql": false,
"location": "asia-northeast1",
"defaultDataset": {
"datasetId": "ds"
},
"jobReference": {
"location": "asia-northeast1"
}
}
}
}
解决方案
阅读https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs
和https://cloud.google.com/bigquery/docs/locations#specifying_your_location
使用 API 时,请在作业资源部分的location
属性中指定您的区域。jobReference
推荐阅读
- sql-server - T-SQL GroupBy 具有总计数值和基于数字范围的组平均值
- r - 调整主面板在 Shiny 中的位置
- javascript - 在新标签页中打开链接的按钮
- html - HTML/CSS 中间错误 .hover/nav 错误、@media 错误、nav/aside CIS122
- r - 获取R中括号零的两个值的索引
- python - Doc2vec 仅输出单个文档而不是两个文档向量的数据
- powerbi - Power BI - 参考结果集中的其他行以确定是否显示行
- r - r markdown 未编译
- python - 使用 Python 正则表达式忽略字符串中的 `:`
- parsing - 为什么它给我这个错误?Python解析器