【发布时间】:2016-05-20 23:10:10
【问题描述】:
当使用 Jobs.query 通过 API 查询 Bigquery 表(简单的 SELECT * from [...])时,我将其作为架构返回:
"schema": {
"fields": [
{
"name": "all",
"type": "INTEGER",
"mode": "NULLABLE"
},
{
"name": "timestamp",
"type": "TIMESTAMP",
"mode": "NULLABLE"
},
{
"name": "last_timestamp",
"type": "TIMESTAMP",
"mode": "NULLABLE"
},
{
"name": "unique",
"type": "INTEGER",
"mode": "NULLABLE"
},...
但实际的架构(Tables.get 正确返回)是:
"schema": {
"fields": [
{
"name": "all",
"type": "INTEGER",
"mode": "REQUIRED",
"description": "All searches"
},
{
"name": "timestamp",
"type": "TIMESTAMP",
"mode": "REQUIRED",
"description": "Time of processing"
},
{
"name": "last_timestamp",
"type": "TIMESTAMP",
"mode": "REQUIRED",
"description": "Last event"
},
{
"name": "unique",
"type": "INTEGER",
"mode": "REQUIRED",
"description": "Unique users"
},
我在填充电子表格的应用脚本中使用查询结果,我想使用架构中的描述字段作为列名。我可以使用Table.get 来获取真正的架构,但我想了解为什么我在第一个查询中得到的架构不完整。
【问题讨论】:
标签: google-bigquery