{"record":{"id":"12ee4e01609af2a9","repo":"apache/seatunnel","slug":"unsupported-aerospike-data-type","errorCode":null,"errorMessage":"Unsupported AEROSPIKE data type: ","messagePattern":"Unsupported AEROSPIKE data 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":221,"sourceCode":"            case BOOLEAN:\n                if (value instanceof Boolean) {\n                    return value;\n                }\n                return Boolean.parseBoolean(value.toString());\n            case BYTEARRAY:\n                if (value.getClass().isArray()) {\n                    return value;\n                }\n                throw new IllegalArgumentException(\n                        \"Expected Array type but got: \" + value.getClass());\n            case LIST:\n                if (value instanceof Iterable) {\n                    return value;\n                }\n                throw new IllegalArgumentException(\n                        \"Expected List type but got: \" + value.getClass());\n            default:\n                throw new IllegalArgumentException(\"Unsupported AEROSPIKE data type: \" + dataType);\n        }\n    }\n\n    private long parseDateTimeString(String datetime) {\n        try {\n            return LocalDateTime.parse(datetime)\n                    .atZone(ZoneId.systemDefault())\n                    .toInstant()\n                    .toEpochMilli();\n        } catch (DateTimeParseException e) {\n            try {\n                return Instant.parse(datetime).toEpochMilli();\n            } catch (DateTimeParseException ex) {\n                throw new IllegalArgumentException(\"Unsupported datetime format: \" + datetime);\n            }\n        }\n    }\n","sourceCodeStart":203,"sourceCodeEnd":239,"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#L203-L239","documentation":"AerospikeSinkWriter.convertValue() maps upstream SeaTunnel values into Aerospike bin values based on the AerospikeDataType configured for the field. The switch only handles STRING, INTEGER, LONG, DOUBLE, BOOLEAN, BYTEARRAY and LIST; any other enum constant (e.g. a newly added AerospikeDataType not yet wired into the writer) falls into the default branch and throws this IllegalArgumentException. It signals a mapping gap between the connector's type configuration and its value conversion logic.","triggerScenarios":"A field's AerospikeDataType (from the 'field_types' config or mapSeaTunnelType) resolves to an enum constant that convertValue()'s switch does not cover, and the row value for that field is non-null, so the default branch executes during write() -> convertValue().","commonSituations":"Configuring a field type string in field_types that parses to an AerospikeDataType the writer cannot convert; running a newer/patched AerospikeDataType enum against an older writer implementation; a custom build where a new data type was added to the enum without updating convertValue().","solutions":["Check the field's entry in the 'field_types' sink option and change it to a supported value: STRING, INTEGER, LONG, DOUBLE, BOOLEAN, BYTEARRAY or LIST.","Remove the offending field from field_types so its SeaTunnel type is auto-mapped via mapSeaTunnelType instead.","If a new AerospikeDataType constant is legitimately needed, extend convertValue() with a case for it (or fix the version mismatch between the enum and the writer)."],"exampleFix":"// before\nfield_types = {score = GEOSPATIAL}\n\n// after\nfield_types = {score = DOUBLE}","handlingStrategy":"validation","validationCode":"java.util.Set<String> supported = java.util.Set.of(\"STRING\",\"INTEGER\",\"LONG\",\"DOUBLE\",\"BOOLEAN\",\"BYTEARRAY\",\"LIST\");\nfor (java.util.Map.Entry<String,String> e : fieldTypes.entrySet()) {\n    if (!supported.contains(e.getValue().toUpperCase())) {\n        throw new IllegalArgumentException(\"field_types entry '\" + e.getKey() + \"' uses unsupported type \" + e.getValue());\n    }\n}","typeGuard":"boolean isSupportedType(AerospikeDataType t) {\n    return t == AerospikeDataType.STRING || t == AerospikeDataType.INTEGER || t == AerospikeDataType.LONG\n        || t == AerospikeDataType.DOUBLE || t == AerospikeDataType.BOOLEAN\n        || t == AerospikeDataType.BYTEARRAY || t == AerospikeDataType.LIST;\n}","tryCatchPattern":null,"preventionTips":["Only use documented values in field_types: STRING, INTEGER, LONG, DOUBLE, BOOLEAN, BYTEARRAY, LIST.","Validate field_types against the supported set at job-configuration time, before submission.","When upgrading the connector, re-check the AerospikeDataType enum for removed/renamed constants."],"tags":["java","aerospike","type-mapping","sink-writer"],"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"}