apache/iceberg · error · java.lang.UnsupportedOperationException

Unsupported ZonedTimestampType.

Error message

Unsupported ZonedTimestampType.

What it means

FlinkTypeVisitor is an abstract LogicalTypeVisitor that throws UnsupportedOperationException for every Flink logical type Iceberg cannot map. ZonedTimestampType (TIMESTAMP WITH LOCAL TIME ZONE / zoned timestamps) has no Iceberg representation, so the default visit throws immediately.

Solutions

  1. Use TIMESTAMP WITHOUT TIME ZONE (TimestampType) in the Flink schema instead of TIMESTAMP_LTZ.
  2. Cast the column: CAST(ts_col AS TIMESTAMP(3)) before schema conversion.
  3. Subclass FlinkTypeVisitor and override visit(ZonedTimestampType) to map to TimestampType.withZone() if your pipeline can handle it.
  4. Store the value as a string or epoch-millis BIGINT column if zone info must be preserved.

Example fix

// before
col 'event_ts' TIMESTAMP(3) WITH LOCAL TIME ZONE

// after
col 'event_ts' TIMESTAMP(3)  -- without time zone
Defensive patterns

Strategy: validation

Validate before calling

for (Column col : resolvedSchema.getColumns()) {
  LogicalType t = col.getDataType().getLogicalType();
  if (t instanceof ZonedTimestampType) {
    throw new IllegalArgumentException(
        "Column '" + col.getName() + "' uses TIMESTAMP WITH LOCAL TIME ZONE; use TIMESTAMP instead");
  }
}

Try / catch

try {
  Schema s = FlinkSchemaUtil.toIcebergSchema(flinkSchema);
} catch (UnsupportedOperationException e) {
  if (e.getMessage().contains("ZonedTimestampType")) {
    // cast TIMESTAMP_LTZ columns to TIMESTAMP
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Any FlinkSchemaUtil/FlinkTypeUtil conversion that accepts a column of Flink type TIMESTAMP(3) WITH LOCAL TIME ZONE (ZonedTimestampType), causing visitor dispatch to visit(ZonedTimestampType).

Common situations: Creating an Iceberg-backed Flink table with 'TIMESTAMP_LTZ(3)' columns; converting a Flink schema containing time-zone-aware timestamps to an Iceberg schema; users assuming TIMESTAMP_LTZ maps to Iceberg timestamptz.

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

Appendix: source

Thrown at flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java:38

import org.apache.flink.table.types.logical.DayTimeIntervalType;
import org.apache.flink.table.types.logical.DistinctType;
import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.LogicalTypeVisitor;
import org.apache.flink.table.types.logical.NullType;
import org.apache.flink.table.types.logical.RawType;
import org.apache.flink.table.types.logical.StructuredType;
import org.apache.flink.table.types.logical.SymbolType;
import org.apache.flink.table.types.logical.YearMonthIntervalType;
import org.apache.flink.table.types.logical.ZonedTimestampType;

public abstract class FlinkTypeVisitor<T> implements LogicalTypeVisitor<T> {

  // ------------------------- Unsupported types ------------------------------

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

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

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

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

  @Override

View on GitHub (pinned to 86d9c8fc54)