{"record":{"id":"8436ddab96cb5678","repo":"prestodb/presto","slug":"not-enough-positions-for-column-s-and-sequence-s","errorCode":null,"errorMessage":"Not enough positions for column %s and sequence %s, of type %s, checkpoints","messagePattern":"Not enough positions for column (.+?) and sequence (.+?), of type (.+?), checkpoints","errorType":"exception","errorClass":"InvalidCheckpointException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/checkpoint/Checkpoints.java","lineNumber":506,"sourceCode":"            this.sequence = sequence;\n            this.columnType = requireNonNull(columnType, \"columnType is null\");\n            this.positions = requireNonNull(positions, \"positions is null\");\n        }\n\n        public int getIndex()\n        {\n            return index;\n        }\n\n        public boolean hasNextPosition()\n        {\n            return index < positions.length;\n        }\n\n        public int nextPosition()\n        {\n            if (!hasNextPosition()) {\n                throw new InvalidCheckpointException(\"Not enough positions for column %s and sequence %s, of type %s, checkpoints\",\n                        column,\n                        sequence,\n                        columnType);\n            }\n\n            return positions[index++];\n        }\n    }\n\n    private static class ColumnAndSequence\n    {\n        private final int column;\n        private final int sequence;\n\n        private ColumnAndSequence(int column, int sequence)\n        {\n            this.column = column;\n            this.sequence = sequence;","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/checkpoint/Checkpoints.java#L488-L524","documentation":"Checkpoint decoding consumes positions one at a time from the column's position list. When a stream checkpoint (Boolean, Byte, Long V1/V2, row-group dictionary length, etc.) requests the next position but the list is exhausted, InvalidCheckpointException is thrown: the stripe footer did not record enough positions for the streams declared in the file.","triggerScenarios":"nextPosition() called by checkpoint factories (BooleanStreamCheckpoint, ByteStreamCheckpoint, LongStreamV1/V2Checkpoint, RowGroupDictionaryLengthStreamCheckpoint, createInputStreamCheckpoint) when index >= positions.length during getStreamCheckpoints on a stripe footer with too-few position entries.","commonSituations":"Corrupted or truncated stripe footers, files written by older/buggy writers omitting positions for some encodings, or reader/writer version skew changing how many positions each stream expects.","solutions":["Validate/inspect the failing file's stripe footer with orc-tools to see which stream lacks positions.","Rewrite the file (CTAS) with a supported current writer version.","Upgrade/downgrade the reader to match the writer's ORC/DWRF version conventions.","Restore the file from backup if corruption is confirmed (checksums won't match)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { checkpoints = Checkpoints.getStreamCheckpoints(...); }\ncatch (InvalidCheckpointException e) { disableCheckpointOptimizationForFile(fileId, e); }","preventionTips":["Avoid writer/reader version skew","Run orc-tools validation on ingested files","Restore corrupted files from backup"],"tags":["orc","checkpoint","metadata-mismatch"],"backgroundTag":"checkpoint-position-mismatch","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"}