{"record":{"id":"b643a37fbf779205","repo":"apache/seatunnel","slug":"unsupported-data-type-b643a3","errorCode":null,"errorMessage":"Unsupported data type: ","messagePattern":"Unsupported data type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-influxdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/influxdb/serialize/DefaultSerializer.java","lineNumber":144,"sourceCode":"            }\n            SeaTunnelDataType<?> timestampFieldType = seaTunnelRowType.getFieldType(timeFieldIndex);\n            switch (timestampFieldType.getSqlType()) {\n                case STRING:\n                    builder.time(Long.parseLong((String) time), precision);\n                    break;\n                case TIMESTAMP:\n                    builder.time(\n                            ((LocalDateTime) time)\n                                    .atZone(ZoneOffset.UTC)\n                                    .toInstant()\n                                    .toEpochMilli(),\n                            precision);\n                    break;\n                case BIGINT:\n                    builder.time((Long) time, precision);\n                    break;\n                default:\n                    throw new UnsupportedOperationException(\n                            \"Unsupported data type: \" + timestampFieldType);\n            }\n        };\n    }\n\n    private BiConsumer<SeaTunnelRow, Point.Builder> createTagExtractor(\n            SeaTunnelRowType seaTunnelRowType, List<String> tagKeys) {\n        // not config tagKeys\n        if (CollectionUtils.isEmpty(tagKeys)) {\n            return (row, builder) -> {};\n        }\n\n        return (row, builder) -> {\n            for (String tagKey : tagKeys) {\n                int indexOfSeaTunnelRow = seaTunnelRowType.indexOf(tagKey);\n                builder.tag(tagKey, row.getField(indexOfSeaTunnelRow).toString());\n            }\n        };","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-influxdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/influxdb/serialize/DefaultSerializer.java#L126-L162","documentation":"DefaultSerializer.createTimestampExtractor determines the InfluxDB point timestamp for each row. Its switch supports only timestamp-typed and BIGINT fields; any other type for the configured timestamp field hits the default branch and throws UnsupportedOperationException 'Unsupported data type: ' + timestampFieldType. Note this is a plain UnsupportedOperationException, not an InfluxdbConnectorException.","triggerScenarios":"Configuring the InfluxDB sink's timestamp field to a column whose SeaTunnelDataType is neither TIMESTAMP nor BIGINT — e.g. a STRING datetime, DATE, or an INT where BIGINT was expected — and writing a row.","commonSituations":"Users point the timestamp config at a string-formatted datetime column; schema changed from BIGINT to another type after a refactor; upstream connector emits DATE where a BIGINT epoch was expected.","solutions":["Declare the timestamp field as BIGINT (epoch) or TIMESTAMP in the sink schema","Cast the source column, e.g. SQL transform 'SELECT CAST(ts AS BIGINT) AS ts FROM src' or convert string datetime to epoch before the sink","Check the sink's timestamp config key points to the intended column","If STRING-epoch support is needed, add a case parsing the value to millis in createTimestampExtractor"],"exampleFix":"// before\nschema = { fields = { ts = \"string\" } } // ts used as timestamp\n// after\nschema = { fields = { ts = \"bigint\" } } // epoch millis","handlingStrategy":"validation","validationCode":"SeaTunnelDataType<?> tsType = schema.getField(timestampField);\nif (!(tsType.equals(LocalTimeType.LOCAL_DATE_TIME_TYPE) || tsType.equals(BasicType.LONG_TYPE))) {\n    throw new IllegalArgumentException(\"Timestamp field must be TIMESTAMP or BIGINT, got: \" + tsType);\n}","typeGuard":"boolean isValidTimestampField(SeaTunnelDataType<?> t) {\n    return t.equals(LocalTimeType.LOCAL_DATE_TIME_TYPE) || t.equals(BasicType.LONG_TYPE);\n}","tryCatchPattern":"try {\n    serializer.serialize(row);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().startsWith(\"Unsupported data type\")) {\n        log.error(\"Timestamp field wrong type: {}\", e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Point the timestamp config at a BIGINT epoch or TIMESTAMP column only","Cast string datetimes to epoch BIGINT upstream","Check timestamp field mapping after schema refactors","Note this throws UnsupportedOperationException, so catch RuntimeException-compatible types too"],"tags":["influxdb","timestamp","serialization","sink"],"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"}