apache/iceberg · error · UnsupportedOperationException

Unsupported vector: " + vector.getClass()

Error message

Unsupported vector: " + vector.getClass()

What it means

GenericArrowVectorAccessorFactory.getPlainVectorAccessor builds row accessors for Parquet-backed Arrow vectors. When the supplied vector is neither a VarCharVector, VarBinaryVector, nor FixedSizeBinaryVector (for non-decimal columns), it has no accessor mapping and the factory throws this UnsupportedOperationException. It signals that vectorized reads encountered a physical Parquet type the Arrow accessor layer cannot handle.

Source

Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/GenericArrowVectorAccessorFactory.java:234

    } else if (vector instanceof TimeStampNanoTZVector) {
      return new TimestampAccessor<>((TimeStampNanoTZVector) vector);
    } else if (vector instanceof ListVector) {
      ListVector listVector = (ListVector) vector;
      return new ArrayAccessor<>(listVector, arrayFactorySupplier.get());
    } else if (vector instanceof StructVector) {
      StructVector structVector = (StructVector) vector;
      return new StructAccessor<>(structVector, structChildFactorySupplier.get());
    } else if (vector instanceof TimeMicroVector) {
      return new TimeMicroAccessor<>((TimeMicroVector) vector);
    } else if (vector instanceof FixedSizeBinaryVector) {
      if (isDecimal(primitive)) {
        return new FixedSizeBinaryBackedDecimalAccessor<>(
            (FixedSizeBinaryVector) vector, decimalFactorySupplier.get());
      }
      return new FixedSizeBinaryAccessor<>(
          (FixedSizeBinaryVector) vector, stringFactorySupplier.get());
    }
    throw new UnsupportedOperationException("Unsupported vector: " + vector.getClass());
  }

  private static boolean isDecimal(PrimitiveType primitive) {
    return primitive != null
        && primitive.getLogicalTypeAnnotation()
            instanceof LogicalTypeAnnotation.DecimalLogicalTypeAnnotation;
  }

  private static class BooleanAccessor<
          DecimalT, Utf8StringT, ArrayT, ChildVectorT extends AutoCloseable>
      extends ArrowVectorAccessor<DecimalT, Utf8StringT, ArrayT, ChildVectorT> {
    private final BitVector vector;

    BooleanAccessor(BitVector vector) {
      super(vector);
      this.vector = vector;
    }

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Identify the vector class in the message and check whether the column should be decimal (LogicalTypeAnnotation.DecimalLogicalTypeAnnotation) — if so, fix the writer/type mapping so the decimal flag is set
  2. Fall back to non-vectorized (generic) reads for that table/column by disabling vectorized reads in the scan config
  3. Upgrade Iceberg (or Arrow) to a version that maps the vector type to an accessor
  4. If the type is genuinely new, extend getPlainVectorAccessor with a branch for that vector class

Example fix

// before
VectorizedReaderBuilder builder = ... // vectorized reads on exotic column
// after
collection.task().shouldFailFast(); // or
collection.config().set(TableProperties.PARQUET_VECTORIZATION_ENABLED, "false");
Defensive patterns

Strategy: fallback

Validate before calling

if (!vector.getClass().getSimpleName().matches("VarCharVector|VarBinaryVector|FixedSizeBinaryVector")) {
  // use non-vectorized read path
}

Type guard

boolean isSupportedVector(FieldVector v) {
  return v instanceof VarCharVector || v instanceof VarBinaryVector || v instanceof FixedSizeBinaryVector;
}

Try / catch

try {
  reader = VectorizedReaderBuilder.build();
} catch (UnsupportedOperationException e) {
  // fall back to generic Parquet read
  reader = genericReader();
}

Prevention

When it happens

Trigger: Calling getVectorAccessor for a column whose Arrow vector class falls outside the handled set (e.g. an unexpected/wrapped vector type) while the primitive is not marked as decimal; the fixed-code path only produces FixedSizeBinaryBackedDecimalAccessor or FixedSizeBinaryAccessor before falling through to the throw.

Common situations: Reading Parquet files written by other engines with unusual encodings; a new Arrow/Parquet version mapping a type to a vector class this factory does not recognize; custom data files with a primitive column backed by a vector type outside the supported trio.

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


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