{"record":{"id":"fea95071a8b2a219","repo":"apache/seatunnel","slug":"unsupported-operation-fea950","errorCode":"UNSUPPORTED_OPERATION","errorMessage":"Unsupported type: ","messagePattern":"Unsupported type: ","errorType":"error_code","errorClass":"TypesenseConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/serialize/KeyExtractor.java","lineNumber":77,"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 TypesenseConnectorException(\n                            CommonErrorCodeDeprecated.UNSUPPORTED_OPERATION,\n                            \"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    private interface FieldFormatter extends Serializable {","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/serialize/KeyExtractor.java#L59-L95","documentation":"KeyExtractor.createFieldFormatter builds a per-field formatter that converts a SeaTunnelRow field into a Typesense-compatible value. Structured SeaTunnel SQL types (ROW, ARRAY, MAP) have no formatter, so encountering one immediately throws TypesenseConnectorException(UNSUPPORTED_OPERATION, \"Unsupported type: \" + fieldType).","triggerScenarios":"Typesense row serialization encounters a field whose SeaTunnelDataType has SqlType ROW, ARRAY, or MAP — e.g. the source schema declares a nested struct, array, or map column while writing to a Typesense sink.","commonSituations":"Reading from databases/sources that produce nested JSON columns, array columns (e.g. PostgreSQL arrays), or map columns and writing to Typesense without flattening the schema first.","solutions":["Flatten nested fields before the Typesense sink (use a transform to extract scalar fields from the row/array/map).","Change the source schema projection to select only primitive-typed columns.","If nested data is required, serialize it to a string yourself before it reaches the sink."],"exampleFix":"// before (schema with nested field)\nrowType = \"name STRING, tags ARRAY<STRING>\";\n// after (flattened for Typesense)\nrowType = \"name STRING, tags STRING\"; // join/serialize tags to CSV or JSON string upstream","handlingStrategy":"validation","validationCode":"// reject unsupported field types before writing to Typesense\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 field: \" + f.getName());\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Design the Typesense schema with only scalar fields.","Flatten ROW/ARRAY/MAP columns with a transform before the sink.","Serialize nested structures to strings upstream if nesting is unavoidable."],"tags":["typesense","serialization","unsupported-type","schema"],"backgroundTag":"unsupported-operation","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"}