{"record":{"id":"02132ee8b0296b1b","repo":"apache/seatunnel","slug":"unsupported-data-type-02132e","errorCode":"UNSUPPORTED_DATA_TYPE","errorMessage":"Unsupported data type: ","messagePattern":"Unsupported data type: ","errorType":"error_code","errorClass":"IotdbConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-iotdb-v2/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdbv2/serialize/DefaultSeaTunnelRowSerializer.java","lineNumber":95,"sourceCode":"        return row -> {\n            Object timestamp = row.getField(timestampFieldIndex);\n            if (timestamp == null) {\n                return System.currentTimeMillis();\n            }\n            SeaTunnelDataType<?> timestampFieldType =\n                    seaTunnelRowType.getFieldType(timestampFieldIndex);\n            switch (timestampFieldType.getSqlType()) {\n                case STRING:\n                    return Long.parseLong((String) timestamp);\n                case TIMESTAMP:\n                    return ((LocalDateTime) timestamp)\n                            .atZone(ZoneOffset.UTC)\n                            .toInstant()\n                            .toEpochMilli();\n                case BIGINT:\n                    return (Long) timestamp;\n                default:\n                    throw new IotdbConnectorException(\n                            CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,\n                            \"Unsupported data type: \" + timestampFieldType);\n            }\n        };\n    }\n\n    private Function<SeaTunnelRow, String> createDeviceExtractor(\n            SeaTunnelRowType seaTunnelRowType, String deviceKey, String storageGroup) {\n        int deviceIndex = seaTunnelRowType.indexOf(deviceKey);\n        return seaTunnelRow -> {\n            String device = seaTunnelRow.getField(deviceIndex).toString();\n            if (Strings.isNullOrEmpty(storageGroup)) {\n                return device;\n            }\n            if (storageGroup.endsWith(\".\") || device.startsWith(\".\")) {\n                return storageGroup + device;\n            }\n            return storageGroup + \".\" + device;","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-iotdb-v2/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdbv2/serialize/DefaultSeaTunnelRowSerializer.java#L77-L113","documentation":"DefaultSeaTunnelRowSerializer.createTimestampExtractor() extracts the record timestamp as epoch millis for IoTDB writes and supports only TIMESTAMP (LocalDateTime) and BIGINT (Long) SeaTunnel types. If the configured timestamp field's SeaTunnel type is anything else, the lambda's default branch throws IotdbConnectorException with CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE. The connector cannot derive epoch-milli time from the declared type.","triggerScenarios":"Writing to IoTDB (non-relational serializer) when the configured timestamp field type is neither TIMESTAMP nor BIGINT — e.g. INT, STRING, DATE. Triggered at serializer construction (called from DefaultSeaTunnelRowSerializer), typically during sink open/prepare when the timestamp extractor is created.","commonSituations":"Configuring timestamp field with timestamp_data_type=STRING or INT while the data actually holds epoch millis; schema mismatch between the upstream source and the IoTDB sink's declared timestamp type; copy-pasted config from a version where different types were accepted.","solutions":["Set the timestamp field's SeaTunnel type to TIMESTAMP (LocalDateTime) or BIGINT (Long) in the sink schema/options","If upstream provides a STRING or INT time, convert it in a Transform before the IoTDB sink (e.g. CAST to BIGINT/TIMESTAMP)","Verify the timestamp_data_type option value matches the actual upstream field type","Upgrade the connector to check whether additional timestamp types are supported"],"exampleFix":"// before\ntimestamp_field = \"ts\"\ntimestamp_data_type = \"string\"\n// after\ntimestamp_field = \"ts\"\ntimestamp_data_type = \"bigint\" // or \"timestamp\"","handlingStrategy":"validation","validationCode":"SqlType s = timestampFieldType.getSqlType();\nif (s != SqlType.TIMESTAMP && s != SqlType.BIGINT) {\n    throw new IllegalArgumentException(\n        \"IoTDB sink timestamp field must be TIMESTAMP or BIGINT, got: \" + s);\n}","typeGuard":"boolean validTimestampField(SeaTunnelFieldType t) {\n    return t.getSqlType() == SqlType.TIMESTAMP || t.getSqlType() == SqlType.BIGINT;\n}","tryCatchPattern":"try {\n    serializer = new DefaultSeaTunnelRowSerializer(...);\n} catch (IotdbConnectorException e) {\n    if (String.valueOf(e).contains(\"Unsupported data type\")) {\n        // fix timestamp_data_type to bigint or timestamp\n    }\n    throw e;\n}","preventionTips":["Set timestamp_data_type to only \"bigint\" or \"timestamp\" in sink config","Convert STRING/INT time columns to BIGINT/TIMESTAMP in an upstream Transform","Keep source and sink schema definitions in one shared config to avoid drift","Test serializer construction with the exact production schema before deploying"],"tags":["iotdb","serialization","unsupported-data-type","timestamp"],"backgroundTag":"type-mismatch","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"}