Package com.databricks.jdbc.common.util
Class SqlStateClassifier
- java.lang.Object
-
- com.databricks.jdbc.common.util.SqlStateClassifier
-
public final class SqlStateClassifier extends Object
Reclassifies SQL states for known transient or mis-categorized server errors so callers can programmatically identify retryable failures.Patterns handled:
- Unity Catalog unavailability (
UC_CLIENT_EXCEPTION) →08S01(communication link failure, retryable). - Connection-acquisition / parquet read deadlines (
PARQUET_FAILED_READ_FOOTER,DEADLINE_EXCEEDED: acquiring connection) →08S01. - Server-side
java.util.ConcurrentModificationExceptionmis-mapped to42000(syntax/access violation) →40001(serialization failure, retryable). Only applied when the original SQL state is42000so unrelated42xxxstates are preserved.
Patterns are anchored on stable server-emitted tokens (Spark error classes, fully-qualified Java exception names) rather than English prose, so server message rewording does not silently regress the classifier.
- Unity Catalog unavailability (
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringclassifyTransientSqlState(String errorMessage, String originalSqlState)Returns a remapped SQL state iferrorMessagematches a known transient pattern, ororiginalSqlStateotherwise.
-
-
-
Method Detail
-
classifyTransientSqlState
public static String classifyTransientSqlState(String errorMessage, String originalSqlState)
Returns a remapped SQL state iferrorMessagematches a known transient pattern, ororiginalSqlStateotherwise. Pure function — callers should log the remap separately with their own context (statement ID, response).
-
-