{"record":{"id":"86e5ada56313703d","repo":"prestodb/presto","slug":"value-is-not-null-but-seconds-stream-is-missing","errorCode":null,"errorMessage":"Value is not null but seconds stream is missing","messagePattern":"Value is not null but seconds 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":105,"sourceCode":"    }\n\n    @Override\n    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        }","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/TimestampBatchStreamReader.java#L87-L123","documentation":"Corruption signal from the ORC timestamp reader: the present stream marks rows as non-null for the rows being skipped/read, yet the row group carries no DATA stream for the seconds component, so the values cannot be decoded. It points to a malformed, truncated, or writer-buggy ORC file identified by the data source id.","triggerScenarios":"Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/TimestampBatchStreamReader.java:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Locate the offending ORC file from the OrcDataSourceId in the exception and check how it was produced (writer version, interrupted write, truncated upload).","Reproduce with the hive.orc.use-bloom-filters off and compare; if the file is truly corrupt, re-generate it from the source table.","If the column is not needed, exclude it from the query or recreate the table schema so the corrupt column is skipped.","Upgrade Presto/the ORC writer if a known writer bug produced non-canonical timestamp streams."],"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"}