{"record":{"id":"2aad17df8141314f","repo":"apache/flink","slug":"totalvaluecount-0","errorCode":null,"errorMessage":"totalValueCount == 0","messagePattern":"totalValueCount == 0","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/vector/reader/AbstractColumnReader.java","lineNumber":128,"sourceCode":"        DictionaryPage dictionaryPage = pageReader.readDictionaryPage();\n        if (dictionaryPage != null) {\n            try {\n                this.dictionary =\n                        dictionaryPage.getEncoding().initDictionary(descriptor, dictionaryPage);\n                this.isCurrentPageDictionaryEncoded = true;\n            } catch (IOException e) {\n                throw new IOException(\"could not decode the dictionary for \" + descriptor, e);\n            }\n        } else {\n            this.dictionary = null;\n            this.isCurrentPageDictionaryEncoded = false;\n        }\n        /*\n         * Total number of values in this column (in this row group).\n         */\n        long totalValueCount = pageReader.getTotalValueCount();\n        if (totalValueCount == 0) {\n            throw new IOException(\"totalValueCount == 0\");\n        }\n    }\n\n    protected void checkTypeName(PrimitiveType.PrimitiveTypeName expectedName) {\n        PrimitiveType.PrimitiveTypeName actualName =\n                descriptor.getPrimitiveType().getPrimitiveTypeName();\n        checkArgument(\n                actualName == expectedName,\n                \"Expected type name: %s, actual type name: %s\",\n                expectedName,\n                actualName);\n    }\n\n    /** Reads `total` values from this columnReader into column. */\n    @Override\n    public final void readToVector(int readNumber, VECTOR vector) throws IOException {\n        int rowId = 0;\n        WritableIntVector dictionaryIds = null;","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/vector/reader/AbstractColumnReader.java#L110-L146","documentation":"IOException from the AbstractColumnReader constructor: pageReader.getTotalValueCount() returned 0 for the column chunk in the current row group. A column reader is only constructed when values are expected (the row group has rows), so a zero value count means empty/miscomputed chunk statistics - usually corrupt or pathological metadata rather than a legitimate all-null column (all-null columns still have definition-level values counted).","triggerScenarios":"Creating a column reader over a row group whose column chunk reports totalValueCount == 0 in the page-reader store.","commonSituations":"Files with corrupt row-group/column-chunk metadata; writers that emit zero-value chunks for columns never present in that row group; truncated files.","solutions":["Inspect the file metadata (parquet-tools meta) for the offending row group and regenerate the file","Drop the affected column from the projection to skip the broken chunk","If produced by a third-party writer, report/upgrade that writer; if by Flink itself, upgrade Flink"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"ParquetFileReader r = ParquetFileReader.open(conf, path);\nfor (BlockMetaData b : r.getRowGroups()) {\n    for (ColumnChunkMetaData c : b.getColumns()) {\n        if (c.getValueCount() < 0) throw new IllegalStateException(\"Bad value count in chunk metadata\");\n    }\n}","typeGuard":null,"tryCatchPattern":"catch (IOException e) { if (\"totalValueCount == 0\".equals(e.getMessage())) { /* skip/quarantine bad split and regenerate the file */ } else throw e; }","preventionTips":["Regenerate files whose metadata is inconsistent rather than special-casing readers","Monitor writer jobs for interrupted checkpoint/commit states"],"tags":["parquet","corruption","metadata","io","flink"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}