{"record":{"id":"cbba5ac801892e9a","repo":"prestodb/presto","slug":"unexpected-stripe-at-offset-s","errorCode":null,"errorMessage":"Unexpected stripe at offset %s","messagePattern":"Unexpected stripe at offset (.+?)","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java","lineNumber":268,"sourceCode":"        }\n\n        if (actualStripeStatistics.size() != stripeStatistics.size()) {\n            throw new OrcCorruptionException(orcDataSourceId, \"Write validation failed: unexpected number of columns in stripe statistics\");\n        }\n\n        for (int stripeIndex = 0; stripeIndex < actualStripes.size(); stripeIndex++) {\n            long stripeOffset = actualStripes.get(stripeIndex).getOffset();\n            StripeStatistics actual = actualStripeStatistics.get(stripeIndex);\n            validateStripeStatistics(orcDataSourceId, stripeOffset, actual.getColumnStatistics());\n        }\n    }\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            }","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java#L250-L286","documentation":"Write-validation error: a stripe exists in the file at an offset for which the writer recorded no statistics entry. The expected-statistics map has no entry at that stripeOffset, meaning the on-disk stripe layout diverges from what the writer tracked — corruption or writer bug.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/OrcWriteValidation.java:268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rewrite the data set and re-validate","Capture the writer validation report and report as a Presto ORC bug","Check the filesystem/hardware for silent corruption"],"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"}