{"record":{"id":"964c3fb689a239e5","repo":"apache/seatunnel","slug":"common-unsupported-data-type-964c3f","errorCode":"COMMON_UNSUPPORTED_DATA_TYPE","errorMessage":"The data type of the fake data is not supported","messagePattern":"The data type of the fake data is not supported","errorType":"error_code","errorClass":"FakeConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-fake/src/main/java/org/apache/seatunnel/connectors/seatunnel/fake/source/FakeDataGenerator.java","lineNumber":202,"sourceCode":"            int arity = fieldTypes.length;\n\n            for (int i = 0; i < arity; i++) {\n                SeaTunnelDataType<?> fieldType = fieldTypes[i];\n                JsonNode field = jsonNode.isArray() ? jsonNode.get(i) : jsonNode.get(fieldNames[i]);\n\n                if (field == null) {\n                    continue;\n                }\n\n                String newValue = getNewValueForField(fieldType.getSqlType(), field.asText());\n                if (newValue != null) {\n                    jsonNode = replaceFieldValue(jsonNode, i, fieldNames[i], newValue);\n                }\n            }\n\n            rowData.setFieldsJson(jsonNode.toString());\n        } catch (JsonProcessingException e) {\n            throw new FakeConnectorException(\n                    CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,\n                    \"The data type of the fake data is not supported\",\n                    e);\n        }\n    }\n\n    private String getNewValueForField(SqlType sqlType, String fieldValue) {\n        switch (sqlType) {\n            case TIME:\n                return fieldValue.equals(CURRENT_TIME) ? LocalTime.now().toString() : null;\n            case DATE:\n                return fieldValue.equalsIgnoreCase(CURRENT_DATE)\n                        ? LocalDate.now().toString()\n                        : null;\n            case TIMESTAMP:\n                return fieldValue.equalsIgnoreCase(CURRENT_TIMESTAMP)\n                        ? LocalDateTime.now().toString()\n                        : null;","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-fake/src/main/java/org/apache/seatunnel/connectors/seatunnel/fake/source/FakeDataGenerator.java#L184-L220","documentation":"FakeDataGenerator.customField wraps Jackson JSON processing in a try/catch and, when a JsonProcessingException occurs while building/patching the fake row's JSON node, rethrows it as a FakeConnectorException with CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE and the message 'The data type of the fake data is not supported'. It signals that the configured fake data could not be serialized into the row schema.","triggerScenarios":"generateCustomRows calls customField and the Jackson ObjectMapper fails while writing or mutating the JSON node for a configured field (e.g. a configured fake value cannot be represented in the target schema field); called for each row during FakeSource reads.","commonSituations":"Schema type and configured fake data mismatch (e.g. a string value for an int column in a custom JSON template), malformed template JSON in 'fake.data' for custom row generation, or unsupported SeaTunnel DataTypes lacking a mapping in the generator.","solutions":["Check the SeaTunnel schema column type for the failing field and align the configured fake data type with it","If using custom data (FakeDataType.CUSTOM), validate that each template value is valid JSON of the right type","Inspect the wrapped JsonProcessingException cause in the logs for the exact field/value that failed serialization"],"exampleFix":"// before: schema column \"age\" is INT but fake data supplies a string\nFakeData { data = [{ age = \"twenty\" }] }\n// after: match the configured value to the column type\nFakeData { data = [{ age = 20 }] }","handlingStrategy":"validation","validationCode":"// validate custom fake data against schema before running\nfor (JsonNode row : customData) {\n    if (!row.isObject()) throw new IllegalArgumentException(\"fake data rows must be JSON objects\");\n    for (String f : schemaFields) {\n        if (row.has(f) && !typeMatches(schemaType(f), row.get(f))) {\n            throw new IllegalArgumentException(\"field \" + f + \" type mismatch\");\n        }\n    }\n}","typeGuard":"boolean typeMatches(SeaTunnelDataType<?> t, JsonNode v) {\n    switch (t.getSqlType()) {\n        case INT: case BIGINT: return v.canConvertToLong();\n        case DOUBLE: case FLOAT: return v.isNumber();\n        case STRING: return v.isTextual();\n        case BOOLEAN: return v.isBoolean();\n        default: return true;\n    }\n}","tryCatchPattern":"try {\n    rowData = fakeDataGenerator.generateCustomRows(...);\n} catch (FakeConnectorException e) {\n    if (CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE.equals(e.getSeaTunnelErrorCode())) {\n        // inspect e.getCause() (JsonProcessingException), fix the field type, restart the job\n    }\n}","preventionTips":["Match every configured fake value's JSON type to the schema column type","Validate custom template JSON with a parser before submitting the job","Read the wrapped JsonProcessingException cause to pinpoint the failing field","Prefer typed FakeData modes (INT/STRING/...) over CUSTOM when schema is fixed"],"tags":["fake-connector","jackson","unsupported-datatype","serialization"],"backgroundTag":"unsupported-dtype","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"}