{"record":{"id":"631afb967b5f167e","repo":"prestodb/presto","slug":"value-is-not-null-but-nanos-stream-is-missing","errorCode":null,"errorMessage":"Value is not null but nanos stream is missing","messagePattern":"Value is not null but nanos 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":108,"sourceCode":"    public Block readBlock()\n            throws IOException\n    {\n        if (!rowGroupOpen) {\n            openRowGroup();\n        }\n\n        if (readOffset > 0) {\n            if (presentStream != null) {\n                // skip ahead the present bit reader, but count the set bits\n                // and use this as the skip size for the data reader\n                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        }","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/TimestampBatchStreamReader.java#L90-L126","documentation":"TimestampBatchStreamReader.readBlock: a non-null value was indicated by the present stream but the nanoseconds secondary stream is absent from the ORC file, so the timestamp cannot be reconstructed — the file's stream layout is corrupt.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/TimestampBatchStreamReader.java:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Recreate the ORC file with a correct writer","Check for partial/corrupt files in storage","Skip the affected split via query fault tolerance"],"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"}