{"record":{"id":"cca5bb7260777a9d","repo":"apache/seatunnel","slug":"common-unsupported-data-type","errorCode":"COMMON_UNSUPPORTED_DATA_TYPE","errorMessage":"Unexpected value: ","messagePattern":"Unexpected value: ","errorType":"error_code","errorClass":"ElasticsearchConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/serialize/source/DefaultSeaTunnelRowDeserializer.java","lineNumber":239,"sourceCode":"                    String fieldName = rowType.getFieldName(i);\n                    SeaTunnelDataType<?> fieldDataType = rowType.getFieldType(i);\n                    Object value = collect.get(fieldName);\n                    if (value != null) {\n                        seaTunnelFields[i] =\n                                convertValue(\n                                        fieldDataType,\n                                        (value instanceof List || value instanceof Map)\n                                                ? mapper.writeValueAsString(value)\n                                                : value.toString());\n                    }\n                }\n                return new SeaTunnelRow(seaTunnelFields);\n            } else if (fieldType instanceof PrimitiveByteArrayType) {\n                return Base64.getDecoder().decode(fieldValue);\n            } else if (VOID_TYPE.equals(fieldType) || fieldType == null) {\n                return null;\n            } else {\n                throw new ElasticsearchConnectorException(\n                        CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,\n                        \"Unexpected value: \" + fieldType);\n            }\n        }\n    }\n\n    private LocalDateTime parseDate(String fieldValue) {\n        // handle strings of timestamp type\n        try {\n            long ts = Long.parseLong(fieldValue);\n            return LocalDateTime.ofInstant(Instant.ofEpochMilli(ts), ZoneId.systemDefault());\n        } catch (NumberFormatException e) {\n            // no op\n        }\n        String formatDate = fieldValue.replace(\"T\", \" \").replace(\"Z\", \"\");\n        if (fieldValue.length() == \"yyyyMMdd\".length()\n                || fieldValue.length() == \"yyyy-MM-dd\".length()) {\n            formatDate = fieldValue + \" 00:00:00\";","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/serialize/source/DefaultSeaTunnelRowDeserializer.java#L221-L257","documentation":"convertValue handles a fixed set of SeaTunnel field types when deserializing ES documents. If the field's SeaTunnelDataType is none of the supported types (and not VOID or null), it throws ElasticsearchConnectorException with UNSUPPORTED_DATA_TYPE: 'Unexpected value: ' + the type.","triggerScenarios":"A source table field whose type maps to a SeaTunnelDataType not covered by the if/else chain in DefaultSeaTunnelRowDeserializer.convertValue (e.g. an array/map/row type the deserializer does not handle).","commonSituations":"Schema evolution added a complex column type; connector version lacks support for the type; users declare exotic types in source config read from ES.","solutions":["Change the column type in the SeaTunnel schema to a supported type (string, boolean, byte, short, int, long, float, double, date, time, timestamp, bytes, or row as handled)","Convert unsupported types to strings/structs upstream before the ES sink","Upgrade the connector to a version with wider type support"],"exampleFix":"// before\nfield my_map MAP<STRING,STRING>\n// after\nfield my_map STRING  // JSON-serialize map upstream, or use a supported type","handlingStrategy":"type-guard","validationCode":"Set<SqlType> supported = Set.of(STRING, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, DATE, TIME, TIMESTAMP, BYTES, ROW);\nrowType.getFieldTypes().forEach(t -> {\n    if (!supported.contains(t.getSqlType()) && !(t instanceof PrimitiveByteArrayType))\n        throw new IllegalArgumentException(\"Unsupported ES deserializer type: \" + t);\n});","typeGuard":"boolean isSupportedFieldType(SeaTunnelDataType<?> t) {\n    return t instanceof BasicType || t instanceof LocalTimeType || t instanceof PrimitiveByteArrayType || t instanceof SeaTunnelRowType || VOID_TYPE.equals(t);\n}","tryCatchPattern":null,"preventionTips":["Use only basic/date/time/bytes/row types in ES source schemas","Convert complex types to STRING upstream","Check the deserializer's supported type list when designing schemas"],"tags":["elasticsearch","deserialization","unsupported-datatype","type-mismatch"],"backgroundTag":"unsupported-dtype","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}