{"record":{"id":"f08c68918e892b3a","repo":"apache/iceberg","slug":"unsupported-type-s","errorCode":null,"errorMessage":"Unsupported type: %s","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java","lineNumber":78,"sourceCode":"\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\n  public T visit(LogicalType other) {\n    throw new UnsupportedOperationException(\"Unsupported type: \" + other);\n  }\n}\n","sourceCodeStart":60,"sourceCodeEnd":81,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java#L60-L81","documentation":"This is the fallback branch of FlinkTypeVisitor for any Flink LogicalType not matched by a specific visit method. Since the visitor cannot map the type to an Iceberg type, it throws UnsupportedOperationException with the type's toString in the message, signaling that Iceberg's Flink integration does not know this logical type at all.","triggerScenarios":"Calling any FlinkTypeVisitor-based conversion with a row type containing a logical type outside the visitor's supported set, or a newer Flink version introducing types Iceberg has not mapped yet (the visitor already covers ZonedTimestamp, interval types, Distinct/Structured/Null/Raw/Symbol; anything else lands here).","commonSituations":"Upgrading Flink so new logical types appear in inferred schemas; custom LogicalType implementations from third-party connectors; passing an exotic connector type through an Iceberg sink; directly misusing the visitor API.","solutions":["Read the type name in the message and cast the column to a supported type (INT, BIGINT, STRING, TIMESTAMP, ROW, etc.) before conversion.","Pin a Flink version matching your iceberg-flink runtime (e.g. flink/v1.20 module with Flink 1.20).","Upgrade iceberg-flink-runtime to a version that maps the missing type, if one exists.","If you own the visitor subclass, override visit(LogicalType other) to add a custom mapping for the new type."],"exampleFix":"// before\nINSERT INTO iceberg_t SELECT exotic_col FROM src; // unknown LogicalType\n// after\nINSERT INTO iceberg_t SELECT CAST(exotic_col AS STRING) AS exotic_col FROM src;","handlingStrategy":"validation","validationCode":"import org.apache.flink.table.types.logical.LogicalType;\nimport org.apache.flink.table.api.Schema;\n\nstatic void validateIcebergCompatible(Schema schema) {\n  schema.getColumns().forEach(c -> {\n    LogicalType t = c.getType().getLogicalType();\n    if (t instanceof org.apache.flink.table.types.logical.TimestampType\n        && ((org.apache.flink.table.types.logical.TimestampType) t).getPrecision() > 6) {\n      throw new IllegalArgumentException(\"Timestamp precision > 6 unsupported by Iceberg: \" + t);\n    }\n    if (t instanceof org.apache.flink.table.types.logical.ZonedTimestampType) {\n      throw new IllegalArgumentException(\"ZonedTimestampType unsupported: \" + t);\n    }\n  });\n}","typeGuard":"static boolean isKnownUnsupported(LogicalType t) {\n  return t instanceof org.apache.flink.table.types.logical.ZonedTimestampType\n      || t instanceof org.apache.flink.table.types.logical.YearMonthIntervalType\n      || t instanceof org.apache.flink.table.types.logical.DayTimeIntervalType\n      || t instanceof org.apache.flink.table.types.logical.DistinctType\n      || t instanceof org.apache.flink.table.types.logical.StructuredType\n      || t instanceof org.apache.flink.table.types.logical.NullType\n      || t instanceof org.apache.flink.table.types.logical.RawType\n      || t instanceof org.apache.flink.table.types.logical.SymbolType;\n}","tryCatchPattern":"try {\n  icebergSchema = FlinkSchemaUtil.convert(flinkSchema);\n} catch (UnsupportedOperationException e) {\n  LOG.error(\"Iceberg cannot convert Flink type: {}\", e.getMessage());\n  throw new IllegalStateException(\"Fix the schema before enabling the Iceberg sink\", e);\n}","preventionTips":["Keep iceberg-flink-runtime and Flink versions matched (e.g. flink/v1.20 module with Flink 1.20).","Consult the Iceberg-Flink type mapping docs before designing sink schemas.","Cast or project out exotic columns before the Iceberg sink.","Test schema conversion in CI for every pipeline feeding Iceberg."],"tags":["flink","iceberg","unsupported-type","type-conversion","fallback"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}