BigQuery error · Loading and schema
JSON table encountered too many errors, giving up
A JSON load job (or a JSON external table) hit more bad rows than max_bad_records allows, 0 by default, so nothing was loaded. The detail is in the job's errors[] list, usually a field missing from the schema, an array or object where the schema expects a scalar, or a file that isn't newline-delimited JSON.
The error message
Error while reading data, error message: JSON table encountered too many errors, giving up. Rows: <n>; errors: <n>. Please look into the errors[] collection for more details.
Causes
A field that isn't in the table schema
JSON parsing error in row starting at position 0: No such field: user_address. means a record has a key the destination schema doesn't have. Without ignore_unknown_values, the row is bad.
Shape mismatches
Array specified for non-repeated field: tags means the value is a JSON array but the column isn't REPEATED. JSON object specified for non-record field: payload means an object arrived for a scalar column. A repeated field's value must be an array or null, and the array can't contain null elements.
The file isn't newline-delimited JSON
BigQuery loads newline-delimited JSON only: one complete object per line. A pretty-printed file or a single top-level array fails on the first line.
Type and format problems
Strings in numeric columns, dates not in YYYY-MM-DD form, and integers larger than 2^53 sent as JSON numbers (they lose precision; send them as strings) all produce per-row errors.
Variant of the summary
Newer jobs report JSON processing encountered too many errors, giving up. Rows: 1; errors: 1; max bad: 0; error percent: 0. Same cause, same fixes.
How to fix it
1. Read the per-row errors
Run bq --format=prettyjson show -j JOB_ID and read status.errors. Each entry gives the byte position of the row and the field. At most five detailed errors are returned per job.
2. Ignore unknown fields, or add them to the schema
If extra keys are expected, set ignore_unknown_values. If you want them, add the columns first; new fields can also be added during the load with the ALLOW_FIELD_ADDITION schema update option.
LOAD DATA INTO `project.raw.events`
FROM FILES (
format = 'NEWLINE_DELIMITED_JSON',
uris = ['gs://acme-landing/events/2026-11-23/*.json'],
ignore_unknown_values = TRUE
);3. Land unpredictable payloads in a JSON column
For sources whose shape changes often, load the variable part into a column of type JSON and extract fields in SQL. Nested objects and arrays then never fail the load.
SELECT
JSON_VALUE(payload, '$.order.id') AS order_id,
SAFE_CAST(JSON_VALUE(payload, '$.order.total') AS NUMERIC) AS order_total,
JSON_QUERY_ARRAY(payload, '$.order.items') AS items
FROM `project.raw.events_json`;4. Convert the file to newline-delimited JSON
Reformat a top-level array into one object per line before loading, for example with jq -c '.[]' input.json > output.ndjson.
How to prevent it
- Keep an explicit schema for production loads and alert on new fields instead of failing the pipeline.
- Use
max_bad_recordsonly with row-count reconciliation: skipped rows disappear silently. - Don't let a scheduler retry a broken file forever; failed load jobs count toward the table's daily modification limit.
FAQ
Does a failed JSON load write partial data?
No. Load jobs are atomic; the destination table is unchanged when the job fails.
Can BigQuery load a regular JSON array file?
Not with a load job: the source must be newline-delimited, one object per line. Convert the file first, for example with jq -c '.[]'.
Why does a null inside an array fail?
BigQuery arrays can't contain NULL elements in stored data. A repeated field can be null or an array, but [1, null, 3] is invalid. Clean the array upstream or load the field as JSON.
Related
SQL reference
All BigQuery error messages · What 50M daily events say about BigQuery failures
