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

Validation guard in readBlock: present-stream bits indicate non-null values while skipping a read offset, but the data stream that should carry those values is missing from the stripe — an inconsistent/corrupt ORC file rather than a user input problem.

Source

Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java:190

            totalLength += offsetVector[i];
        }

        int currentBatchSize = nextBatchSize;
        readOffset = 0;
        nextBatchSize = 0;
        if (totalLength == 0) {
            return new VariableWidthBlock(currentBatchSize, EMPTY_SLICE, offsetVector, Optional.ofNullable(isNullVector));
        }
        if (totalLength > maxSliceSize) {
            throw new GenericInternalException(
                    format("Values in column \"%s\" are too large to process for Presto. Requested to read [%s] bytes, when max allowed is [%s] bytes [%s]",
                            streamDescriptor.getFieldName(),
                            totalLength,
                            maxSliceSize,
                            streamDescriptor.getOrcDataSourceId()));
        }
        if (dataStream == null) {
            throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Value is not null but data stream is missing");
        }

        // allocate enough space to read
        byte[] data = new byte[toIntExact(totalLength)];
        Slice slice = Slices.wrappedBuffer(data);

        if (maxCodePointCount < 0) {
            // unbounded, simply read all data in on shot
            dataStream.next(data, 0, data.length);
            convertLengthVectorToOffsetVector(offsetVector);
        }
        else {
            // We do the following operations together in the for loop:
            // * truncate strings
            // * convert original length values in offsetVector into truncated offset values
            int currentLength = offsetVector[0];
            offsetVector[0] = 0;
            for (int i = 1; i <= currentBatchSize; i++) {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Rewrite the affected ORC file from source data
  2. Check for truncated or partially-written files in object storage
  3. Use query fault tolerance to skip the bad split and re-read elsewhere
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDirectBatchStreamReader.java:190 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/74adb06e8375163c. Report an issue: GitHub.