{"record":{"id":"9cb1eccbda397414","repo":"apache/iceberg","slug":"unsupported-rawtype","errorCode":null,"errorMessage":"Unsupported RawType.","messagePattern":"Unsupported RawType\\.","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":68,"sourceCode":"\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\n  public T visit(LogicalType other) {\n    throw new UnsupportedOperationException(\"Unsupported type: \" + other);\n  }\n}\n","sourceCodeStart":50,"sourceCodeEnd":81,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java#L50-L81","documentation":"Flink RawType wraps arbitrary Java/Scala objects serialized via a configured serializer class. Iceberg cannot represent opaque serialized objects, so FlinkTypeVisitor throws UnsupportedOperationException when a conversion visitor encounters RawType.","triggerScenarios":"Converting a row type containing a RawType column (created via DataTypes.RAW(...) or produced by UDFs returning non-representable Java objects) during Iceberg sink schema resolution or FlinkCatalog table operations.","commonSituations":"Passing custom POJOs or opaque objects (geospatial, ML vectors) through a Flink pipeline into an Iceberg sink; RAW columns from a source connector; UDTs bridged with RAW instead of proper ROW types.","solutions":["Replace the RAW column with a structured ROW type or scalar types Iceberg supports.","Serialize the object yourself into a supported format (JSON STRING or BINARY) before the sink and deserialize at read time.","Remove the RAW column from the data written to Iceberg.","Override visit(RawType) in a custom FlinkTypeVisitor subclass (e.g. map RawType<byte[]> to BinaryType)."],"exampleFix":"// before\nDataTypes.RAW(SomeObject.class)\n// after\nDataTypes.STRING() // store JSON: my_object.toJson()\n// or\nDataTypes.BYTES() // store serialized bytes","handlingStrategy":"validation","validationCode":"import org.apache.flink.table.types.logical.LogicalType;\nimport org.apache.flink.table.types.logical.RawType;\n\nstatic boolean containsRawType(org.apache.flink.table.api.Schema schema) {\n  return schema.getColumns().stream()\n      .anyMatch(c -> c.getType().getLogicalType() instanceof RawType);\n}","typeGuard":"static boolean isRawType(LogicalType t) {\n  return t instanceof RawType;\n}","tryCatchPattern":null,"preventionTips":["Avoid DataTypes.RAW in schemas feeding Iceberg; use ROW or scalar types.","Serialize opaque objects to JSON STRING or BINARY before writing.","Keep UDF outputs limited to Iceberg-mappable types.","List supported Flink-to-Iceberg types in team schema guidelines."],"tags":["flink","iceberg","unsupported-type","raw-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-14T16:17:12.679Z"}