{"record":{"id":"efa9b24878dff982","repo":"prestodb/presto","slug":"value-is-null-but-present-stream-is-missing-efa9b2","errorCode":null,"errorMessage":"Value is null but present stream is missing","messagePattern":"Value is null but present stream is missing","errorType":"exception","errorClass":"OrcCorruptionException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java","lineNumber":129,"sourceCode":"                readOffset = presentStream.countBitsSet(readOffset);\n            }\n            if (readOffset > 0) {\n                if (lengthStream == null) {\n                    throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), \"Value is not null but length stream is not present\");\n                }\n                long dataSkipSize = lengthStream.sum(readOffset);\n                if (dataSkipSize > 0) {\n                    if (dataStream == null) {\n                        throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), \"Value is not null but data stream is not present\");\n                    }\n                    dataStream.skip(dataSkipSize);\n                }\n            }\n        }\n\n        if (lengthStream == null) {\n            if (presentStream == null) {\n                throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), \"Value is null but present stream is missing\");\n            }\n            presentStream.skip(nextBatchSize);\n            Block nullValueBlock = readAllNullsBlock();\n            readOffset = 0;\n            nextBatchSize = 0;\n            return nullValueBlock;\n        }\n\n        // create new isNullVector and offsetVector for VariableWidthBlock\n        boolean[] isNullVector = null;\n\n        // We will use the offsetVector as the buffer to read the length values from lengthStream,\n        // and the length values will be converted in-place to an offset vector.\n        int[] offsetVector = new int[nextBatchSize + 1];\n\n        if (presentStream == null) {\n            lengthStream.next(offsetVector, nextBatchSize);\n        }","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java#L111-L147","documentation":"Validation guard in readBlock: the ORC stripe declared a present stream (nulls exist) but the required length/data stream for non-null slice values is absent, meaning the column chunk metadata is internally inconsistent — a corrupted or malformed file.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java:129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Drop and rewrite the corrupted ORC file from the source data","Verify file integrity in object storage (checksums, multipart upload completeness)","Wrap reads in a query fault-tolerance layer that skips/replaces bad splits"],"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"}