大查询作业失败,出现“遇到错误字符(ASCII 0)”。 [英] Big Query job fails with "Bad character (ASCII 0) encountered."

查看:217
本文介绍了大查询作业失败,出现“遇到错误字符(ASCII 0)”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有与误差


线

。发生故障的作业:遇到1,为字符(ASCII 0):14222274 /域。

数据已经过压缩,并且已经验证文件中不存在ASCII 0字符。文件中只有14222273行,所以打印在错误消息中的行号是文件末尾的一行。我有相同的数据集已成功上传其他块,所以我怀疑这是一个BQ错误,或者错误信息并不表示潜在的问题。任何帮助解决这个问题,将不胜感激。感谢。

>>> data = open(data.csv)。read()
>>> chr(0)in data
False
>>> data [-1]
'\\\
'


解决方案

当您压缩使用的实用程序时。



当我使用ZIP格式(在Windows中)压缩我的csv文件时,我看到了这个问题。 Google BigQuery似乎只接受gzip格式。



确保使用gzip压缩您的CSV。如果您使用的是Windows, 7-zip 是一个非常棒的工具,它允许您使用gzip进行压缩。

在Unix中gzip是标准的。


I have a job that is failing with the error

Line:14222274 / Field:1, Bad character (ASCII 0) encountered. Rest of file not processed.

The data is compressed and I have verified that no ASCII 0 character exists in the file. There are only 14222273 lines in the file, so the line number that is printed in the error message is one line past the end of the file. I have other chunks from the same data set which have uploaded successfully, so I suspect that this is either a BQ bug, or the error message is not indicative of the underlying issue. Any help solving this problem would be appreciated. Thanks.

>>> data = open("data.csv").read()
>>> chr(0) in data
False
>>> data[-1]
'\n'

解决方案

When you compress what utility did you use?.

I saw this issue when i compressed my csv file in ZIP format ( in windows) . Google BigQuery seems to accept only gzip format.

Make sure to compress your CSV using gzip. If you are in windows 7-zip is a great utility which allows you to compress in gzip.

In Unix gzip is standard.

这篇关于大查询作业失败,出现“遇到错误字符(ASCII 0)”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆