apache/iceberg · error · UnsupportedOperationException
readLongs is not supported
Error message
readLongs is not supported
What it means
readLongs(total, vec, rowId) is the batch variant for long columns on VectorizedValuesReader; its default body throws UnsupportedOperationException. Real readers override it to bulk-decode longs into a BigIntVector. nextVals() dispatching here means the active reader class does not implement the batch long path.
Source
Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedValuesReader.java:90
}
/**
* Read binary data of some length
*
* @param len The number of bytes to read
*/
default Binary readBinary(int len) {
throw new UnsupportedOperationException("readBinary is not supported");
}
/** Read `total` integers into `vec` starting at `vec[rowId]` */
default void readIntegers(int total, FieldVector vec, int rowId) {
throw new UnsupportedOperationException("readIntegers is not supported");
}
/** Read `total` longs into `vec` starting at `vec[rowId]` */
default void readLongs(int total, FieldVector vec, int rowId) {
throw new UnsupportedOperationException("readLongs is not supported");
}
/** Read `total` floats into `vec` starting at `vec[rowId]` */
default void readFloats(int total, FieldVector vec, int rowId) {
throw new UnsupportedOperationException("readFloats is not supported");
}
/** Read `total` doubles into `vec` starting at `vec[rowId]` */
default void readDoubles(int total, FieldVector vec, int rowId) {
throw new UnsupportedOperationException("readDoubles is not supported");
}
/**
* Initialize the reader from a page. See {@link ValuesReader#initFromPage(int,
* ByteBufferInputStream)}.
*/
void initFromPage(int valueCount, ByteBufferInputStream in) throws IOException;
}View on GitHub (pinned to 86d9c8fc54)
Solutions
- Disable vectorized reads (read.arrow.enabled=false) to use the row-at-a-time Parquet reader.
- Upgrade Iceberg to get batch long support for this type/encoding.
- Override readLongs() in the concrete reader to fill vec[rowId..rowId+total).
Example fix
// before
// default readLongs throws
// after
@Override
public void readLongs(int total, FieldVector vec, int rowId) {
for (int i = 0; i < total; i++) ((BigIntVector) vec).setSafe(rowId + i, readLong());
} Defensive patterns
Strategy: try-catch
Validate before calling
// confirm long column before batch path
if (!columnType.equals(Types.LongType.get())) props.put("read.arrow.enabled", "false"); Try / catch
try {
taskReader.readBatch();
} catch (UnsupportedOperationException e) {
return fallbackRowReader();
} Prevention
- Ensure the selected reader class overrides readLongs before enabling Arrow batch scans.
- Avoid mixing custom readers from different Iceberg versions.
- Add a unit test scanning long columns with vectorization enabled.
When it happens
Trigger: nextVals(total) attempts bulk fill of an Arrow long vector for a Parquet INT64 column, but the active VectorizedValuesReader subclass does not override readLongs().
Common situations: Vectorized scans of bigint/timestamp columns where the reader factory selected a fallback reader; encodings whose dedicated reader only implements batch integers; custom reader implementations.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- readIntegers is not supported
- readFloats is not supported
- readDoubles is not supported
- readLong is not supported
- readFloat is not supported
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/c567667b9523b258.
Report an issue: GitHub.