apache/flink · error · RuntimeException
Row length mismatch. %s fields expected but was %s.
Error message
Row length mismatch. %s fields expected but was %s.
What it means
Error "Row length mismatch. %s fields expected but was %s." thrown in apache/flink.
Source
Thrown at flink-formats/flink-csv/src/main/java/org/apache/flink/formats/csv/CsvToRowDataConverters.java:315
private CsvToRowDataConverter createArrayConverter(ArrayType arrayType) {
final CsvToRowDataConverter elementConverter =
createNullableConverter(arrayType.getElementType());
final Class<?> elementClass =
LogicalTypeUtils.toInternalConversionClass(arrayType.getElementType());
return jsonNode -> {
final ArrayNode node = (ArrayNode) jsonNode;
final Object[] array = (Object[]) Array.newInstance(elementClass, node.size());
for (int i = 0; i < node.size(); i++) {
final JsonNode innerNode = node.get(i);
array[i] = elementConverter.convert(innerNode);
}
return new GenericArrayData(array);
};
}
private static void validateArity(int expected, int actual, boolean ignoreParseErrors) {
if (expected > actual && !ignoreParseErrors) {
throw new RuntimeException(
"Row length mismatch. "
+ expected
+ " fields expected but was "
+ actual
+ ".");
}
}
/** Exception which refers to parse errors in converters. */
private static final class CsvParseException extends RuntimeException {
private static final long serialVersionUID = 1L;
public CsvParseException(String message, Throwable cause) {
super(message, cause);
}
}
}
View on GitHub (pinned to 2f3c205e92)
Solutions
- Address the cause reported by the error message: Row length mismatch. the reported value fields expected but was the reported value.
- Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry.
Example fix
Correct the condition described ("Row length mismatch. the reported value fields expected but was the reported value.") and rerun the job or command. When it happens
Trigger: Triggered at runtime when the operation fails because: Row length mismatch. the reported value fields expected but was the reported value.
Common situations: Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: Row length mismatch. the reported value fields expected but was the reported value.
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/2e4aa9c0ab37edaf.
Report an issue: GitHub.