apache/iceberg · error · UnsupportedOperationException

Unsupported type: long

Error message

Unsupported type: long

What it means

The base ArrowVectorAccessor.getLong(int) is an unimplemented stub that always throws. Concrete long-backed accessors must override it; calling the base means no long accessor was wired for this vector. Callers in the codebase (timestamp/bigint/time/rowId materialization helpers) rely on subclasses providing it.

Source

Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowVectorAccessor.java:61

          column.close();
        } catch (Exception e) {
          throw new RuntimeException(e);
        }
      }
    }
    vector.close();
  }

  public boolean getBoolean(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: boolean");
  }

  public int getInt(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: int");
  }

  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");
  }

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Route long-backed vectors to an accessor subclass overriding getLong.
  2. Override getLong in your concrete accessor: return vector.get(rowId).
  3. Use the accessor factory keyed on the vector's Field type rather than instantiating the base class.

Example fix

// before
long v = baseAccessor.getLong(rowId); // throws
// after
class LongAccessor extends ArrowVectorAccessor<BigIntVector> {
  @Override public long getLong(int rowId) { return vector.get(rowId); }
}
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(accessor instanceof LongAccessor)) { /* use non-vectorized path */ }

Type guard

static boolean supportsLong(ArrowVectorAccessor<?> a) {
  return a.getClass() != ArrowVectorAccessor.class;
}

Try / catch

try {
  long v = accessor.getLong(rowId);
} catch (UnsupportedOperationException e) {
  if ("Unsupported type: long".equals(e.getMessage())) { fallbackRead(rowId); } else { throw e; }
}

Prevention

When it happens

Trigger: Reading a long/bigint/timestamp column through an accessor that does not override getLong — e.g. a generic accessor built without a LongVector mapping, or base-class instantiation in custom code.

Common situations: Custom vectorized extensions missing the long accessor; new Arrow vector types not mapped in the accessor factory; timestamp columns routed through an accessor lacking getLong.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/30c4a3637984445d. Report an issue: GitHub.