【发布时间】:2017-08-28 20:38:37
【问题描述】:
我正在尝试通过以下方式将简单的 JSON 数据加载到 BigQuery 表中:
$ bq load \
--apilog \
--source_format=NEWLINE_DELIMITED_JSON \
my_dataset.my_table \
./input.json ./schema.json
但收到以下错误消息:
Upload complete.
Waiting on bqjob_xxxx_xxx ... (3s) Current status: DONE
BigQuery error in load operation: Error processing job 'my_project_id:bqjob_xxxx_xxx': CSV table encountered too many errors, giving up. Rows: 1; errors: 1.
Failure details:
- file-00000000: Error detected while parsing row starting at
position: 0. Error: Data between close double quote (") and field
separator.
它抱怨一些 CSV 错误,但我正在尝试加载 JSON (--source_format=NEWLINE_DELIMITED_JSON)
我的input.json 包含以下数据:
{"domain":"stackoverflow.com","key":"hello","value":"world"}
我的schema.json 如下:
[
{
"name": "domain",
"type": "string",
"mode": "nullable"
},
{
"name": "key",
"type": "string",
"mode": "nullable"
},
{
"name": "value",
"type": "string",
"mode": "nullable"
}
]
bq 2.0.25 版:
$ gcloud version | grep ^bq
bq 2.0.25
【问题讨论】:
标签: json google-bigquery