Error when trying to perform maintenance on a Delta table

Avoid manual maintenance, or disable predictive optimization if manual maintenance is necessary.

Written by avi.yehuda

Last published at: January 29th, 2025

Problem

When you attempt to perform maintenance operations on a Delta table, you encounter an error. 

 

io.delta.exceptions.ConcurrentTransactionException: A conflicting metadata domain com.databricks.liquid is added.

 

The error persists even though you are the only person running commands on the table.

 

Cause

You are running concurrent maintenance operations such as OPTIMIZE, ANALYZE, or VACUUM on the Delta table. 

 

If you are the sole person performing these operations, it is likely due to the predictive optimization feature being enabled for their tables. Predictive optimization executes maintenance commands using a background cluster that isn’t visible in your UI. 

 

Confirm whether you have concurrent maintenance operations running by using the DESC HISTORY command on the Delta table. Check if another maintenance command was executed at the time of failure. If predictive optimization was responsible, the user and cluster associated with the command will differ from your username and cluster. The username will typically appear in a format such as 11111111-aaaa-bbbb-cccc-dddddddddddd.

 

Solution

Avoid triggering manual maintenance commands. 

 

If you need to manage operation manually, use the following code to disable the predictive optimization feature for specific schemas or catalogs.

 

ALTER SCHEMA <my-schema> DISABLE PREDICTIVE OPTIMIZATION;
ALTER DATABASE <my-database> DISABLE PREDICTIVE OPTIMIZATION;

 

For more information, review the Predictive optimization for Unity Catalog managed tables (AWSAzure) documentation.