{"record":{"id":"3fe266736d1feec0","repo":"apache/iceberg","slug":"unsupported-daytimeintervaltype-3fe266","errorCode":null,"errorMessage":"Unsupported DayTimeIntervalType.","messagePattern":"Unsupported DayTimeIntervalType\\.","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java","lineNumber":48,"sourceCode":"import org.apache.flink.table.types.logical.ZonedTimestampType;\n\npublic abstract class FlinkTypeVisitor<T> implements LogicalTypeVisitor<T> {\n\n  // ------------------------- Unsupported types ------------------------------\n\n  @Override\n  public T visit(ZonedTimestampType zonedTimestampType) {\n    throw new UnsupportedOperationException(\"Unsupported ZonedTimestampType.\");\n  }\n\n  @Override\n  public T visit(YearMonthIntervalType yearMonthIntervalType) {\n    throw new UnsupportedOperationException(\"Unsupported YearMonthIntervalType.\");\n  }\n\n  @Override\n  public T visit(DayTimeIntervalType dayTimeIntervalType) {\n    throw new UnsupportedOperationException(\"Unsupported DayTimeIntervalType.\");\n  }\n\n  @Override\n  public T visit(DistinctType distinctType) {\n    throw new UnsupportedOperationException(\"Unsupported DistinctType.\");\n  }\n\n  @Override\n  public T visit(StructuredType structuredType) {\n    throw new UnsupportedOperationException(\"Unsupported StructuredType.\");\n  }\n\n  @Override\n  public T visit(NullType nullType) {\n    throw new UnsupportedOperationException(\"Unsupported NullType.\");\n  }\n\n  @Override","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java#L30-L66","documentation":"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.","triggerScenarios":"Converting a Flink schema containing a column of type INTERVAL DAY TO SECOND (or other DayTimeIntervalType variants) to an Iceberg schema via FlinkTypeVisitor dispatch.","commonSituations":"Event-latency or processing-duration columns typed as INTERVAL in Flink; schemas migrated from engines that support day-time intervals.","solutions":["Replace the interval column with BIGINT (e.g. milliseconds) or a numeric type.","Cast the interval to its numeric epoch representation before schema conversion.","Subclass FlinkTypeVisitor and override visit(DayTimeIntervalType) with a custom mapping.","Use a TIMESTAMP duration pair (start/end) if the interval is derived from two events."],"exampleFix":"// before\ncol 'duration' INTERVAL DAY TO SECOND\n\n// after\ncol 'duration_millis' BIGINT","handlingStrategy":"validation","validationCode":"for (Column col : resolvedSchema.getColumns()) {\n  if (col.getDataType().getLogicalType() instanceof DayTimeIntervalType) {\n    throw new IllegalArgumentException(\"Column '\" + col.getName() + \"' uses INTERVAL DAY TO SECOND; use BIGINT millis\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  Schema s = FlinkSchemaUtil.toIcebergSchema(flinkSchema);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"DayTimeIntervalType\")) {\n    // replace interval columns with BIGINT durations\n  } else {\n    throw e;\n  }\n}","preventionTips":["Represent durations as BIGINT (ms) or paired timestamps, not INTERVAL.","Pre-validate schemas before schema conversion.","Cast intervals to numeric types at pipeline boundaries."],"tags":["flink","type-mapping","interval","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}