{"record":{"id":"bc4502cdc385311e","repo":"prestodb/presto","slug":"value-is-null-but-present-stream-is-missing-bc4502","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/TimestampBatchStreamReader.java","lineNumber":119,"sourceCode":"                readOffset = presentStream.countBitsSet(readOffset);\n            }\n            if (readOffset > 0) {\n                if (secondsStream == null) {\n                    throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), \"Value is not null but seconds stream is missing\");\n                }\n                if (nanosStream == null) {\n                    throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), \"Value is not null but nanos stream is missing\");\n                }\n\n                secondsStream.skip(readOffset);\n                nanosStream.skip(readOffset);\n            }\n        }\n\n        Block block;\n        if (secondsStream == null && nanosStream == 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 = RunLengthEncodedBlock.create(TIMESTAMP, null, nextBatchSize);\n        }\n        else if (presentStream == null) {\n            block = readNonNullBlock();\n        }\n        else {\n            boolean[] isNull = new boolean[nextBatchSize];\n            int nullCount = presentStream.getUnsetBits(nextBatchSize, isNull);\n            if (nullCount == 0) {\n                block = readNonNullBlock();\n            }\n            else if (nullCount != nextBatchSize) {\n                block = readNullBlock(isNull);\n            }\n            else {\n                block = RunLengthEncodedBlock.create(TIMESTAMP, null, nextBatchSize);","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/TimestampBatchStreamReader.java#L101-L137","documentation":"Validation guard: a null check requires the present stream (presentStream == null here means all values assumed non-null) yet the skip path encounters an offset implying null entries — the row group's stream layout contradicts its metadata, i.e. file corruption.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/TimestampBatchStreamReader.java:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restore/rewrite the corrupted file","Validate storage-level checksums and upload completeness","Use fault-tolerant reads to quarantine 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"}