apache/iceberg · error · UnsupportedOperationException
Unsupported type: decimal
Error message
Unsupported type: decimal
What it means
ArrowVectorAccessor is an abstract base whose default getDecimal implementation throws this UnsupportedOperationException. It exists so concrete accessors only implement the read methods their underlying Arrow vector actually supports; calling getDecimal on an accessor whose column is not a decimal-typed vector reaches the base-class stub and throws. The message reflects that this accessor type has no decimal decoding path.
Solutions
- Verify the Iceberg column type is decimal before calling getDecimal on the vector accessor
- Check which concrete ArrowVectorAccessor subclass you hold; only Decimal accessors implement getDecimal
- Ensure vectorized reads are configured consistently so decimal columns get DecimalLong/DecimalInt accessors
- If the column type is dynamic, branch on the accessor/vector type instead of assuming decimal
Example fix
// before
byte[] d = accessor.getDecimal(rowId, precision, scale); // throws for non-decimal columns
// after
if (accessor instanceof ArrowColumnAccessor /* or type is decimal */) {
byte[] d = accessor.getDecimal(rowId, precision, scale);
} else {
Object v = accessor.getSingleValue(rowId); // generic path
} Defensive patterns
Strategy: type-guard
Validate before calling
if (!columnType.typeId().equals(TypeID.DECIMAL)) { throw new IllegalArgumentException(columnType + " is not decimal"); } Type guard
boolean isDecimalAccessor(ArrowVectorAccessor<?,?,?,?> a) { return a instanceof DecimalArrowAccessor || a instanceof DictionaryDecimalLongAccessor || a instanceof DictionaryDecimalIntAccessor; } Try / catch
try { return accessor.getDecimal(rowId, precision, scale); } catch (UnsupportedOperationException e) { if (e.getMessage().contains("decimal")) { return genericRow(rowId); } throw e; } Prevention
- Match typed getters to the column's Iceberg type before materializing rows
- Route non-decimal columns through getSingleValue or the generic accessor path
- Keep vectorized-read config consistent with schema expectations in tests
When it happens
Trigger: Calling GenericArrowVectorAccessorFactory.getVectorAccessor(...).getDecimal(rowId, precision, scale) on an accessor for a non-decimal column (e.g. a binary or int vector accessor), or using a subclass that did not override getDecimal. The RAISED IN info shows it is reached via toDecimalVector, i.e. during vector-to-row materialization of a column that is not actually decimal.
Common situations: Vectorized-read pipelines (e.g. Spark's vectorized Iceberg reader) converting batch columns to row objects where the column's Iceberg type and the accessor's vector type diverge; using a batch/vectorization config that routes decimal columns to a plain binary accessor; upgrading Iceberg where a previously overridden method is now the base stub.
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
- Cannot read unsupported column types:
- Unsupported type: binary
- Unsupported type: boolean
- Unsupported type - byte
- Unsupported type - byte
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/6ae11162812eb32e.
Report an issue: GitHub.
Appendix: source
Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowVectorAccessor.java:77
public long getLong(int rowId) {
throw new UnsupportedOperationException("Unsupported type: long");
}
public float getFloat(int rowId) {
throw new UnsupportedOperationException("Unsupported type: float");
}
public double getDouble(int rowId) {
throw new UnsupportedOperationException("Unsupported type: double");
}
public byte[] getBinary(int rowId) {
throw new UnsupportedOperationException("Unsupported type: binary");
}
public DecimalT getDecimal(int rowId, int precision, int scale) {
throw new UnsupportedOperationException("Unsupported type: decimal");
}
public Utf8StringT getUTF8String(int rowId) {
throw new UnsupportedOperationException("Unsupported type: UTF8String");
}
public ArrayT getArray(int rowId) {
throw new UnsupportedOperationException("Unsupported type: array");
}
public ChildVectorT childColumn(int pos) {
if (childColumns != null) {
return childColumns[pos];
} else {
throw new IndexOutOfBoundsException("Child columns is null hence cannot find index: " + pos);
}
}
View on GitHub (pinned to 86d9c8fc54)