{"record":{"id":"6fc55b8b0eebe457","repo":"apache/iceberg","slug":"unsupported-structuredtype-6fc55b","errorCode":null,"errorMessage":"Unsupported StructuredType.","messagePattern":"Unsupported StructuredType\\.","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":58,"sourceCode":"\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\n  public T visit(SymbolType<?> symbolType) {\n    throw new UnsupportedOperationException(\"Unsupported SymbolType.\");\n  }\n\n  @Override","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java#L40-L76","documentation":"FlinkTypeVisitor throws UnsupportedOperationException for StructuredType, Flink's user-defined structured (record-like) type. Iceberg can only represent its own struct types built from named fields, so a Flink StructuredType column cannot be converted by the default visitor.","triggerScenarios":"Schema conversion hitting a column whose LogicalType is a StructuredType (user-defined structured type), e.g. columns registered from UDTs or object types, dispatching to visit(StructuredType).","commonSituations":"Using user-defined structured types or ROW-derived catalog object types in Flink tables stored in Iceberg; connectors that surface UDT columns as StructuredType.","solutions":["Use Flink ROW<...> type instead of a user-defined StructuredType for nested records.","Flatten the structured column into scalar columns.","Cast the column to ROW<...> before conversion.","Subclass FlinkTypeVisitor and override visit(StructuredType) to map fields to Iceberg StructType manually."],"exampleFix":"// before\ncol 'addr' MyStructuredType  -- user-defined structured type\n\n// after\ncol 'addr' ROW<street STRING, city STRING>","handlingStrategy":"validation","validationCode":"for (Column col : resolvedSchema.getColumns()) {\n  if (col.getDataType().getLogicalType() instanceof StructuredType) {\n    throw new IllegalArgumentException(\"Column '\" + col.getName() + \"' uses a StructuredType; use ROW<...> instead\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  Schema s = FlinkSchemaUtil.toIcebergSchema(flinkSchema);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"StructuredType\")) {\n    // convert structured columns to ROW types\n  } else {\n    throw e;\n  }\n}","preventionTips":["Use ROW<...> for nested records instead of user-defined structured types.","Flatten UDT columns into scalar columns.","Pre-validate schemas before conversion."],"tags":["flink","type-mapping","struct","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"}