MetricSign
EN|NLRequest Access
High severitydata quality

Power BI Refresh Error:
NOT_NULL_CONSTRAINT_VIOLATION

What does this error mean?

A write operation attempted to insert NULL values into a column defined as NOT NULL. Delta Lake enforces this constraint at write time and rejects the entire batch to protect data integrity.

Common causes

  • 1An upstream transformation produced NULL values in a column that was not expected to be nullable
  • 2A JOIN expanded the dataset with unmatched rows, introducing NULLs in the key columns
  • 3A new NOT NULL constraint was added to an existing column but existing pipelines still write nullable data
  • 4A data source schema change caused a previously populated column to become absent or NULL
  • 5A DEFAULT value was not specified for a new NOT NULL column when inserting partial rows

How to fix it

  1. 1Identify which column is violating the constraint: the error message includes the column path.
  2. 2Add a NULL filter upstream: WHERE col IS NOT NULL, or use COALESCE(col, default_value).
  3. 3Review the JOIN type — switch from LEFT JOIN to INNER JOIN if NULLs from unmatched rows are unacceptable.
  4. 4If the constraint is too strict, use ALTER TABLE DROP CONSTRAINT to remove it and add a CHECK constraint instead.
  5. 5Add a data quality expectation in Delta Live Tables: CONSTRAINT not_null EXPECT (col IS NOT NULL) ON VIOLATION DROP ROW.

Frequently asked questions

Does NOT NULL enforcement apply to both INSERT and MERGE?

Yes. Delta Lake enforces NOT NULL constraints on all write operations: INSERT, UPDATE, MERGE, and COPY INTO.

Can I log rejected rows instead of failing the job?

In Delta Live Tables, use ON VIOLATION DROP ROW or ON VIOLATION FAIL UPDATE to control behavior. In plain Delta writes, you must filter invalid rows before the write.

Other data quality errors