apache/seatunnel · error · IllegalArgumentException

Column type is empty.

Error message

Column type is empty.

What it means

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.

Solutions

  1. Ensure every BasicTypeDefine passed to the converter has a non-empty columnType set
  2. Re-read table schema from the StarRocks catalog to get correct type metadata
  3. Check for upstream bugs/blank metadata in schema sync or DESCRIBE output for the table
  4. Guard the conversion call site: skip or default the column when columnType is blank

Example fix

// before
BasicTypeDefine<StarRocksType> td = BasicTypeDefine.builder().name("c1").build();
converter.convert(td); // throws
// after
BasicTypeDefine<StarRocksType> td = BasicTypeDefine.builder().name("c1").columnType("INT").dataType(INT).build();
Defensive patterns

Strategy: validation

Validate before calling

if (typeDefine.getColumnType() == null || typeDefine.getColumnType().isBlank()) { throw new IllegalArgumentException("columnType must be set before conversion: " + typeDefine.getName()); }

Type guard

boolean hasColumnType(BasicTypeDefine<?> td) { return td.getColumnType() != null && !td.getColumnType().isBlank(); }

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/36724139bb9d1aee. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/datatypes/StarRocksTypeConverter.java:468

    private SeaTunnelDataType turnColumnTypeToSeaTunnelType(String columnType, String columnName) {
        BasicTypeDefine<StarRocksType> keyBasicTypeDefine =
                BasicTypeDefine.<StarRocksType>builder()
                        .columnType(columnType)
                        .name(columnName)
                        .build();
        if (columnType.toUpperCase(Locale.ROOT).startsWith(SR_ARRAY_DECIMAL_PRE)) {
            int[] precisionAndScale = getPrecisionAndScale(columnType);
            keyBasicTypeDefine.setPrecision((long) precisionAndScale[0]);
            keyBasicTypeDefine.setScale(precisionAndScale[1]);
        }
        Column column = convert(keyBasicTypeDefine);
        return column.getDataType();
    }

    private String getOriginalType(BasicTypeDefine<StarRocksType> typeDefine) {
        String columnType = typeDefine.getColumnType().toUpperCase(Locale.ROOT);
        if (StringUtils.isBlank(columnType)) {
            throw new IllegalArgumentException("Column type is empty.");
        }

        if (columnType.contains("<") && columnType.contains(">")) {
            return columnType.substring(0, columnType.indexOf("<"));
        }

        if (columnType.contains("(") && columnType.contains(")")) {
            return columnType.substring(0, columnType.indexOf("("));
        }

        return columnType;
    }

    private static int[] getPrecisionAndScale(String decimalTypeDefinition) {
        // Remove the "DECIMALV3" part and the parentheses
        decimalTypeDefinition = decimalTypeDefinition.toUpperCase(Locale.ROOT);
        String numericPart = decimalTypeDefinition.replace("DECIMALV3(", "").replace(")", "");
        numericPart = numericPart.replace("DECIMAL(", "").replace(")", "");

View on GitHub (pinned to cf67b549a7)