High severitydata quality
Power BI Refresh Error:
INCOMPATIBLE_DATA_FOR_TABLE
What does this error mean?
Data being written to a Delta table is incompatible with the table's schema or constraints. This includes writing nullable values to a NOT NULL column, writing extra columns to a struct with no extra-field support, or writing values that violate a CHECK constraint.
Common causes
- 1Writing nullable values to a NOT NULL column without a DEFAULT or COALESCE expression
- 2Writing additional struct fields to a table that was created without allowColumnDefaults or schema evolution enabled
- 3A CHECK constraint on the table was violated by a new range of values in the source data
- 4An INSERT INTO statement omits required columns, leaving them NULL when NOT NULL is enforced
- 5Schema evolution was not enabled but the incoming DataFrame has extra columns compared to the table
How to fix it
- 1Inspect the error message for the specific sub-cause: NULL in NOT NULL column, extra struct fields, or CHECK constraint violation.
- 2For NULL issues, add COALESCE(col, default_value) upstream or set a DEFAULT in the table DDL.
- 3For extra columns, enable schema evolution: .option('mergeSchema', 'true') on the write, or ALTER TABLE SET TBLPROPERTIES (delta.columnMapping.mode = 'name').
- 4For CHECK constraint violations, review the constraint logic with SHOW TBLPROPERTIES on the table and fix the upstream data.
- 5Use Delta Live Tables expectations to catch violations earlier in the pipeline.