{"record":{"id":"7f4a20657b018b0f","repo":"apache/iceberg","slug":"unsupported-daytimeintervaltype-7f4a20","errorCode":null,"errorMessage":"Unsupported DayTimeIntervalType.","messagePattern":"Unsupported DayTimeIntervalType\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/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.2/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java#L30-L66","documentation":"FlinkTypeVisitor.visit(DayTimeIntervalType) throws UnsupportedOperationException because Iceberg cannot represent Flink's INTERVAL DAY TO SECOND type. Flink-to-Iceberg type conversion fails fast rather than silently losing precision.","triggerScenarios":"Converting a Flink schema containing `INTERVAL DAY TO SECOND` columns (e.g. from computed time differences) to Iceberg types.","commonSituations":"ETL jobs computing durations between timestamps and carrying the INTERVAL result column into an Iceberg sink table.","solutions":["Convert the interval to milliseconds/seconds as BIGINT before writing.","Change the DDL column to BIGINT or STRING instead of INTERVAL DAY TO SECOND.","Override visit(DayTimeIntervalType) with a custom mapping in a project-specific visitor."],"exampleFix":"// before\nCREATE TABLE t (dur INTERVAL DAY TO SECOND);\n// after\nCREATE TABLE t (dur_millis BIGINT);","handlingStrategy":"type-guard","validationCode":"if (dataType.getLogicalType() instanceof DayTimeIntervalType) {\n  throw new IllegalArgumentException(\"Convert INTERVAL DAY TO SECOND to BIGINT millis before Iceberg write\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compute durations as BIGINT millis/seconds instead of INTERVAL columns.","Avoid carrying TIMESTAMP subtraction results (INTERVAL) directly into sinks."],"tags":["flink","type-mapping","interval"],"backgroundTag":"incompatible-source-type","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"}