apache/iceberg · error · ParquetDecodingException
not a valid mode " + this.mode
Error message
not a valid mode " + this.mode
What it means
readNextGroup decodes RLE/bit-packed hybrid pages; an unknown mode value in the page header is not RLE or BIT_PACKED, so it throws ParquetDecodingException. This signals the page data cannot be decoded by this reader.
Source
Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/BaseVectorizedParquetValuesReader.java:206
return;
case PACKED:
int numGroups = header >>> 1;
this.currentCount = numGroups * 8;
if (this.packedValuesBuffer.length < this.currentCount) {
this.packedValuesBuffer = new int[this.currentCount];
}
packedValuesBufferIdx = 0;
int valueIndex = 0;
while (valueIndex < this.currentCount) {
// values are bit packed 8 at a time, so reading bitWidth will always work
ByteBuffer buffer = inputStream.slice(bitWidth);
this.packer.unpack8Values(
buffer, buffer.position(), this.packedValuesBuffer, valueIndex);
valueIndex += 8;
}
return;
default:
throw new ParquetDecodingException("not a valid mode " + this.mode);
}
} catch (IOException e) {
throw new ParquetDecodingException("Failed to read from input stream", e);
}
}
@Override
public boolean readBoolean() {
return this.readInteger() != 0;
}
@Override
public void skip() {
throw new UnsupportedOperationException();
}
@Override
public int readValueDictionaryId() {View on GitHub (pinned to 86d9c8fc54)
Solutions
- Disable vectorized reads so the full-featured Parquet decoder handles the page.
- Validate the file with parquet-tools; if corrupt, regenerate the file.
- Rewrite the data with a current Iceberg/Parquet writer version.
Defensive patterns
Strategy: try-catch
Try / catch
// catch (ParquetDecodingException e) {
// if (e.getMessage().contains("not a valid mode")) {
// fallbackToNonVectorizedScan();
// } else throw e;
// } Prevention
- Regenerate corrupt files from source data.
- Verify file integrity after writes/checksums.
- Keep writer/reader Parquet versions compatible.
When it happens
Trigger: A page header whose encoding mode is neither RLE nor PACKED during readNextGroup, reached from readInteger.
Common situations: Corrupted Parquet files, files written with encodings unsupported by the vectorized path, or truncated page data mid-scan.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Non-supported bytesWidth: " + bytesWidth
- No more values to read. Total values read: " + valuesRead +
- Can not read min delta in current block
- Can not decode bitwidth in block header
- Read failure possibly due to PARQUET-246: try setting parque
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/de4f121d6c674f1d.
Report an issue: GitHub.