apache/seatunnel · error · IllegalStateException
columnDefine size not match
Error message
columnDefine size not match
What it means
DataConverter.convert(Column[], Function) applies the value producer and then requires that the produced Object[] length equals the number of Column definitions, converting each field with its column. A length mismatch means the row data and the schema are out of sync, so it fails fast with IllegalStateException.
Source
Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/table/converter/DataConverter.java:64
return convert(columnDefine.getDataType(), value);
}
default Object convert(T typeDefine, Column columnDefine, Object value) {
return convert(columnDefine, value);
}
default Object[] convert(T[] typeDefine, Column[] columnDefine, Object[] value) {
for (int i = 0; i < value.length; i++) {
value[i] =
convert(typeDefine != null ? typeDefine[i] : null, columnDefine[i], value[i]);
}
return value;
}
default Object[] convert(Column[] columnDefine, Function<Column[], Object[]> valueApply) {
Object[] fields = valueApply.apply(columnDefine);
if (fields.length != columnDefine.length) {
throw new IllegalStateException("columnDefine size not match");
}
for (int i = 0; i < fields.length; i++) {
fields[i] = convert(columnDefine[i], fields[i]);
}
return fields;
}
default Object[] convert(
T[] typeDefine, Column[] columnDefine, BiFunction<T[], Column[], Object[]> valueApply) {
boolean hasTypeDefine = typeDefine != null;
if (hasTypeDefine && typeDefine.length != columnDefine.length) {
throw new IllegalStateException("typeDefine size not match");
}
Object[] fields = valueApply.apply(typeDefine, columnDefine);
if (fields.length != columnDefine.length) {
throw new IllegalStateException("columnDefine size not match");View on GitHub (pinned to cf67b549a7)
Solutions
- Rebuild the Column[] schema from the same source that produced the values
- Ensure the value producer reads exactly the columns in columnDefine (same order and count)
- Check for schema drift between the connector's cached schema and the live source
Example fix
// before Object[] row = readAllColumns(rs); // 12 values vs 11 columns // after Object[] row = new Object[columnDefine.length]; for (int i = 0; i < columnDefine.length; i++) row[i] = rs.getObject(i + 1);
Defensive patterns
Strategy: validation
Validate before calling
Object[] fields = valueApply.apply(columnDefine);
if (fields.length != columnDefine.length) {
throw new IllegalArgumentException("row has " + fields.length + " fields but schema has " + columnDefine.length);
} Try / catch
try {
Object[] out = dataConverter.convert(columnDefine, valueApply);
} catch (IllegalStateException e) {
log.error("Schema/row mismatch detected: {}", e.getMessage());
throw e;
} Prevention
- Build schema and row extraction from the same metadata snapshot
- Re-read schema after any source DDL change
- Add row-length assertions in your reader
When it happens
Trigger: The Function<Column[], Object[]> passed to convert returns an array whose length differs from columnDefine.length.
Common situations: ResultSet column count changed after schema was built; SELECT list altered; schema derived from a stale/mismatched table definition.
Related errors
- typeDefine size not match
- reconvert not support
- Decimal precision %d exceeds configured precision %d
- CONFIG_VALIDATION_FAILED
- UNSUPPORTED_DATA_TYPE
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/71f0ce7ddd3ce0c4.
Report an issue: GitHub.