0
我试图插入与架构的BigQuery时:异常更新的BigQuery架构
require 'gcloud'
gc = Gcloud.new 'PROJECT_ID'
bq = gc.bigquery
ds = bq.dataset 'MY_DATASET'
t = ds.create_table 'MY_TABLE'
t.schema = { fields: [ { name: 'Name', type: 'STRING' } ] }
t.insert [{'name' => 'test1'}]
正如预期的那样,我的终端控制台显示输出误差:
[{"reason"=>"invalid", "location"=>"name", "debugInfo"=>"generic::not_found: no such field.", "message"=>"no such field."}]
当我尝试更新架构插入关键名称:
t.schema = {
fields: [
{ name: 'Name', type: 'STRING' },
{ name: 'name', type: 'STRING' }
]
}
显示EXC eption:
Gcloud::Bigquery::ApiError: Field name already exists in schema
任何建议我该如何解决这个问题?这是一个BigQuery错误?
我以前没有用过bigquery,但它看起来像是降低了字段名称。因此,尽管第一次使用字段名称,但基本上试图创建两次字段“名称”。 –
不,返回的密钥是'Name',我无法在密钥中使用大写字母定义的模式之后创建低密钥。我也不能用小写键来插入数据。这很混乱。 –