{"record":{"id":"c86e938c47a057ef","repo":"apache/seatunnel","slug":"unsupported-vitess-catalog-sql-type","errorCode":null,"errorMessage":"Unsupported Vitess catalog SQL type: ","messagePattern":"Unsupported Vitess catalog SQL type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-vitess/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/vitess/source/split/VitessTableSchemaState.java","lineNumber":230,"sourceCode":"            case BIGINT:\n                return \"BIGINT\";\n            case FLOAT:\n                return \"FLOAT\";\n            case DOUBLE:\n                return \"DOUBLE\";\n            case DECIMAL:\n                return \"DECIMAL\";\n            case BYTES:\n                return \"BLOB\";\n            case DATE:\n                return \"DATE\";\n            case TIME:\n                return \"TIME\";\n            case TIMESTAMP:\n            case TIMESTAMP_TZ:\n                return \"TIMESTAMP\";\n            default:\n                throw new IllegalArgumentException(\n                        \"Unsupported Vitess catalog SQL type: \" + sqlType);\n        }\n    }\n\n    private static String normalizeTypeExpression(String sourceType) {\n        if (sourceType == null) {\n            return null;\n        }\n        String trimmed = sourceType.trim();\n        return trimmed.isEmpty() ? null : trimmed.toUpperCase(Locale.ROOT);\n    }\n\n    private static String baseTypeName(String typeExpression) {\n        int parenthesisIndex = typeExpression.indexOf('(');\n        if (parenthesisIndex < 0) {\n            return typeExpression;\n        }\n        return typeExpression.substring(0, parenthesisIndex).trim();","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-vitess/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/vitess/source/split/VitessTableSchemaState.java#L212-L248","documentation":"defaultTypeName converts a java.sql.Types (or Vitess catalog) SQL type integer back to a human-readable SQL type name when normalizing the bootstrap schema. If the sqlType value is not in the handled set, it throws this IllegalArgumentException. It indicates the schema contains a SQL type the Vitess connector's reverse mapping does not recognize.","triggerScenarios":"Calling typeName -> defaultTypeName during schema normalization when a column's resolved sqlType (e.g. Types.ARRAY, Types.BINARY, Types.OTHER) has no case in the switch, typically after a forward-mapping step produced or preserved an unhandled type constant.","commonSituations":"Tables with BLOB/BINARY/geometry columns whose JDBC types survive into normalization; a mismatch between the forward mapping (resolveJdbcType) and reverse mapping tables after partial type support was added.","solutions":["Inspect the sqlType integer in the message and identify which column produces it, then alter the table to use a supported type","Add the missing case to defaultTypeName returning the correct SQL type name string and rebuild","Ensure resolveJdbcType and defaultTypeName switches stay in sync so forward and reverse mappings cover the same type set"],"exampleFix":"// before\ncase TIMESTAMP:\ncase TIMESTAMP_TZ:\n    return \"TIMESTAMP\";\ndefault:\n    throw new IllegalArgumentException(\"Unsupported Vitess catalog SQL type: \" + sqlType);\n// after\ncase TIMESTAMP:\ncase TIMESTAMP_TZ:\n    return \"TIMESTAMP\";\ncase Types.BINARY:\n    return \"BINARY\";\ndefault:\n    throw new IllegalArgumentException(\"Unsupported Vitess catalog SQL type: \" + sqlType);","handlingStrategy":"validation","validationCode":"for (Column column : tableColumns) {\n    int sqlType = column.getDataType().getSqlType();\n    if (sqlType == Types.ARRAY || sqlType == Types.BINARY || sqlType == Types.OTHER) {\n        throw new IllegalArgumentException(\"sqlType \" + sqlType + \" of column \" + column.getName() + \" has no Vitess type-name mapping\");\n    }\n}","typeGuard":"boolean hasTypeNameMapping(int sqlType) {\n    switch (sqlType) {\n        case Types.VARCHAR: case Types.CHAR: case Types.INTEGER:\n        case Types.BIGINT: case Types.DOUBLE: case Types.TIME:\n        case Types.TIMESTAMP: return true;\n        default: return false;\n    }\n}","tryCatchPattern":"try {\n    String typeName = normalizeColumn(column);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported Vitess catalog SQL type\")) {\n        logger.warn(\"Falling back to VARCHAR mapping for column {} ({})\", column.getName(), e.getMessage());\n        return \"VARCHAR\";\n    }\n    throw e;\n}","preventionTips":["Keep resolveJdbcType and defaultTypeName switches symmetric and tested against the full SqlType enum","Filter out or explicitly map BLOB/BINARY/geometry columns before schema normalization","Add a fallback mapping (Types.OTHER -> VARCHAR) in custom code paths instead of letting the default case throw"],"tags":["cdc","vitess","schema","type-mapping"],"backgroundTag":"unsupported-enum-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}