{"record":{"id":"44fb7de213fbea4b","repo":"apache/seatunnel","slug":"unsupported-operation-44fb7d","errorCode":null,"errorMessage":"Unsupported operation","messagePattern":"Unsupported operation","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/catalog/ClickhouseTypeConverter.java","lineNumber":50,"sourceCode":"import com.google.auto.service.AutoService;\nimport lombok.extern.slf4j.Slf4j;\n\n@Slf4j\n@AutoService(TypeConverter.class)\npublic class ClickhouseTypeConverter\n        implements BasicTypeConverter<BasicTypeDefine<ClickhouseType>> {\n    public static final ClickhouseTypeConverter INSTANCE = new ClickhouseTypeConverter();\n    public static final Integer MAX_DATETIME_SCALE = 9;\n    public static final String IDENTIFIER = \"Clickhouse\";\n\n    @Override\n    public String identifier() {\n        return IDENTIFIER;\n    }\n\n    @Override\n    public Column convert(BasicTypeDefine<ClickhouseType> typeDefine) {\n        throw new UnsupportedOperationException(\"Unsupported operation\");\n    }\n\n    @Override\n    public BasicTypeDefine<ClickhouseType> reconvert(Column column) {\n        BasicTypeDefine.BasicTypeDefineBuilder builder =\n                BasicTypeDefine.builder()\n                        .name(column.getName())\n                        .nullable(column.isNullable())\n                        .comment(column.getComment())\n                        .defaultValue(column.getDefaultValue());\n\n        switch (column.getDataType().getSqlType()) {\n            case BOOLEAN:\n                builder.columnType(ClickhouseType.BOOLEAN);\n                builder.dataType(ClickhouseType.BOOLEAN);\n                break;\n            case TINYINT:\n                builder.columnType(ClickhouseType.TINYINT);","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/catalog/ClickhouseTypeConverter.java#L32-L68","documentation":"ClickhouseTypeConverter.convert is the forward conversion from a ClickHouse type definition to a SeaTunnel Column. For this converter only the reverse direction (reconvert) is implemented; calling convert throws UnsupportedOperationException('Unsupported operation'). It indicates the converter is only usable in the reverse (Column -> ClickHouse type) direction.","triggerScenarios":"Any call to ClickhouseTypeConverter.INSTANCE.convert(BasicTypeDefine<ClickhouseType>) — e.g. code treating this converter as a bidirectional converter and trying to map an existing ClickHouse schema into SeaTunnel columns.","commonSituations":"Generic converter framework code that always calls convert(); developers expecting schema-migration read support from ClickHouse types; test code exercising both directions of the converter.","solutions":["Do not use ClickhouseTypeConverter to convert ClickHouse types to SeaTunnel Columns; use reconvert(Column) for the supported direction.","If you need ClickHouse -> SeaTunnel type mapping, use the ClickhouseTypeMapper / catalog schema conversion path instead of this converter.","Implement convert() in the connector if bidirectional conversion is required for your use case.","Guard calls by checking whether conversion direction is supported before invoking."],"exampleFix":"// before\nColumn column = ClickhouseTypeConverter.INSTANCE.convert(typeDefine); // throws\n// after\nBasicTypeDefine<ClickhouseType> chType = ClickhouseTypeConverter.INSTANCE.reconvert(column); // supported direction","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean supportsForwardConversion(TypeConverter<?, ?> c) { return !(c instanceof ClickhouseTypeConverter); }","tryCatchPattern":"try { column = converter.convert(typeDefine); } catch (UnsupportedOperationException e) { throw new IllegalStateException(\"Forward conversion not supported by \" + converter.identifier() + \"; use reconvert()\", e); }","preventionTips":["Check a converter's javadoc/source for direction support before calling convert().","Use the ClickHouse catalog/mapper path for ClickHouse-type to Column conversion.","Add unit tests covering both conversion directions so stub methods surface early."],"tags":["clickhouse","type-converter","unsupported-method"],"backgroundTag":"method-not-implemented","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"}