下面是导出作业配置,将biq查询表数据导出为csv格式的存储。如果一个字符串列中包含双引号的数据,那么当它被提取时,我会得到两个双引号。比方说
Column_data : xxdsadsa "sdfsada" adfadfsaa
Exported_column_data : xxdsadsa ""sdfsada"" adfadfsaa以下是作业配置
job_data = {
'configuration': {
'extract': {
'sourceTable': {
'projectId': xxxxx,
'datasetId': xxxxxx,
'tableId': xxxx
},
'printHeader': False,
'fieldDelimiter': '\t',
'compression': 'GZIP',
'destinationUris': [gs://xxxxxxx],
'destinationFormat': CSV,
}
}
}
service = build('bigquery', 'v2', http=http_auth)
job_collection = service.jobs()
insert_response = job_collection.insert(projectId=project_id, body=job_data).execute(http=http)在从表提取到存储时,是否有一种方法可以抑制获取两个双引号。我见过作业配置提取属性,但找不到任何属性。感谢你的帮助
发布于 2018-02-06 16:25:36
如前所述,使用BigQuery web的双引号也有相同的问题。然而,单引号工作得很好。作为解决办法,您可以将所有双引号转换为单引号。
还可以检查configuration.load.quote属性。
预览BigQuery:

导出的CSV表:

https://stackoverflow.com/questions/48599153
复制相似问题