prestodb/presto · error · OrcCorruptionException
Value is not null but data stream is not present
Error message
Value is not null but data stream is not present
What it means
LongDictionaryBatchStreamReader.readBlock throws OrcCorruptionException when it must skip forward past already-read values (readOffset > 0) but the column's data stream is absent. A non-null data stream is mandatory whenever rows must be read or skipped, so its absence indicates the ORC stripe's stream layout contradicts what the metadata promised.
Source
Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/LongDictionaryBatchStreamReader.java:120
{
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 length reader
readOffset = presentStream.countBitsSet(readOffset);
}
if (inDictionaryStream != null) {
inDictionaryStream.skip(readOffset);
}
if (readOffset > 0) {
if (dataStream == null) {
throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present");
}
dataStream.skip(readOffset);
}
}
BlockBuilder builder = type.createBlockBuilder(null, nextBatchSize);
if (presentStream == null) {
// Data doesn't have nulls
if (dataStream == null) {
throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is not present");
}
if (inDictionaryStream == null) {
for (int i = 0; i < nextBatchSize; i++) {
type.writeLong(builder, dictionary[((int) dataStream.next())]);
}
}
else {View on GitHub (pinned to 55bb57d202)
Solutions
- Validate/rewrite the file with ORC tooling (orc-tools verify / rewriting via Hive) to repair or regenerate the data
- Identify and fix the writer that produced the file; check hive.orc.writer.* config and writer version
- Point the table at a healthy copy of the data (backup/recompute the partition)
- Upgrade Presto; this class is deprecated in favor of LongDictionaryBatchV2StreamReader which is more robust
Defensive patterns
Strategy: validation
Validate before calling
// Detect corrupt files before query: // java -jar orc-tools-*.jar verify data.orc
Try / catch
try { ... } catch (OrcCorruptionException e) { quarantineFile(e.getOrcDataSourceId()); } Prevention
- Run orc-tools verify on ingested ORC files
- Restore/rewrite corrupt partitions instead of retrying reads
- Standardize on one supported writer version
- Prefer the V2 dictionary batch reader via a current Presto version
When it happens
Trigger: readOffset > 0 (row-group skip or resume) while dataStream == null for the dictionary-encoded BIGINT column.
Common situations: Truncated or corrupt ORC files; files written by buggy/foreign writers omitting the DATA stream; partial S3/HDFS writes; corruption introduced by the Java ORC writer bug (deprecated LongDictionaryBatchStreamReader).
Related errors
- Dictionary is not empty but dictionary length stream is not
- Dictionary is not empty but dictionary length stream is not
- 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
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/472ab40b9c0a2e30.
Report an issue: GitHub.