{"record":{"id":"c22f6bb2b4a8190e","repo":"prestodb/presto","slug":"checkpoints-are-corrupt","errorCode":null,"errorMessage":"Checkpoints are corrupt","messagePattern":"Checkpoints are corrupt","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/StripeReader.java","lineNumber":246,"sourceCode":"\n            // build the row groups\n            try {\n                List<RowGroup> rowGroups = createRowGroups(\n                        stripe.getNumberOfRows(),\n                        includedStreams,\n                        valueStreams,\n                        columnIndexes,\n                        selectedRowGroups,\n                        columnEncodings);\n\n                return new Stripe(stripe.getNumberOfRows(), columnEncodings, rowGroups, dictionaryStreamSources, timezone);\n            }\n            catch (InvalidCheckpointException e) {\n                // The ORC file contains a corrupt checkpoint stream\n                // If the file does not have a row group dictionary, treat the stripe as a single row group. Otherwise,\n                // we must fail because the length of the row group dictionary is contained in the checkpoint stream.\n                if (hasRowGroupDictionary) {\n                    throw new OrcCorruptionException(e, orcDataSource.getId(), \"Checkpoints are corrupt\");\n                }\n                invalidCheckPoint = true;\n            }\n        }\n\n        // stripe only has one row group and no dictionary\n        ImmutableMap.Builder<StreamId, DiskRange> diskRangesBuilder = ImmutableMap.builder();\n        for (Entry<StreamId, DiskRange> entry : getDiskRanges(allStreams).entrySet()) {\n            StreamId streamId = entry.getKey();\n            if (includedStreams.containsKey(streamId)) {\n                diskRangesBuilder.put(entry);\n            }\n        }\n        ImmutableMap<StreamId, DiskRange> diskRanges = diskRangesBuilder.build();\n\n        // read the file regions\n        Map<StreamId, OrcInputStream> streamsData = readDiskRanges(stripeId, diskRanges, systemMemoryUsage, decryptors, sharedDecompressionBuffer);\n","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/StripeReader.java#L228-L264","documentation":"ORC stripe-reading error in StripeReader.readStripe: building row groups from the stripe's checkpoint/index data threw InvalidCheckpointException — the row-index checkpoints are inconsistent with the actual stream positions. Wrapped as 'Checkpoints are corrupt', indicating a corrupted or writer-buggy stripe index.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/StripeReader.java:246 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Skip or rewrite the corrupted file","Verify with an external ORC tool whether the stripe index is valid","Report as a writer bug if the file was produced by Presto itself"],"exampleFix":null,"handlingStrategy":"try-catch","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"}