apache/iceberg · error · UnsupportedOperationException

Unsupported type: " + primitive

Error message

Unsupported type: " + primitive

What it means

VectorizedArrowReader.allocateVectorBasedOnTypeName creates the Arrow vector matching the Parquet primitive type. Its switch covers common physical types (INT32/INT64/FLOAT/DOUBLE/BINARY/fixed binary etc.); any other primitive falls to default and throws this UnsupportedOperationException before any vector is allocated.

Source

Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorizedArrowReader.java:376

        this.vec = arrowField.createVector(rootAlloc);
        ((BitVector) vec).allocateNew(batchSize);
        this.readType = ReadType.BOOLEAN;
        this.typeWidth = UNKNOWN_WIDTH;
        break;
      case INT64:
        this.vec = arrowField.createVector(rootAlloc);
        ((BigIntVector) vec).allocateNew(batchSize);
        this.readType = ReadType.LONG;
        this.typeWidth = (int) BigIntVector.TYPE_WIDTH;
        break;
      case DOUBLE:
        this.vec = arrowField.createVector(rootAlloc);
        ((Float8Vector) vec).allocateNew(batchSize);
        this.readType = ReadType.DOUBLE;
        this.typeWidth = (int) Float8Vector.TYPE_WIDTH;
        break;
      default:
        throw new UnsupportedOperationException("Unsupported type: " + primitive);
    }
  }

  @Override
  public void setRowGroupInfo(PageReadStore source, Map<ColumnPath, ColumnChunkMetaData> metadata) {
    ColumnChunkMetaData chunkMetaData = metadata.get(ColumnPath.get(columnDescriptor.getPath()));
    this.dictionary =
        vectorizedColumnIterator.setRowGroupInfo(
            source.getPageReader(columnDescriptor),
            !ParquetUtil.hasNonDictionaryPages(chunkMetaData));
  }

  @Override
  public void close() {
    if (vec != null) {
      vec.close();
    }
  }

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Disable vectorized reads (parquet vectorization disabled) so the generic reader handles the column
  2. Check the column's physical type in the Parquet metadata and confirm it is one of the vectorized-supported types
  3. Upgrade Iceberg to a version adding support for that physical type
  4. Write the data with a standard Iceberg type mapping so the physical type is supported

Example fix

// before
spark.read.option("vectorized-reader-enabled", "true")...
// after
spark.read.option("vectorized-reader-enabled", "false")...
Defensive patterns

Strategy: fallback

Validate before calling

Set<String> supported = Set.of("INT32","INT64","FLOAT","DOUBLE","BINARY","FIXED_LEN_BYTE_ARRAY","BOOLEAN","INT96");
if (!supported.contains(primitive.getPrimitiveTypeName().toString())) {
  // choose non-vectorized reader
}

Type guard

boolean vectorizationSupported(PrimitiveType p) {
  switch (p.getPrimitiveTypeName()) {
    case INT32: case INT64: case FLOAT: case DOUBLE: case BINARY:
    case FIXED_LEN_BYTE_ARRAY: case BOOLEAN: return true;
    default: return false;
  }
}

Try / catch

try {
  return new VectorizedArrowReader(...);
} catch (UnsupportedOperationException e) {
  return genericArrowReader();
}

Prevention

When it happens

Trigger: Constructing a VectorizedArrowReader for a column whose Parquet primitive type is not in the handled switch cases (e.g. an unmapped exotic physical type reached via allocateFieldVector).

Common situations: Reading Parquet files written by non-Iceberg writers with unusual physical representations; enabling vectorized reads on tables containing types the vectorized path does not support.

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/ba424b773d7539b0. Report an issue: GitHub.