相关疑难解决方法(0)

Bigquery将列添加到表模式

我正在尝试向BigQuery现有表添加新列.我尝试过bq命令工具和API方法.调用Tables.update()时出现以下错误.

我试过提供带有附加字段的完整模式,并且也给出了如下所示的相同错误.

使用API​​我得到以下错误:

{
    "schema": {
        "fields": [{
            "name": "added_column",
            "type": "integer",
            "mode": "nullable"
        }]
    }
}



{
    "error": {
        "errors": [{
            "domain": "global",
            "reason": "invalid",
            "message": "Provided Schema does not match Table [blah]"
        }],
        "code": 400,
        "message": "Provided Schema does not match Table [blah]"
    }
}
Run Code Online (Sandbox Code Playgroud)

使用BQ工具,我收到以下错误:

./bq update -t blah added_column:integer
Run Code Online (Sandbox Code Playgroud)

更新操作中的BigQuery错误:提供的架构与表[blah]不匹配

google-bigquery

20
推荐指数
1
解决办法
1万
查看次数

我如何使用BigQuery补丁?

在BigQuery API文档中,有一个名为patch的方法.我希望我可以用它来改变现有表的模式.不幸的是,bq不支持它.但根据他们的网站,您可以访问https://developers.google.com/bigquery/docs/reference/v2/tables/patch.但是,当我尝试它时,发送以下请求:

PATCH https://www.googleapis.com/bigquery/v2/projects/(my project id)/datasets/tmp_bt/tables/change_cols?key={YOUR_API_KEY}

Content-Type:  application/json
Authorization:  Bearer (removed)
X-JavaScript-User-Agent:  Google APIs Explorer

{
 "schema": {
  "fields": [
   {
   },
   {
   },
   {
    "mode": "nullable",
    "name": "gotchahere",
    "type": "string"
   }
  ]
 }
}
Run Code Online (Sandbox Code Playgroud)

(我不知道空元素来自哪里,并且编辑器太难以用来粘贴我现有的表定义.我注意到它缺少必需的元素,比如我的项目ID,我希望它包括在内,因为它们在形式中被要求)然后我得到答复:

cache-control:  private, max-age=0
content-encoding:  gzip
content-length:  122
content-type:  application/json; charset=UTF-8
date:  Thu, 13 Jun 2013 22:22:09 GMT
expires:  Thu, 13 Jun 2013 22:22:09 GMT
server:  GSE

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "backendError",
    "message": "Backend Error"
   }
  ],
  "code": …
Run Code Online (Sandbox Code Playgroud)

google-bigquery

6
推荐指数
1
解决办法
3383
查看次数

标签 统计

google-bigquery ×2