Python CSV值的bigquery模式

Python CSV值的bigquery模式,python,sql,google-bigquery,google-cloud-storage,google-cloud-sql,Python,Sql,Google Bigquery,Google Cloud Storage,Google Cloud Sql,我正在尝试使用bq命令行工具将数据加载到bigquery中。数据如下表所示(TSV): 但我有以下错误 File: 0 / Line:120642 / Field:5: Data between close double quote (") and field separator: field starts with: <massive > File: 0 / Line:127690 / Field:1: Value cannot be converted to expected t

我正在尝试使用bq命令行工具将数据加载到bigquery中。数据如下表所示(TSV):

但我有以下错误

File: 0 / Line:120642 / Field:5: Data between close double quote
(") and field separator: field starts with: <massive >
File: 0 / Line:127690 / Field:1: Value cannot be converted to
expected type.
文件:0/行:120642/字段:5:关闭双引号之间的数据
(“”)和字段分隔符:字段以:
文件:0/行:127690/字段:1:值无法转换为
预期类型。
我的理解是

  • 文件:0/行:120642/字段:5:关闭双引号之间的数据 (“”)和字段分隔符:字段以-->开头,这是因为字段:5的值是逗号分隔的列表

  • 文件:0/行:127690/字段:1:值无法转换为 预期类型。-->实际字段值的类型与预期的不同


如何进行bigquery以将逗号分隔的列表读取为字段:5值&忽略字段值与预期类型不同的记录

尝试将引号字符设置为“\0”或表中未显示的内容。TSV文件通常不引用字段(即,您不会有一行看起来像
a\t“foo bar”\tbaz
),因此这应该是可以的,除非您有应该引用的制表符(这在TSV中不太可能)。

发现第二个错误:--max\u bad\u records=xx,但不起作用。用一个大数字替换xx。这就是我要做的:)在此之前,为了解决第一个错误,我使用sed删除了双引号。现在我想删除第一列中以非整数开头的记录。另一个选项:将所有内容作为字符串导入,过滤并稍后在BigQuery中强制转换感谢您的建议。我通过从记录中删除引号并删除以非整数值开头的记录来解决这个问题。
File: 0 / Line:120642 / Field:5: Data between close double quote
(") and field separator: field starts with: <massive >
File: 0 / Line:127690 / Field:1: Value cannot be converted to
expected type.