Request a demo

BigQuery error · Loading and schema

Provided Schema does not match Table

A load, query append, copy or schema update sent a schema that conflicts with the table, most often a column whose type changed. BigQuery never changes a column type implicitly. Cast the data to the table's type, or widen the column with ALTER COLUMN SET DATA TYPE when the change is supported.

Error reason invalid · HTTP 400 · Checked against the Google Cloud docs in November 2026

The error message

Provided Schema does not match Table <project>:<dataset>.<table>. Field <field> has changed type from <type> to <type>

Causes

Schema autodetect inferred a different type

Autodetect looks at the file being loaded. If yesterday's file had only whole numbers and today's has 12.5, the inferred type flips from INTEGER to FLOAT and the append fails. A column that is empty in one file can flip types the same way.

DataFrame writes infer types from pandas

Writing a DataFrame with the Python client or pandas-gbq derives the schema from dtypes. An integer column containing missing values becomes float in pandas, which BigQuery sees as FLOAT instead of INTEGER.

A query appends a different type

An INSERT ... SELECT or a query job with a destination table and WRITE_APPEND produces a column type that differs from the table, for example a CAST(... AS STRING) added upstream or a dbt model whose logic changed.

Other variants of the message

The same error covers Field <field> is missing in new schema (a column was omitted), Field <field> has changed mode from REQUIRED to NULLABLE (unsupported mode change) and Cannot add fields (field: <field>) (a new column without schema update options). All return reason invalid.

How to fix it

1. Send an explicit schema that matches the table

For recurring loads, pass the table's schema instead of autodetect, or set the column types explicitly in the client (job_config.schema in Python). Read the current schema from INFORMATION_SCHEMA.

SELECT column_name, data_type, is_nullable
FROM `project.raw`.INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'orders'
ORDER BY ordinal_position;

2. Cast in the query that appends

Make the SELECT produce exactly the table's types.

INSERT INTO `project.sales.orders` (order_id, quantity, amount)
SELECT
  CAST(order_id AS INT64),
  SAFE_CAST(quantity AS INT64),
  CAST(amount AS NUMERIC)
FROM `project.staging.orders_batch`;

3. Widen the column when the change is supported

ALTER COLUMN SET DATA TYPE supports INT64 to NUMERIC, BIGNUMERIC or FLOAT64, and NUMERIC to BIGNUMERIC or FLOAT64.

ALTER TABLE `project.sales.orders`
ALTER COLUMN quantity SET DATA TYPE NUMERIC;

4. Rebuild the table for other type changes

INT64 to STRING, STRING to INT64 and narrowing changes need a rewrite. This scans and rewrites the whole table: on-demand it is billed as a query over all the columns you read.

CREATE OR REPLACE TABLE `project.sales.orders`
PARTITION BY order_date
AS
SELECT * REPLACE (CAST(postal_code AS STRING) AS postal_code)
FROM `project.sales.orders`;

How to prevent it

  • Use explicit schemas for production loads and keep them in version control.
  • Add a schema check before loading (compare the file's inferred schema with INFORMATION_SCHEMA.COLUMNS) and alert on drift instead of failing at load time.
  • When rebuilding with CREATE OR REPLACE, keep partitioning, clustering and options in the statement, or the new table loses them.

FAQ

Can a load job change a column's type?

No. Schema update options only allow adding fields (ALLOW_FIELD_ADDITION) and relaxing REQUIRED to NULLABLE (ALLOW_FIELD_RELAXATION). Type changes need ALTER COLUMN SET DATA TYPE or a rewrite.

Why is INT64 to STRING not supported by ALTER COLUMN?

ALTER COLUMN SET DATA TYPE only allows conversions to a less restrictive numeric type: INT64 to NUMERIC, BIGNUMERIC or FLOAT64, and NUMERIC to BIGNUMERIC or FLOAT64. Anything else needs a query that casts and rewrites the data.

Is anything written when this error occurs?

No. The job fails before writing, so the table keeps its data and schema.

SQL reference

More loading and schema

All BigQuery error messages · What 50M daily events say about BigQuery failures

Stop finding BigQuery failures in Slack threads

Masthead watches every BigQuery job, dbt model, Dataform action and Airflow task from audit logs, groups failures into incidents and shows which tables and dashboards are affected. No access to your data and no added BigQuery cost.