{"record":{"id":"cac0bd8bc5938830","repo":"apache/iceberg","slug":"unsupported-rawtype-cac0bd","errorCode":null,"errorMessage":"Unsupported RawType.","messagePattern":"Unsupported RawType\\.","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":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/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java#L50-L81","documentation":"FlinkTypeVisitor throws UnsupportedOperationException for RawType, Flink's RAW type for arbitrary serialized objects with a type serializer. Iceberg has no opaque raw-object type, so conversion is rejected.","triggerScenarios":"Schema conversion encountering a RAW('class', 'serializer') column, dispatching to visit(RawType).","commonSituations":"Passing Java/Scala objects through Flink pipelines using RAW columns; user-defined aggregations or state carried as RAW columns in Iceberg-backed tables.","solutions":["Convert the object to a serializable representation: Iceberg-compatible struct, string (e.g. JSON), or bytes.","Declare the column as VARBINARY/BYTES or STRING and serialize the object explicitly.","Keep RAW objects out of the table schema; store them in Flink state instead.","Subclass FlinkTypeVisitor and override visit(RawType) with a custom mapping."],"exampleFix":"// before\ncol 'payload' RAW('com.example.Payload', 'com.example.PayloadSerializer')\n\n// after\ncol 'payload' BYTES  -- serialize explicitly before writing","handlingStrategy":"validation","validationCode":"for (Column col : resolvedSchema.getColumns()) {\n  if (col.getDataType().getLogicalType() instanceof RawType) {\n    throw new IllegalArgumentException(\"Column '\" + col.getName() + \"' is RAW; use BYTES or STRING with explicit serialization\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  Schema s = FlinkSchemaUtil.toIcebergSchema(flinkSchema);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"RawType\")) {\n    // serialize objects to BYTES/STRING before persisting\n  } else {\n    throw e;\n  }\n}","preventionTips":["Do not persist RAW-typed objects in table schemas; serialize to BYTES/STRING.","Keep raw objects in Flink state, not Iceberg tables.","Pre-validate schemas before conversion."],"tags":["flink","type-mapping","raw-type","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"}