---
title: STATE_STORE_KEY_SCHEMA_NOT_COMPATIBLE error condition
description: Documentation for the STATE\_STORE\_KEY\_SCHEMA\_NOT\_COMPATIBLE error condition on Databricks
canonical_url: https://docs.databricks.com/gcp/en/error-messages/state-store-key-schema-not-compatible-error-class
---

# STATE\_STORE\_KEY\_SCHEMA\_NOT\_COMPATIBLE error condition

[SQLSTATE: 42000](https://docs.databricks.com/gcp/en/error-messages/sqlstates.md#class-42-syntax-error-or-access-rule-violation)

The provided key schema does not match existing schema in operator state.
Existing schema=`<storedKeySchema>`; provided schema=`<newKeySchema>`.
To run the query without schema validation, set spark.sql.streaming.stateStore.stateSchemaCheck to false.
Note that running without schema validation can have non-deterministic behavior.

## FIELDS\_REORDERED

The key schema fields have been reordered. Reordering fields in the key schema is not allowed.

## FIELD\_ADDED

New field(s) `<addedFields>` found in the key schema. Adding fields to the key schema is not allowed.

## FIELD\_REMOVED

Field(s) `<removedFields>` missing from the key schema. Removing fields from the key schema is not allowed.

## NULLABILITY\_CHANGED

Nullability of field(s) `<changedFields>` in the key schema has changed. Changing nullability of key fields is not allowed.

## TYPE\_CHANGED

Type of field(s) `<changedFields>` in the key schema has changed. Changing types of key fields is not allowed.

## UNKNOWN\_INCOMPATIBILITY

The key schema has changed in an incompatible way.

## UNSAFE\_KEY\_ALIGNMENT\_AFTER\_SCALA\_MIGRATION

A key schema change was detected during operator key alignment with a Scala 2.12 to 2.13 upgrade (operator: `<operatorType>`). `<description>` Unsupported and may corrupt the running query. Consider restarting the query with a new checkpoint location or reach out to the Databricks team for assistance.
