{"record":{"id":"74adb06e8375163c","repo":"prestodb/presto","slug":"value-is-not-null-but-data-stream-is-missing-74adb0","errorCode":null,"errorMessage":"Value is not null but data stream is missing","messagePattern":"Value is not null but data 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":190,"sourceCode":"            totalLength += offsetVector[i];\n        }\n\n        int currentBatchSize = nextBatchSize;\n        readOffset = 0;\n        nextBatchSize = 0;\n        if (totalLength == 0) {\n            return new VariableWidthBlock(currentBatchSize, EMPTY_SLICE, offsetVector, Optional.ofNullable(isNullVector));\n        }\n        if (totalLength > maxSliceSize) {\n            throw new GenericInternalException(\n                    format(\"Values in column \\\"%s\\\" are too large to process for Presto. Requested to read [%s] bytes, when max allowed is [%s] bytes [%s]\",\n                            streamDescriptor.getFieldName(),\n                            totalLength,\n                            maxSliceSize,\n                            streamDescriptor.getOrcDataSourceId()));\n        }\n        if (dataStream == null) {\n            throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), \"Value is not null but data stream is missing\");\n        }\n\n        // allocate enough space to read\n        byte[] data = new byte[toIntExact(totalLength)];\n        Slice slice = Slices.wrappedBuffer(data);\n\n        if (maxCodePointCount < 0) {\n            // unbounded, simply read all data in on shot\n            dataStream.next(data, 0, data.length);\n            convertLengthVectorToOffsetVector(offsetVector);\n        }\n        else {\n            // We do the following operations together in the for loop:\n            // * truncate strings\n            // * convert original length values in offsetVector into truncated offset values\n            int currentLength = offsetVector[0];\n            offsetVector[0] = 0;\n            for (int i = 1; i <= currentBatchSize; i++) {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java#L172-L208","documentation":"Validation guard in readBlock: present-stream bits indicate non-null values while skipping a read offset, but the data stream that should carry those values is missing from the stripe — an inconsistent/corrupt ORC file rather than a user input problem.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java:190 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rewrite the affected ORC file from source data","Check for truncated or partially-written files in object storage","Use query fault tolerance to skip the bad split and re-read elsewhere"],"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"}