{"record":{"id":"36724139bb9d1aee","repo":"apache/seatunnel","slug":"column-type-is-empty","errorCode":null,"errorMessage":"Column type is empty.","messagePattern":"Column type is empty\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/datatypes/StarRocksTypeConverter.java","lineNumber":468,"sourceCode":"    private SeaTunnelDataType turnColumnTypeToSeaTunnelType(String columnType, String columnName) {\n        BasicTypeDefine<StarRocksType> keyBasicTypeDefine =\n                BasicTypeDefine.<StarRocksType>builder()\n                        .columnType(columnType)\n                        .name(columnName)\n                        .build();\n        if (columnType.toUpperCase(Locale.ROOT).startsWith(SR_ARRAY_DECIMAL_PRE)) {\n            int[] precisionAndScale = getPrecisionAndScale(columnType);\n            keyBasicTypeDefine.setPrecision((long) precisionAndScale[0]);\n            keyBasicTypeDefine.setScale(precisionAndScale[1]);\n        }\n        Column column = convert(keyBasicTypeDefine);\n        return column.getDataType();\n    }\n\n    private String getOriginalType(BasicTypeDefine<StarRocksType> typeDefine) {\n        String columnType = typeDefine.getColumnType().toUpperCase(Locale.ROOT);\n        if (StringUtils.isBlank(columnType)) {\n            throw new IllegalArgumentException(\"Column type is empty.\");\n        }\n\n        if (columnType.contains(\"<\") && columnType.contains(\">\")) {\n            return columnType.substring(0, columnType.indexOf(\"<\"));\n        }\n\n        if (columnType.contains(\"(\") && columnType.contains(\")\")) {\n            return columnType.substring(0, columnType.indexOf(\"(\"));\n        }\n\n        return columnType;\n    }\n\n    private static int[] getPrecisionAndScale(String decimalTypeDefinition) {\n        // Remove the \"DECIMALV3\" part and the parentheses\n        decimalTypeDefinition = decimalTypeDefinition.toUpperCase(Locale.ROOT);\n        String numericPart = decimalTypeDefinition.replace(\"DECIMALV3(\", \"\").replace(\")\", \"\");\n        numericPart = numericPart.replace(\"DECIMAL(\", \"\").replace(\")\", \"\");","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/datatypes/StarRocksTypeConverter.java#L450-L486","documentation":"StarRocksTypeConverter.getOriginalType inspects the raw column type string (e.g. DECIMAL<10,2>, ARRAY<INT>) when mapping a StarRocks column back to a SeaTunnel type. If the columnType in the BasicTypeDefine is blank, an IllegalArgumentException('Column type is empty.') is thrown because the converter cannot classify the column.","triggerScenarios":"Calling StarRocksTypeConverter.convert(BasicTypeDefine<StarRocksType>) (or .type()) with a typeDefine whose columnType is null/empty — typically when a type descriptor was built without setting columnType or the catalog returned no type metadata for the column.","commonSituations":"Programmatically constructing a BasicTypeDefine and forgetting to set columnType; schema metadata read from StarRocks being incomplete/blank for exotic or system columns; version mismatch where metadata deserialization lost the column type.","solutions":["Ensure every BasicTypeDefine passed to the converter has a non-empty columnType set","Re-read table schema from the StarRocks catalog to get correct type metadata","Check for upstream bugs/blank metadata in schema sync or DESCRIBE output for the table","Guard the conversion call site: skip or default the column when columnType is blank"],"exampleFix":"// before\nBasicTypeDefine<StarRocksType> td = BasicTypeDefine.builder().name(\"c1\").build();\nconverter.convert(td); // throws\n// after\nBasicTypeDefine<StarRocksType> td = BasicTypeDefine.builder().name(\"c1\").columnType(\"INT\").dataType(INT).build();","handlingStrategy":"validation","validationCode":"if (typeDefine.getColumnType() == null || typeDefine.getColumnType().isBlank()) { throw new IllegalArgumentException(\"columnType must be set before conversion: \" + typeDefine.getName()); }","typeGuard":"boolean hasColumnType(BasicTypeDefine<?> td) { return td.getColumnType() != null && !td.getColumnType().isBlank(); }","tryCatchPattern":"try { SeaTunnelDataType<?> t = converter.convert(td); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"Column type is empty\")) { /* fall back to default mapping or skip column */ } throw e; }","preventionTips":["Always set columnType when building BasicTypeDefine instances","Re-read schema from the catalog if metadata looks incomplete","Add unit tests covering every column type in the target table"],"tags":["starrocks","type-converter","schema"],"backgroundTag":"empty-required-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}