I have a job that is failing with the error
<Line:14222274 / Field:1, Bad character (ASCII 0) encountered. Rest of file not processed.
Bad character (ASCII 0) encountered. Rest of file not processed.
Clearly states you have a UTF-16 character there which cannot be decoded. BigQuery service only supports UTF-8 and latin1 text encodings. So, the file is supposed to be UTF-8 encoded.
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.
Probably you have a UTF-16 encoded tab character at the end of the file, which cannot be decoded.
Solution: Use the -a
or --ascii
flag with gzip
command. It'll be decoded ok by bigquery
.