apache/iceberg · error · java.lang.UnsupportedOperationException

Unsupported type: %s

Error message

Unsupported type: %s

What it means

This is the fallback branch of FlinkTypeVisitor for any Flink LogicalType not matched by a specific visit method. Since the visitor cannot map the type to an Iceberg type, it throws UnsupportedOperationException with the type's toString in the message, signaling that Iceberg's Flink integration does not know this logical type at all.

Source

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

  @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. Read the type name in the message and cast the column to a supported type (INT, BIGINT, STRING, TIMESTAMP, ROW, etc.) before conversion.
  2. Pin a Flink version matching your iceberg-flink runtime (e.g. flink/v1.20 module with Flink 1.20).
  3. Upgrade iceberg-flink-runtime to a version that maps the missing type, if one exists.
  4. If you own the visitor subclass, override visit(LogicalType other) to add a custom mapping for the new type.

Example fix

// before
INSERT INTO iceberg_t SELECT exotic_col FROM src; // unknown LogicalType
// after
INSERT INTO iceberg_t SELECT CAST(exotic_col AS STRING) AS exotic_col FROM src;
Defensive patterns

Strategy: validation

Validate before calling

import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.api.Schema;

static void validateIcebergCompatible(Schema schema) {
  schema.getColumns().forEach(c -> {
    LogicalType t = c.getType().getLogicalType();
    if (t instanceof org.apache.flink.table.types.logical.TimestampType
        && ((org.apache.flink.table.types.logical.TimestampType) t).getPrecision() > 6) {
      throw new IllegalArgumentException("Timestamp precision > 6 unsupported by Iceberg: " + t);
    }
    if (t instanceof org.apache.flink.table.types.logical.ZonedTimestampType) {
      throw new IllegalArgumentException("ZonedTimestampType unsupported: " + t);
    }
  });
}

Type guard

static boolean isKnownUnsupported(LogicalType t) {
  return t instanceof org.apache.flink.table.types.logical.ZonedTimestampType
      || t instanceof org.apache.flink.table.types.logical.YearMonthIntervalType
      || t instanceof org.apache.flink.table.types.logical.DayTimeIntervalType
      || t instanceof org.apache.flink.table.types.logical.DistinctType
      || t instanceof org.apache.flink.table.types.logical.StructuredType
      || t instanceof org.apache.flink.table.types.logical.NullType
      || t instanceof org.apache.flink.table.types.logical.RawType
      || t instanceof org.apache.flink.table.types.logical.SymbolType;
}

Try / catch

try {
  icebergSchema = FlinkSchemaUtil.convert(flinkSchema);
} catch (UnsupportedOperationException e) {
  LOG.error("Iceberg cannot convert Flink type: {}", e.getMessage());
  throw new IllegalStateException("Fix the schema before enabling the Iceberg sink", e);
}

Prevention

When it happens

Trigger: Calling any FlinkTypeVisitor-based conversion with a row type containing a logical type outside the visitor's supported set, or a newer Flink version introducing types Iceberg has not mapped yet (the visitor already covers ZonedTimestamp, interval types, Distinct/Structured/Null/Raw/Symbol; anything else lands here).

Common situations: Upgrading Flink so new logical types appear in inferred schemas; custom LogicalType implementations from third-party connectors; passing an exotic connector type through an Iceberg sink; directly misusing the visitor API.

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