Skip to content

Commit 252b51e

Browse files
committed
add an warning for the conflicted constraints
Signed-off-by: JustinRush80 <[email protected]>
1 parent 31e3daf commit 252b51e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/core/src/operations/constraints.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ impl std::future::IntoFuture for ConstraintBuilder {
158158
// when the expression is different in the conflicted constraint --> error out due not knowing how to resolve it
159159
if !metadata.configuration()[configuration_key].eq(&constraints_sql_mapper[name]) {
160160
return Err(DeltaTableError::Generic(format!(
161-
"Constraint with name: {name} already exists and Expression is different"
162-
)));
161+
"Cannot add constraint '{name}': a constraint with this name already exists with a different expression. Existing: '{}', New: '{}'",
162+
metadata.configuration()[configuration_key],constraints_sql_mapper[name]
163+
)));
163164
}
165+
tracing::warn!("Skipping constraint '{name}': identical constraint already exists with expression '{}'",constraints_sql_mapper[name]);
164166
}
165167
let constraints_checker: Vec<Constraint> = constraints_sql_mapper
166168
.iter()

0 commit comments

Comments
 (0)