{"record":{"id":"68f9474fb1351c20","repo":"prestodb/presto","slug":"missing-row-group-column-statistics-for-stripe-at","errorCode":null,"errorMessage":"Missing row group column statistics for stripe at offset %s","messagePattern":"Missing row group column statistics for stripe at offset (.+?)","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java","lineNumber":279,"sourceCode":"    }\n\n    public void validateStripeStatistics(OrcDataSourceId orcDataSourceId, long stripeOffset, List<ColumnStatistics> actual)\n            throws OrcCorruptionException\n    {\n        StripeStatistics expected = stripeStatistics.get(stripeOffset);\n        if (expected == null) {\n            throw new OrcCorruptionException(orcDataSourceId, \"Unexpected stripe at offset %s\", stripeOffset);\n        }\n        validateColumnStatisticsEquivalent(orcDataSourceId, \"Stripe at \" + stripeOffset, actual, expected.getColumnStatistics());\n    }\n\n    public void validateRowGroupStatistics(OrcDataSourceId orcDataSourceId, long stripeOffset, Map<StreamId, List<RowGroupIndex>> actualRowGroupStatistics)\n            throws OrcCorruptionException\n    {\n        requireNonNull(actualRowGroupStatistics, \"actualRowGroupStatistics is null\");\n        List<RowGroupStatistics> expectedRowGroupStatistics = rowGroupStatistics.get(stripeOffset);\n        if (expectedRowGroupStatistics == null) {\n            throw new OrcCorruptionException(orcDataSourceId, \"Missing row group column statistics for stripe at offset %s\", stripeOffset);\n        }\n\n        int rowGroupCount = expectedRowGroupStatistics.size();\n        for (Entry<StreamId, List<RowGroupIndex>> entry : actualRowGroupStatistics.entrySet()) {\n            if (entry.getValue().size() != rowGroupCount) {\n                throw new OrcCorruptionException(orcDataSourceId, \"Unexpected row group count stripe in at offset %s\", stripeOffset);\n            }\n        }\n\n        for (int rowGroupIndex = 0; rowGroupIndex < expectedRowGroupStatistics.size(); rowGroupIndex++) {\n            RowGroupStatistics expectedRowGroup = expectedRowGroupStatistics.get(rowGroupIndex);\n            if (expectedRowGroup.getValidationMode() != HASHED) {\n                Map<Integer, ColumnStatistics> expectedStatistics = expectedRowGroup.getColumnStatistics();\n                Map<Integer, ColumnStatistics> actualStatistics = aggregateRowGroupStatisticsFromRowIndex(orcDataSourceId, actualRowGroupStatistics, stripeOffset, rowGroupIndex);\n\n                // remove empty row group stats for empty flat maps\n                expectedStatistics = adjustRowGroupStatisticsForFlatMaps(orcDataSourceId, stripeOffset, expectedStatistics);\n                actualStatistics = adjustRowGroupStatisticsForFlatMaps(orcDataSourceId, stripeOffset, actualStatistics);","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java#L261-L297","documentation":"Write-validation error: row group statistics were expected for a stripe at the given offset but none were recorded/found during validation. The writer expected per-row-group stats that the re-read file does not contain, flagging a stats-writing inconsistency (writer bug or corruption).","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java:279 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the write and confirm the error reproduces with validation enabled","Report with the full stack trace as an ORC writer issue","Verify reader/writer versions match for the validation pass"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}