apache/iceberg · error · UnsupportedOperationException
UnsupportedOperationException with no message…
Error message
UnsupportedOperationException with no message (DictionaryIdReader)
What it means
DictionaryIdReader.nextVal is a hook that always throws UnsupportedOperationException with no message. DictionaryIdReader only implements dictionary-encoded value reads, so a caller invoking the plain (non-dictionary) per-value read path is a programming error — the wrong reader was selected for the page's encoding.
Solutions
- Ensure the reader constructed in the definition-level reader matches the page encoding (use the plain reader for non-dictionary pages).
- Verify the file's encoding vs. expectation; re-write the file with standard encodings.
- If hitting this in your own subclass, implement nextVal instead of inheriting the throwing default.
Example fix
// before reader = new DictionaryIdReader(...); // chosen unconditionally // after reader = page.isDictionaryEncoded() ? new DictionaryIdReader(...) : new PlainReader(...);
Defensive patterns
Strategy: type-guard
Validate before calling
// choose reader based on page encoding before dispatch
boolean useDictReader = page.isDictionaryEncoded();
if (!useDictReader && reader instanceof DictionaryIdReader) {
throw new IllegalStateException("DictionaryIdReader selected for non-dictionary page");
} Type guard
if (reader instanceof DictionaryIdReader && !page.isDictionaryEncoded()) {
throw new IllegalStateException("DictionaryIdReader cannot service plain pages");
} Prevention
- Match reader selection to page encoding at page init time.
- Unit-test dispatch for files that switch encoding between pages.
- Avoid subclassing DictionaryIdReader without implementing nextVal.
When it happens
Trigger: Calling nextVal (the plain values path) on a DictionaryIdReader — i.e. reading a column whose reader was built for dictionary ids when the page is not dictionary encoded, or an internal dispatch bug selecting DictionaryIdReader for a plain-encoded page.
Common situations: Internal dispatch mistakes in the vectorized definition-level reader when a page's encoding differs from what was detected at page init (e.g. a page that turned out not to be dictionary encoded but the dictionary reader was retained).
Related errors
- could not read page in col " + desc
- could not read page in col " + desc + " as the dictionary…
- could not read page in col
- Skipping dictionary encoding config for missing field
- Unsupported base type for decimal:
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/51da6f400e60dcab.
Report an issue: GitHub.
Appendix: source
Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedParquetDefinitionLevelReader.java:665
Dictionary dict,
Mode mode,
int numValues,
NullabilityHolder holder,
int typeWidth) {
throw new UnsupportedOperationException();
}
}
class DictionaryIdReader extends BaseReader {
@Override
protected void nextVal(
FieldVector vector,
int idx,
VectorizedValuesReader valuesReader,
int typeWidth,
byte[] byteArray) {
throw new UnsupportedOperationException();
}
@Override
protected void nextDictEncodedVal(
FieldVector vector,
int idx,
VectorizedDictionaryEncodedParquetValuesReader reader,
Dictionary dict,
Mode mode,
int numValues,
NullabilityHolder holder,
int typeWidth) {
if (Mode.RLE.equals(mode)) {
reader.dictionaryIdReader().nextBatch(vector, idx, numValues, dict, holder, typeWidth);
} else if (Mode.PACKED.equals(mode)) {
vector.getDataBuffer().setInt((long) idx * IntVector.TYPE_WIDTH, reader.readInteger());
}
}View on GitHub (pinned to 86d9c8fc54)