{"record":{"id":"d1f834be6d8357a5","repo":"apache/seatunnel","slug":"unsupported-type-d1f834","errorCode":"UNSUPPORTED_TYPE","errorMessage":"Unsupported SeaTunnel type for Couchbase sink: {sqlType}. Field: {key}","messagePattern":"Unsupported SeaTunnel type for Couchbase sink: (.+?)\\. Field: (.+?)","errorType":"error_code","errorClass":"CouchbaseConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-couchbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/couchbase/sink/CouchbaseWriter.java","lineNumber":316,"sourceCode":"            case TIME:\n            case TIMESTAMP:\n                doc.put(key, value.toString());\n                break;\n            case BYTES:\n                // Couchbase JSON does not natively encode byte arrays; store as Base64 string.\n                doc.put(key, java.util.Base64.getEncoder().encodeToString((byte[]) value));\n                break;\n            case ARRAY:\n                doc.put(key, toJsonArray((Object[]) value, (ArrayType<?, ?>) dataType));\n                break;\n            case MAP:\n                doc.put(key, toJsonObjectFromMap((Map<?, ?>) value, (MapType<?, ?>) dataType));\n                break;\n            case ROW:\n                doc.put(key, toJsonObject((SeaTunnelRow) value, (SeaTunnelRowType) dataType));\n                break;\n            default:\n                throw new CouchbaseConnectorException(\n                        CouchbaseConnectorErrorCode.UNSUPPORTED_TYPE,\n                        \"Unsupported SeaTunnel type for Couchbase sink: \"\n                                + dataType.getSqlType()\n                                + \". Field: \"\n                                + key);\n        }\n    }\n\n    /**\n     * Converts an array value to a {@link JsonArray}, recursively converting each element according\n     * to the declared element type.\n     */\n    private JsonArray toJsonArray(Object[] elements, ArrayType<?, ?> arrayType) {\n        SeaTunnelDataType<?> elementType = arrayType.getElementType();\n        JsonArray arr = JsonArray.create();\n        for (Object element : elements) {\n            if (element == null) {\n                arr.add((Object) null);","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-couchbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/couchbase/sink/CouchbaseWriter.java#L298-L334","documentation":"putValue() maps each row field into a JSON document; the default branch rejects SeaTunnel types the Couchbase sink cannot serialize, reporting the SQL type and field name. Only primitive, array, map and row types are handled — anything else (or an unexpected type) triggers UNSUPPORTED_TYPE.","triggerScenarios":"A schema field whose SeaTunnel type falls into putValue's default branch (unhandled sqlType) reaching toJsonObject; schema evolved to include a type the sink's serializer doesn't cover.","commonSituations":"Using newer SeaTunnel types (e.g. TimeType variants or custom types) not yet mapped in the Couchbase writer; schema inferred from a source emitting exotic types.","solutions":["Change the offending field's type to a supported type (string, int, long, double, boolean, bytes, date, time, timestamp, array, map, row)","Cast/coerce the field in a transform before the sink (e.g. CAST(col AS STRING))","Upgrade SeaTunnel/connector in case the type is newly supported"],"exampleFix":"// before\nquery = \"select * from src\" // src.bin is BYTES-heavy custom type\n// after\nquery = \"select CAST(bin_col AS STRING) AS bin_col, * from src\"","handlingStrategy":"validation","validationCode":"java\nSet<SqlType> supported = Set.of(STRING, INT, BIGINT, DOUBLE, BOOLEAN, BYTES, DATE, TIME, TIMESTAMP, ARRAY, MAP, ROW);\nfor (SeaTunnelDataType<?> t : rowType.getFieldTypes()) {\n    if (!supported.contains(t.getSqlType())) throw new IllegalStateException(\"unsupported: \" + t.getSqlType());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cast exotic types to STRING in an upstream transform","Review sink schema types before deploying","Keep connector versions current"],"tags":["unsupported-type","serialization","couchbase"],"backgroundTag":"unsupported-dtype","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"}