{"record":{"id":"2e4aa9c0ab37edaf","repo":"apache/flink","slug":"row-length-mismatch-s-fields-expected-but-was-s","errorCode":null,"errorMessage":"Row length mismatch. %s fields expected but was %s.","messagePattern":"Row length mismatch\\. (.+?) fields expected but was (.+?)\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-csv/src/main/java/org/apache/flink/formats/csv/CsvToRowDataConverters.java","lineNumber":315,"sourceCode":"    private CsvToRowDataConverter createArrayConverter(ArrayType arrayType) {\n        final CsvToRowDataConverter elementConverter =\n                createNullableConverter(arrayType.getElementType());\n        final Class<?> elementClass =\n                LogicalTypeUtils.toInternalConversionClass(arrayType.getElementType());\n        return jsonNode -> {\n            final ArrayNode node = (ArrayNode) jsonNode;\n            final Object[] array = (Object[]) Array.newInstance(elementClass, node.size());\n            for (int i = 0; i < node.size(); i++) {\n                final JsonNode innerNode = node.get(i);\n                array[i] = elementConverter.convert(innerNode);\n            }\n            return new GenericArrayData(array);\n        };\n    }\n\n    private static void validateArity(int expected, int actual, boolean ignoreParseErrors) {\n        if (expected > actual && !ignoreParseErrors) {\n            throw new RuntimeException(\n                    \"Row length mismatch. \"\n                            + expected\n                            + \" fields expected but was \"\n                            + actual\n                            + \".\");\n        }\n    }\n\n    /** Exception which refers to parse errors in converters. */\n    private static final class CsvParseException extends RuntimeException {\n        private static final long serialVersionUID = 1L;\n\n        public CsvParseException(String message, Throwable cause) {\n            super(message, cause);\n        }\n    }\n}\n","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-csv/src/main/java/org/apache/flink/formats/csv/CsvToRowDataConverters.java#L297-L333","documentation":"Error \"Row length mismatch. %s fields expected but was %s.\" thrown in apache/flink.","triggerScenarios":"Triggered at runtime when the operation fails because: Row length mismatch. the reported value fields expected but was the reported value.","commonSituations":"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.","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."],"exampleFix":"Correct the condition described (\"Row length mismatch. the reported value fields expected but was the reported value.\") and rerun the job or command.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}