{"record":{"id":"5835c3ab7bdee4ff","repo":"apache/seatunnel","slug":"unsupported-operation-5835c3","errorCode":"UNSUPPORTED_OPERATION","errorMessage":"Unsupported type: ","messagePattern":"Unsupported type: ","errorType":"error_code","errorClass":"EasysearchConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/serialize/KeyExtractor.java","lineNumber":65,"sourceCode":"\n        List<FieldFormatter> fieldFormatters = new ArrayList<>(primaryKeys.length);\n        for (String fieldName : primaryKeys) {\n            int fieldIndex = rowType.indexOf(fieldName);\n            SeaTunnelDataType<?> fieldType = rowType.getFieldType(fieldIndex);\n            FieldFormatter fieldFormatter = createFieldFormatter(fieldIndex, fieldType);\n            fieldFormatters.add(fieldFormatter);\n        }\n        return new KeyExtractor(fieldFormatters.toArray(new FieldFormatter[0]), keyDelimiter);\n    }\n\n    private static FieldFormatter createFieldFormatter(\n            int fieldIndex, SeaTunnelDataType fieldType) {\n        return row -> {\n            switch (fieldType.getSqlType()) {\n                case ROW:\n                case ARRAY:\n                case MAP:\n                    throw new EasysearchConnectorException(\n                            UNSUPPORTED_OPERATION, \"Unsupported type: \" + fieldType);\n                case DATE:\n                    LocalDate localDate = (LocalDate) row.getField(fieldIndex);\n                    return localDate.toString();\n                case TIME:\n                    LocalTime localTime = (LocalTime) row.getField(fieldIndex);\n                    return localTime.toString();\n                case TIMESTAMP:\n                    LocalDateTime localDateTime = (LocalDateTime) row.getField(fieldIndex);\n                    return localDateTime.toString();\n                default:\n                    return row.getField(fieldIndex).toString();\n            }\n        };\n    }\n\n    @Override\n    public String apply(SeaTunnelRow row) {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/serialize/KeyExtractor.java#L47-L83","documentation":"KeyExtractor.createFieldFormatter builds per-field serializers for converting SeaTunnelRow data into Easysearch bulk documents. It explicitly rejects ROW, ARRAY, and MAP SQL types because the Easysearch serializer has no mapping for nested/complex structures. Any source schema containing these types fails fast when the row is serialized for writing.","triggerScenarios":"Writing a SeaTunnelRow whose SeaTunnelDataType has getSqlType() of ROW, ARRAY, or MAP to an Easysearch sink; the exception fires inside the row lambda created by fieldFormatter when that field is formatted.","commonSituations":"Upstream table has a JSON/nested column mapped to ROW, an array column (e.g. MySQL ARRAY or a LIST type), or a MAP/struct column; schema evolution upstream added a nested field; users copy a catalog config from another sink (e.g. Elasticsearch variants) without flattening.","solutions":["Flatten nested ROW fields into top-level scalar columns upstream (e.g. in a SQL query or a Transform before the sink).","Convert ARRAY/MAP columns to a JSON string (CAST to STRING) so the field is serialized as text.","Exclude the unsupported columns via source projection (query only scalar columns).","If support is genuinely needed, add ROW/ARRAY/MAP handling in KeyExtractor.createFieldFormatter and file/extend an upstream issue."],"exampleFix":"// before: schema contains Map<String,String> tags column\n// after: flatten/cast upstream\nSELECT id, name, CAST(tags AS STRING) AS tags FROM my_table;","handlingStrategy":"validation","validationCode":"// Java: check schema before writing\nfor (SeaTunnelRowType.Field f : rowType.getFields()) {\n    SqlType t = f.getType().getSqlType();\n    if (t == SqlType.ROW || t == SqlType.ARRAY || t == SqlType.MAP) {\n        throw new IllegalArgumentException(\"Flatten/cast field '\" + f.getName() + \"' before Easysearch sink\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try { writer.write(row); } catch (EasysearchConnectorException e) { if (e.getSeaTunnelErrorCode() == UNSUPPORTED_OPERATION && e.getMessage().startsWith(\"Unsupported type:\")) { log.error(\"Flatten unsupported nested field first\", e); throw e; } }","preventionTips":["Project only scalar columns from the source query","Cast MAP/ARRAY/ROW columns to STRING before the sink","Validate the row type against the sink's supported types in a pre-flight check"],"tags":["easysearch","serialization","unsupported-type"],"backgroundTag":"unsupported-operation","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"}