This is an automated email from the ASF dual-hosted git repository.
karan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new b1aa6609de9 fix detection for catalog DuplicateKeyException when
overwriting table definitions (#18932)
b1aa6609de9 is described below
commit b1aa6609de98e67f70ce8e8549bf2e1395f4acaf
Author: Clint Wylie <[email protected]>
AuthorDate: Tue Jan 20 20:52:54 2026 -0800
fix detection for catalog DuplicateKeyException when overwriting table
definitions (#18932)
---
.../java/org/apache/druid/catalog/storage/sql/DbUtils.java | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git
a/extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/DbUtils.java
b/extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/DbUtils.java
index b421653f1c1..40daa127087 100644
---
a/extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/DbUtils.java
+++
b/extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/storage/sql/DbUtils.java
@@ -21,6 +21,8 @@ package org.apache.druid.catalog.storage.sql;
import org.skife.jdbi.v2.exceptions.UnableToExecuteStatementException;
+import java.sql.SQLIntegrityConstraintViolationException;
+
public class DbUtils
{
// Move to SqlMetadataConnector and its subclasses
@@ -31,13 +33,7 @@ public class DbUtils
return false;
}
- // Use class names to avoid compile-time dependencies.
- // Derby implementation
- if
(cause.getClass().getSimpleName().equals("DerbySQLIntegrityConstraintViolationException"))
{
- return true;
- }
- // MySQL implementation
- if
(cause.getClass().getSimpleName().equals("MySQLIntegrityConstraintViolationException"))
{
+ if (cause instanceof SQLIntegrityConstraintViolationException) {
return true;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]