{"record":{"id":"917aacbeae32555a","repo":"apache/iceberg","slug":"unsupported-distincttype-917aac","errorCode":null,"errorMessage":"Unsupported DistinctType.","messagePattern":"Unsupported DistinctType\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/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.2/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java#L35-L71","documentation":"FlinkTypeVisitor.visit(DistinctType) throws UnsupportedOperationException because Iceberg has no notion of Flink's user-defined DISTINCT structured types. Schema conversion rejects them rather than guessing a base type.","triggerScenarios":"Converting a Flink schema/catalog type graph containing a user-declared CREATE DISTINCT TYPE when mapping to Iceberg types.","commonSituations":"Rare; encountered when DDLs ported from catalogs with UDT support (or Spark/Hive-style distinct types) are used with Iceberg Flink tables.","solutions":["Flatten the distinct type to its underlying built-in type in the DDL.","Replace the distinct type with the raw physical type (e.g. VARCHAR, INT) before conversion.","Customize the visitor to unwrap distinct types to their source type if acceptable."],"exampleFix":"// before\nCREATE DISTINCT TYPE user_id AS INT;\ncolumn user_id;\n// after\ncolumn INT user_id;","handlingStrategy":"type-guard","validationCode":"if (dataType.getLogicalType() instanceof DistinctType) {\n  throw new IllegalArgumentException(\"Flatten DISTINCT types to base types for Iceberg\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid user-defined DISTINCT types in Iceberg-bound table schemas.","Use built-in types directly in DDL."],"tags":["flink","type-mapping","udt"],"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"}