{"record":{"id":"118cb5cf6828d2cc","repo":"prestodb/presto","slug":"checksum-mismatch-for-row-group-s-in-stripe-at-of","errorCode":null,"errorMessage":"Checksum mismatch for row group %s in stripe at offset %s","messagePattern":"Checksum mismatch for row group (.+?) in stripe at offset (.+?)","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java","lineNumber":320,"sourceCode":"                if (!expectedColumns.equals(actualColumns)) {\n                    throw new OrcCorruptionException(orcDataSourceId, \"Unexpected column in row group %s in stripe at offset %s\", rowGroupIndex, stripeOffset);\n                }\n\n                for (Entry<StreamId, List<RowGroupIndex>> entry : actualRowGroupStatistics.entrySet()) {\n                    int column = entry.getKey().getColumn();\n                    ColumnStatistics actual = actualStatistics.get(column);\n                    ColumnStatistics expected = expectedStatistics.get(column);\n                    validateColumnStatisticsEquivalent(orcDataSourceId, \"Row group \" + rowGroupIndex + \" in stripe at offset \" + stripeOffset, actual, expected);\n                }\n            }\n\n            if (expectedRowGroup.getValidationMode() != DETAILED) {\n                Map<Integer, ColumnStatistics> actualStatistics = aggregateRowGroupStatisticsFromRowIndex(orcDataSourceId, actualRowGroupStatistics, stripeOffset, rowGroupIndex);\n                actualStatistics = adjustRowGroupStatisticsForFlatMaps(orcDataSourceId, stripeOffset, actualStatistics);\n                RowGroupStatistics actualRowGroup = new RowGroupStatistics(BOTH, actualStatistics);\n                RowGroupStatistics adjustedExpectedRowGroup = new RowGroupStatistics(BOTH, adjustRowGroupStatisticsForFlatMaps(orcDataSourceId, stripeOffset, expectedRowGroup.getColumnStatistics()));\n                if (adjustedExpectedRowGroup.getHash() != actualRowGroup.getHash()) {\n                    throw new OrcCorruptionException(orcDataSourceId, \"Checksum mismatch for row group %s in stripe at offset %s\", rowGroupIndex, stripeOffset);\n                }\n            }\n        }\n    }\n\n    private Map<Integer, ColumnStatistics> adjustRowGroupStatisticsForFlatMaps(OrcDataSourceId orcDataSourceId, long stripeOffset, Map<Integer, ColumnStatistics> stats)\n    {\n        if (this.flattenedKeyToMapNodes.isEmpty()) {\n            return stats;\n        }\n\n        // The only reliable way to detect that a flat map doesn't have non-null & non-empty\n        // values is to check the stripe stats for the key node. If it has 0 number of values\n        // it means that this flat map writer didn't write anything.\n        StripeStatistics stripeStats = this.stripeStatistics.get(stripeOffset);\n        if (stripeStats == null) {\n            throw new OrcCorruptionException(orcDataSourceId, \"Could not find stripe statistics for a stripe at offset %s\", stripeOffset);\n        }","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java#L302-L338","documentation":"Write-validation error: the checksum recorded for a row group's statistics does not match the checksum computed when re-reading the file. The row group's statistics content changed between write and validation — a corruption or writer-consistency bug.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java:320 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the write job; if reproducible, report as an ORC writer bug","Verify storage media integrity","Ensure no concurrent writers modified the file"],"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"}