Skip to content

Instantly share code, notes, and snippets.

@arobb
Last active November 30, 2020 23:58
Show Gist options
  • Save arobb/285d2fa022df4874b863563b6d0bc904 to your computer and use it in GitHub Desktop.
Save arobb/285d2fa022df4874b863563b6d0bc904 to your computer and use it in GitHub Desktop.
BigQuery load errors return a byte position where an error occurred. If you know your data has reasonable line breaks, this command line Python script will show the offending line.
# s is the offset provided in the BQ load error
# filename.ext is your file's name
python -c "s=12345; f=open('filename.ext'); f.seek(s); print(f.readline())"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment