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
- 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
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
- 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
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
- COMMON-17
- COMMON-19
- COMMON-19
- Invalid DECIMAL definition: " + decimalTypeDefinition
- The decimal column type decimal( , ) is out of range, which…
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)