{"record":{"id":"6d3050a6cb0675a5","repo":"apache/iceberg","slug":"unsupported-distincttype-6d3050","errorCode":null,"errorMessage":"Unsupported DistinctType.","messagePattern":"Unsupported DistinctType\\.","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java","lineNumber":53,"sourceCode":"\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\n  public T visit(RawType<?> rawType) {\n    throw new UnsupportedOperationException(\"Unsupported RawType.\");\n  }\n\n  @Override","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java#L35-L71","documentation":"FlinkTypeVisitor is the Iceberg-Flink type conversion visitor; every visit method must be implemented, but Flink's DayTimeIntervalType and other exotic logical types have no Iceberg equivalent, so the visitor refuses them. This means the table schema being converted to Iceberg contains a logical type Iceberg cannot represent.","triggerScenarios":"Calling FlinkSchemaUtil.convert() or FlinkTypeConverter.toIcebergType() on a Flink RowType/schema containing a DayTimeIntervalType (INTERVAL DAY TO SECOND) column, e.g. from a source table defined with INTERVAL type columns.","commonSituations":"Users syncing a Flink SQL table with INTERVAL columns into Iceberg; CDC pipelines ingesting source schemas that include duration types; older Iceberg versions that predate DurationType support in the Iceberg schema.","solutions":["Replace INTERVAL columns in the Flink schema with a supported type such as BIGINT (millis) or TIMESTAMP before converting to Iceberg","Upgrade to an Iceberg version whose FlinkTypeVisitor maps DayTimeIntervalType to Types.DurationType if available","Filter or cast unsupported columns out of the RowType passed to the converter"],"exampleFix":"// before\nCREATE TABLE src (d INTERVAL DAY TO SECOND) -- converted -> throws\n// after\nCREATE TABLE src (d BIGINT) -- store interval as millis, then convert","handlingStrategy":"validation","validationCode":"boolean hasInterval(RowType rowType) {\n  return rowType.getFields().stream()\n    .anyMatch(f -> f.getType() instanceof DayTimeIntervalType);\n}\n// throw a clear error or cast columns before calling FlinkSchemaUtil.convert","typeGuard":"boolean isSupported(LogicalType t) {\n  return !(t instanceof DayTimeIntervalType);\n}","tryCatchPattern":null,"preventionTips":["Avoid INTERVAL columns in tables destined for Iceberg sinks","Cast intervals to BIGINT/TIMESTAMP early in the pipeline","Pin a Flink/Iceberg version combination whose visitor supports your types"],"tags":["flink","type-conversion","unsupported-type"],"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"}