我的bq load
命令和错误
$ bq load --replace --source_format=CSV --autodetect temp.BQTable ./source.csv
Upload complete.
Waiting on bqjob_123 ... (0s) Current status: DONE
BigQuery error in load operation: Error processing job 'my-project-id-123:bqjob_123': Error
while reading data, error message: Error detected while parsing row starting at position: 333. Error: Missing close
double quote (") character.
Failure details:
- Error while reading data, error message: CSV processing encountered
too many errors, giving up. Rows: 0; errors: 1; max bad: 0; error
percent: 0
Excel 和我的用于 Csv 序列化的 node.js 模块可以很好地处理带有换行符的值的数据。
Papaparse,我的用于序列化的 npm 模块,'\r\n'
用作分隔行的默认换行符,因此那里不应该有任何歧义。
这是一些示例 csv 数据,即 source.csv
id,name
1,"this value
includes a newline"
bq 和 Cloud SDK 版本
$ gcloud components update
Your current Cloud SDK version is: 289.0.0
You will be upgraded to version: 337.0.0
┌─────────────────────────────────────────────────────────────────────────────┐
│ These components will be updated. │
├─────────────────────────────────────────────────────┬────────────┬──────────┤
│ Name │ Version │ Size │
├─────────────────────────────────────────────────────┼────────────┼──────────┤
│ BigQuery Command Line Tool │ 2.0.67 │ < 1 MiB │
│ BigQuery Command Line Tool (Platform Specific) │ 2.0.65 │ < 1 MiB │
│ Cloud SDK Core Libraries │ 2021.04.16 │ 18.0 MiB │
│ Cloud SDK Core Libraries (Platform Specific) │ 2021.03.12 │ < 1 MiB │
│ Cloud Storage Command Line Tool │ 4.61 │ 3.9 MiB │
│ Cloud Storage Command Line Tool (Platform Specific) │ 4.59 │ < 1 MiB │
│ gcloud cli dependencies │ 2021.04.16 │ 10.8 MiB │
│ gcloud cli dependencies │ 2021.04.16 │ < 1 MiB │
└─────────────────────────────────────────────────────┴────────────┴──────────┘
我使用的是 289 版,因为他们修补了较新的版本,不允许您使用bq load
:(将大小为 100 MB 或更大的文件(CSV、JSON 等)导入 BQ