prestodb/presto · error · OrcCorruptionException
Value is not null but data stream is missing
Error message
Value is not null but data stream is missing
What it means
LongDirectBatchStreamReader.readBlock throws OrcCorruptionException when it needs to skip readOffset non-null values but the DATA stream is absent. Skipping forward requires the direct data stream, so its absence means the stripe's stream set contradicts the presence of readable rows.
Source
Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/LongDirectBatchStreamReader.java:125
}
@Override
public Block readBlock()
throws IOException
{
if (!rowGroupOpen) {
openRowGroup();
}
if (readOffset > 0) {
if (presentStream != null) {
// skip ahead the present bit reader, but count the set bits
// and use this as the skip size for the data reader
readOffset = presentStream.countBitsSet(readOffset);
}
if (readOffset > 0) {
if (dataStream == null) {
throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is missing");
}
dataStream.skip(readOffset);
}
}
Block block;
if (dataStream == null) {
if (presentStream == null) {
throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is null but present stream is missing");
}
presentStream.skip(nextBatchSize);
block = RunLengthEncodedBlock.create(type, null, nextBatchSize);
}
else if (presentStream == null) {
block = readNonNullBlock();
}
else {
boolean[] isNull = new boolean[nextBatchSize];View on GitHub (pinned to 55bb57d202)
Solutions
- Verify and rewrite the corrupt file(s) with orc-tools or recompute the partition
- Restore data from a healthy backup
- Fix or upgrade the ORC writer that produced the malformed stripe
- Upgrade Presto to pick up improved stream-layout validation and readers
Defensive patterns
Strategy: validation
Validate before calling
// Pre-read: orc-tools verify data.orc to detect missing DATA streams
Try / catch
try { ... } catch (OrcCorruptionException e) { quarantineAndRecover(e.getOrcDataSourceId()); } Prevention
- Verify ORC files in ingestion pipelines
- Rewrite/repair truncated files before querying
- Use consistent, supported writer versions
- Keep partition-level backups for recovery
When it happens
Trigger: readOffset > 0 (prior row groups skipped, present bits counted) while dataStream == null for the direct-encoded integer column.
Common situations: Truncated or corrupt ORC files; writers that omit the DATA stream; failed/partial remote writes to S3/HDFS.
Related errors
- Value is not null but data stream is not present
- Value is not null but data stream is missing
- Value is not null but decimal stream is not present
- Value is not null but scale stream is not present
- Value is not null but data stream is not present
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/c8ee1a6793adb1ce.
Report an issue: GitHub.