prestodb/presto · error · UnsupportedOperationException

Unsupported vector type: {vector.getClass()}

Error message

Unsupported vector type: {vector.getClass()}

What it means

assignBlockFromValueVector dispatches a ValueVector to a type-specific assignBlockFrom* method; if the vector matches none of the supported instanceof branches (Bit, TinyInt, Int, BigInt, Float, Decimal, Timestamp, VarChar, Date, Time, List, Struct, Map, FixedSizeList), it throws UnsupportedOperationException naming the vector's class. It is the generic fallback for Arrow vectors the builder cannot write into a Presto BlockBuilder.

Source

Thrown at presto-common-arrow/src/main/java/com/facebook/plugin/arrow/ArrowBlockBuilder.java:318

        }
        else if (vector instanceof TimeStampMilliTZVector) {
            assignBlockFromTimeMilliTZVector((TimeStampMilliTZVector) vector, type, builder, startIndex, endIndex);
        }
        else if (vector instanceof MapVector) {
            // NOTE: MapVector is also instanceof ListVector, so check for Map first
            assignBlockFromMapVector((MapVector) vector, type, builder, startIndex, endIndex);
        }
        else if (vector instanceof FixedSizeListVector) {
            assignBlockFromFixedSizeListVector((FixedSizeListVector) vector, type, builder, startIndex, endIndex);
        }
        else if (vector instanceof ListVector) {
            assignBlockFromListVector((ListVector) vector, type, builder, startIndex, endIndex);
        }
        else if (vector instanceof StructVector) {
            assignBlockFromStructVector((StructVector) vector, type, builder, startIndex, endIndex);
        }
        else {
            throw new UnsupportedOperationException("Unsupported vector type: " + vector.getClass());
        }
    }

    public void assignBlockFromBitVector(BitVector vector, Type type, BlockBuilder builder, int startIndex, int endIndex)
    {
        for (int i = startIndex; i < endIndex; i++) {
            if (vector.isNull(i)) {
                builder.appendNull();
            }
            else {
                type.writeBoolean(builder, vector.get(i) == 1);
            }
        }
    }

    public void assignBlockFromIntVector(IntVector vector, Type type, BlockBuilder builder, int startIndex, int endIndex)
    {
        for (int i = startIndex; i < endIndex; i++) {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Inspect the reported vector class and verify it against the instanceof chain in assignBlockFromValueVector
  2. Remap the column to a supported Arrow type at the producer, or drop the column from the query/schema
  3. Add an instanceof branch and a corresponding assignBlockFrom* writer for the vector type
  4. Upgrade to a connector version supporting that Arrow type

Example fix

// before
throw new UnsupportedOperationException("Unsupported vector type: " + vector.getClass());
// after: add a branch before the throw
if (vector instanceof LargeVarCharVector) {
    assignBlockFromVarCharVector(toVarChar(vector), type, builder, startIndex, endIndex);
    return;
}
Defensive patterns

Strategy: type-guard

Validate before calling

// recursively validate the Arrow schema, including nested children
validateVectorTypes(fieldVector);

void validateVectorTypes(FieldVector v) {
    if (!isSupportedArrowVector(v)) {
        throw new IllegalStateException("Unsupported Arrow vector: " + v.getClass().getName());
    }
    for (FieldVector child : v.getChildrenFromFields()) {
        validateVectorTypes(child);
    }
}

Type guard

boolean isSupportedElementVector(ValueVector v) {
    return v instanceof BitVector || v instanceof IntVector || v instanceof BigIntVector
        || v instanceof Float4Vector || v instanceof Float8Vector || v instanceof DecimalVector
        || v instanceof VarCharVector || v instanceof DateDayVector || v instanceof DateMilliVector
        || v instanceof TimeSecVector || v instanceof TimeMilliVector
        || v instanceof TimeStampMicroVector || v instanceof TimeStampMilliVector;
}

Try / catch

try {
    blockBuilder.assignBlockFromValueVector(vector, type, builder, 0, rowCount);
} catch (UnsupportedOperationException e) {
    if (e.getMessage().startsWith("Unsupported vector type")) {
        LOG.warn("Falling back to JSON serialization for %s", vector.getClass().getName());
        assignAsJsonString(vector, type, builder, 0, rowCount);
        return;
    }
    throw e;
}

Prevention

When it happens

Trigger: buildBlockFromFieldVector or any nested assignBlockFromListVector/FixedSizeListVector/MapVector/StructVector call encounters an element ValueVector of an unmapped Arrow type (e.g. TimeMicroVector, DurationVector, IntervalYearVector, LargeVarCharVector).

Common situations: Nested Arrow columns (lists/structs/maps) containing element types the connector does not map; schema evolution upstream introduces a new primitive; Arrow version upgrade changes vector classes (e.g. large-offset variants).

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/8115d3e86aa02c8d. Report an issue: GitHub.