apache/iceberg · error · java.lang.UnsupportedOperationException

Unsupported RawType.

Error message

Unsupported RawType.

What it means

Flink RawType wraps arbitrary Java/Scala objects serialized via a configured serializer class. Iceberg cannot represent opaque serialized objects, so FlinkTypeVisitor throws UnsupportedOperationException when a conversion visitor encounters RawType.

Source

Thrown at flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java:68

  @Override
  public T visit(DistinctType distinctType) {
    throw new UnsupportedOperationException("Unsupported DistinctType.");
  }

  @Override
  public T visit(StructuredType structuredType) {
    throw new UnsupportedOperationException("Unsupported StructuredType.");
  }

  @Override
  public T visit(NullType nullType) {
    throw new UnsupportedOperationException("Unsupported NullType.");
  }

  @Override
  public T visit(RawType<?> rawType) {
    throw new UnsupportedOperationException("Unsupported RawType.");
  }

  @Override
  public T visit(SymbolType<?> symbolType) {
    throw new UnsupportedOperationException("Unsupported SymbolType.");
  }

  @Override
  public T visit(LogicalType other) {
    throw new UnsupportedOperationException("Unsupported type: " + other);
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Replace the RAW column with a structured ROW type or scalar types Iceberg supports.
  2. Serialize the object yourself into a supported format (JSON STRING or BINARY) before the sink and deserialize at read time.
  3. Remove the RAW column from the data written to Iceberg.
  4. Override visit(RawType) in a custom FlinkTypeVisitor subclass (e.g. map RawType<byte[]> to BinaryType).

Example fix

// before
DataTypes.RAW(SomeObject.class)
// after
DataTypes.STRING() // store JSON: my_object.toJson()
// or
DataTypes.BYTES() // store serialized bytes
Defensive patterns

Strategy: validation

Validate before calling

import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.RawType;

static boolean containsRawType(org.apache.flink.table.api.Schema schema) {
  return schema.getColumns().stream()
      .anyMatch(c -> c.getType().getLogicalType() instanceof RawType);
}

Type guard

static boolean isRawType(LogicalType t) {
  return t instanceof RawType;
}

Prevention

When it happens

Trigger: Converting a row type containing a RawType column (created via DataTypes.RAW(...) or produced by UDFs returning non-representable Java objects) during Iceberg sink schema resolution or FlinkCatalog table operations.

Common situations: Passing custom POJOs or opaque objects (geospatial, ML vectors) through a Flink pipeline into an Iceberg sink; RAW columns from a source connector; UDTs bridged with RAW instead of proper ROW types.

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