apache/iceberg · error · RuntimeException
Non-supported bytesWidth: " + bytesWidth
Error message
Non-supported bytesWidth: " + bytesWidth
What it means
readIntLittleEndianPaddedOnBitWidth only supports values packed into 1, 2, or 4 bytes; any other bytesWidth indicates a decoding mode this vectorized RLE reader cannot handle, so it throws a RuntimeException.
Source
Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/BaseVectorizedParquetValuesReader.java:176
case 2:
{
int ch2 = inputStream.read();
int ch1 = inputStream.read();
return (ch1 << 8) + ch2;
}
case 3:
{
int ch3 = inputStream.read();
int ch2 = inputStream.read();
int ch1 = inputStream.read();
return (ch1 << 16) + (ch2 << 8) + ch3;
}
case 4:
{
return readIntLittleEndian();
}
}
throw new RuntimeException("Non-supported bytesWidth: " + bytesWidth);
}
/** Reads the next group. */
void readNextGroup() {
try {
int header = readUnsignedVarInt();
this.mode = (header & 1) == 0 ? Mode.RLE : Mode.PACKED;
switch (mode) {
case RLE:
this.currentCount = header >>> 1;
this.currentValue = readIntLittleEndianPaddedOnBitWidth();
return;
case PACKED:
int numGroups = header >>> 1;
this.currentCount = numGroups * 8;
if (this.packedValuesBuffer.length < this.currentCount) {
this.packedValuesBuffer = new int[this.currentCount];
}View on GitHub (pinned to 86d9c8fc54)
Solutions
- Rewrite the Parquet files with a standard writer (Spark/Iceberg) so integer widths are 1, 2, or 4 bytes.
- Use the non-vectorized Parquet reader (disable vectorized reads) which supports the full decoding spec.
- Verify the file is valid with parquet-tools; replace the corrupt source file.
Example fix
// before
.option("vectorization-enabled", "true")
// after
spark.read.format("iceberg").option("vectorization-enabled", "false").load("t") Defensive patterns
Strategy: fallback
Try / catch
// catch (RuntimeException e) {
// if (e.getMessage() != null && e.getMessage().contains("Non-supported bytesWidth")) {
// retryWithVectorizationDisabled();
// } else throw e;
// } Prevention
- Write Parquet files with standard producers (Spark/Iceberg).
- Validate source files with parquet-tools before ingesting.
- Fall back to non-vectorized reads for externally-produced files.
When it happens
Trigger: Decoding an RLE/bit-packed hybrid INTEGER column whose width resolves to a byte size other than 1, 2, or 4 inside readNextGroup.
Common situations: Reading a Parquet file written by an unusual producer or with an unexpected physical type width; corrupted or hand-crafted Parquet metadata.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- not a valid mode " + this.mode
- Unsupported variant: shredded typed_value array
- Failed to read from input stream
- skip is not supported
- Unrecognized mode: " + mode
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/8cd5c69e10ebb731.
Report an issue: GitHub.