{"record":{"id":"9e5331bbfb4703bd","repo":"apache/seatunnel","slug":"unsupported-data-type-9e5331","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/relational/RelationalSeaTunnelRowSerializer.java","lineNumber":108,"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                            CommonErrorCode.UNSUPPORTED_DATA_TYPE,\n                            \"Unsupported data type: \" + timestampFieldType);\n            }\n        };\n    }\n\n    private Function<SeaTunnelRow, List<String>> createTagAttributeExtractor(\n            SeaTunnelRowType seaTunnelRowType, List<String> keys) {\n        List<Integer> indices = new ArrayList<>();\n        for (String key : keys) {\n            indices.add(seaTunnelRowType.indexOf(key));\n        }\n        return seaTunnelRow -> {\n            List<String> res = new ArrayList<>();\n            for (int index : indices) {\n                res.add(seaTunnelRow.getField(index).toString());\n            }\n            return res;","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-iotdb-v2/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdbv2/serialize/relational/RelationalSeaTunnelRowSerializer.java#L90-L126","documentation":"RelationalSeaTunnelRowSerializer.createTimestampExtractor() (used for IoTDB relational/table-mode writes) extracts the record timestamp as epoch millis and supports only TIMESTAMP (LocalDateTime) and BIGINT (Long) field types. Any other type for the configured timestamp field reaches the default branch and throws IotdbConnectorException with CommonErrorCode.UNSUPPORTED_DATA_TYPE. The relational serializer cannot convert other types to epoch millis.","triggerScenarios":"Writing to IoTDB in relational mode when the timestamp field's SeaTunnel type is neither TIMESTAMP nor BIGINT — e.g. STRING, INT, DATE. Thrown when the timestamp extractor lambda is created inside RelationalSeaTunnelRowSerializer (sink serialization setup).","commonSituations":"Configuring the timestamp field as a formatted STRING like '2024-01-01 00:00:00' instead of TIMESTAMP/BIGINT; source emits DATE or INT epoch seconds that the connector does not coerce; mismatch between source output schema and sink's timestamp_data_type option.","solutions":["Declare the timestamp field as TIMESTAMP (LocalDateTime) or BIGINT (epoch millis) in the sink schema/options","Pre-convert STRING/DATE/INT timestamps with a Transform (CAST/parse) before the IoTDB sink","Verify the timestamp_field/timestamp_data_type options match the upstream schema exactly","Upgrade the connector in case newer versions accept more timestamp input types"],"exampleFix":"// before\ntimestamp_field = \"event_time\"  // upstream STRING 'yyyy-MM-dd HH:mm:ss'\n// after: parse in a Transform, then\ntimestamp_field = \"event_time\"  // declared as TIMESTAMP (LocalDateTime)","handlingStrategy":"validation","validationCode":"SqlType s = timestampFieldType.getSqlType();\nif (s != SqlType.TIMESTAMP && s != SqlType.BIGINT) {\n    throw new IllegalArgumentException(\n        \"Relational IoTDB timestamp field must be TIMESTAMP or BIGINT, got: \" + s);\n}","typeGuard":"boolean validRelationalTimestamp(SeaTunnelFieldType t) {\n    return t.getSqlType() == SqlType.TIMESTAMP || t.getSqlType() == SqlType.BIGINT;\n}","tryCatchPattern":"try {\n    serializer = new RelationalSeaTunnelRowSerializer(...);\n} catch (IotdbConnectorException e) {\n    if (e.getSeaTunnelErrorCode() == CommonErrorCode.UNSUPPORTED_DATA_TYPE) {\n        // fix timestamp field type to TIMESTAMP or BIGINT\n    }\n    throw e;\n}","preventionTips":["Parse STRING timestamps into LocalDateTime before the sink","Never declare the timestamp field as INT/DATE/STRING in relational mode","Keep timestamp_data_type consistent across source, transform, and sink configs","Add a startup schema check that fails fast before writes begin"],"tags":["iotdb","serialization","unsupported-data-type","timestamp","relational"],"backgroundTag":"type-mismatch","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"}