apache/iceberg · error · java.lang.UnsupportedOperationException

Unsupported DayTimeIntervalType.

Error message

Unsupported DayTimeIntervalType.

What it means

FlinkTypeVisitor throws UnsupportedOperationException for DayTimeIntervalType because Iceberg has no interval type. Day-time intervals (e.g. INTERVAL DAY TO SECOND) cannot round-trip into an Iceberg schema, so the visitor rejects them.

Solutions

  1. Replace the interval column with BIGINT (e.g. milliseconds) or a numeric type.
  2. Cast the interval to its numeric epoch representation before schema conversion.
  3. Subclass FlinkTypeVisitor and override visit(DayTimeIntervalType) with a custom mapping.
  4. Use a TIMESTAMP duration pair (start/end) if the interval is derived from two events.

Example fix

// before
col 'duration' INTERVAL DAY TO SECOND

// after
col 'duration_millis' BIGINT
Defensive patterns

Strategy: validation

Validate before calling

for (Column col : resolvedSchema.getColumns()) {
  if (col.getDataType().getLogicalType() instanceof DayTimeIntervalType) {
    throw new IllegalArgumentException("Column '" + col.getName() + "' uses INTERVAL DAY TO SECOND; use BIGINT millis");
  }
}

Try / catch

try {
  Schema s = FlinkSchemaUtil.toIcebergSchema(flinkSchema);
} catch (UnsupportedOperationException e) {
  if (e.getMessage().contains("DayTimeIntervalType")) {
    // replace interval columns with BIGINT durations
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Converting a Flink schema containing a column of type INTERVAL DAY TO SECOND (or other DayTimeIntervalType variants) to an Iceberg schema via FlinkTypeVisitor dispatch.

Common situations: Event-latency or processing-duration columns typed as INTERVAL in Flink; schemas migrated from engines that support day-time intervals.

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

Appendix: source

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

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
  public T visit(StructuredType structuredType) {
    throw new UnsupportedOperationException("Unsupported StructuredType.");
  }

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

  @Override

View on GitHub (pinned to 86d9c8fc54)