{"record":{"id":"4e676bb225088c49","repo":"apache/seatunnel","slug":"unsupported-data-format-type","errorCode":null,"errorMessage":"Unsupported data format type: ","messagePattern":"Unsupported data format type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-aerospike/src/main/java/org/apache/seatunnel/connectors/seatunnel/aerospike/sink/AerospikeSinkWriter.java","lineNumber":140,"sourceCode":"                    break;\n\n                case KV:\n                    Map<String, Object> fieldsMap =\n                            JSON.parseObject(data, new TypeReference<Map<String, Object>>() {});\n                    List<Bin> bins = new ArrayList<>();\n                    Map<String, String> configFieldTypes =\n                            config.get(AerospikeSinkOptions.FIELD_TYPES);\n                    for (String fieldName : configFieldTypes.keySet()) {\n                        Object value = fieldsMap.get(fieldName);\n                        AerospikeDataType dataType = typeConverter.getFieldType(fieldName);\n                        Object convertedValue = convertValue(value, dataType);\n                        bins.add(new Bin(fieldName, convertedValue));\n                    }\n                    aerospikeClient.put(writePolicy, aerospikeKey, bins.toArray(new Bin[0]));\n                    break;\n\n                default:\n                    throw new IllegalArgumentException(\n                            \"Unsupported data format type: \" + formatType);\n            }\n        } catch (Exception e) {\n            throw new AerospikeConnectorException(\n                    AerospikeErrorCode.WRITER_OPERATION_FAILED, \"Failed to write record\", e);\n        }\n    }\n\n    @Override\n    public void close() throws IOException {\n        try {\n            if (Objects.nonNull(aerospikeClient)) {\n                aerospikeClient.close();\n            }\n        } catch (Exception e) {\n            throw new AerospikeConnectorException(\n                    AerospikeErrorCode.WRITER_CLOSE_FAILED, \"Failed to close writer\", e);\n        }","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-aerospike/src/main/java/org/apache/seatunnel/connectors/seatunnel/aerospike/sink/AerospikeSinkWriter.java#L122-L158","documentation":"In AerospikeSinkWriter.write, a switch on the configured formatType builds Aerospike Bins; the default branch throws IllegalArgumentException 'Unsupported data format type: <formatType>' for format types the writer has no conversion logic for. Unlike the generic write failure path, this indicates a config/enum gap rather than an I/O problem.","triggerScenarios":"Configuring an aerospike sink with a DataFormatType that has no case in the write switch (e.g. a newly added enum value not handled by the writer), so the default branch executes while putting a record.","commonSituations":"Using a format option valid in another connector; connector version mismatch where the enum gained a value the writer switch doesn't handle; typos avoided by the enum but unsupported values still reach here.","solutions":["Set the sink format to a supported type (json or string)","Check the writer switch in AerospikeSinkWriter.write to see which formatTypes are actually handled","Upgrade or downgrade connector versions so the enum and the writer logic match","File an issue if a documented format is not handled"],"exampleFix":"// before\nformat = jsonline\n// after\nformat = json","handlingStrategy":"validation","validationCode":"if (formatType != DataFormatType.JSON && formatType != DataFormatType.STRING) throw new IllegalArgumentException(\"format not supported by aerospike sink: \" + formatType);","typeGuard":null,"tryCatchPattern":"try { writer.write(row); } catch (AerospikeConnectorException e) { if (e.getCause() instanceof IllegalArgumentException && e.getCause().getMessage().startsWith(\"Unsupported data format type\")) { /* fix config, abort job */ } }","preventionTips":["Use only documented format values for the aerospike sink","Keep enum and writer logic in the same connector version","Add a unit test iterating all DataFormatType values against the writer switch","Review connector release notes for newly added format types"],"tags":["aerospike","enum","sink","unsupported"],"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"}