apache/iceberg · error · ParquetDecodingException

Can not read min delta in current block

Error message

Can not read min delta in current block

What it means

readBlockHeader reads the block's minimum delta via a zig-zag variable-length long from the encoded stream. If BytesUtils.readZigZagVarLong throws IOException (stream exhausted or malformed varint), the reader throws ParquetDecodingException. This means the DELTA_BINARY_PACKED block header is unreadable — the data is corrupt, truncated, or not actually delta encoded.

Source

Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedDeltaEncodedValuesReader.java:212

        i < miniBlockSizeInValues && valuesReadInMiniBlock < remaining;
        i++) {
      // calculate values from deltas unpacked for current block
      long outValue = lastValueRead + minDeltaInCurrentBlock + unpackedValuesBuffer[i];
      lastValueRead = outValue;
      outputWriter.write(vec, ((long) (rowId + valuesReadInMiniBlock) * typeWidth), outValue);
      remainingInBlock--;
      remainingInMiniBlock--;
      valuesReadInMiniBlock++;
    }

    return valuesReadInMiniBlock;
  }

  private void readBlockHeader() {
    try {
      minDeltaInCurrentBlock = BytesUtils.readZigZagVarLong(inputStream);
    } catch (IOException e) {
      throw new ParquetDecodingException("Can not read min delta in current block", e);
    }
    readBitWidthsForMiniBlocks();
    remainingInBlock = blockSizeInValues;
    currentMiniBlock = 0;
    remainingInMiniBlock = 0;
  }

  /**
   * mini block has a size of 8*n, unpack 32 value each time
   *
   * <p>see org.apache.parquet.column.values.delta.DeltaBinaryPackingValuesReader#unpackMiniBlock
   */
  private void unpackMiniBlock() throws IOException {
    Arrays.fill(this.unpackedValuesBuffer, 0);
    BytePackerForLong packer =
        Packer.LITTLE_ENDIAN.newBytePackerForLong(bitWidths[currentMiniBlock]);
    for (int j = 0; j < miniBlockSizeInValues; j += 8) {
      ByteBuffer buffer = inputStream.slice(packer.getBitWidth());

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Re-read/retry to rule out transient storage errors, then validate the file's integrity.
  2. Rewrite the affected data files from the source (e.g. Iceberg rewrite_data_files) if they are truncated or corrupt.
  3. Fix or upgrade the writer that produced the delta-encoded files.
  4. Disable vectorized reads as a fallback reader.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  // vectorized read
} catch (ParquetDecodingException e) {
  if (e.getMessage().contains("Can not read min delta in current block")) {
    // mark file corrupt, rewrite from source, or fall back to non-vectorized reader
  } else throw e;
}

Prevention

When it happens

Trigger: readBlockHeader (invoked from loadMiniBlockToOutput) hits an IOException while parsing the min-delta varint at a block boundary.

Common situations: Truncated Parquet files from failed writes or partial uploads, corrupt data pages, or byte-stream misalignment from a buggy encoder.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/a7266581d749344c. Report an issue: GitHub.