{"record":{"id":"aa76cd1eb042d6d5","repo":"apache/iceberg","slug":"unsupported-type-s-aa76cd","errorCode":null,"errorMessage":"Unsupported type: %s","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/data/FlinkAvroWriter.java","lineNumber":175,"sourceCode":"            case SMALLINT:\n              return ValueWriters.shorts();\n            default:\n              return ValueWriters.ints();\n          }\n        case LONG:\n          return ValueWriters.longs();\n        case FLOAT:\n          return ValueWriters.floats();\n        case DOUBLE:\n          return ValueWriters.doubles();\n        case STRING:\n          return FlinkValueWriters.strings();\n        case FIXED:\n          return ValueWriters.fixed(primitive.getFixedSize());\n        case BYTES:\n          return ValueWriters.bytes();\n        default:\n          throw new IllegalArgumentException(\"Unsupported type: \" + primitive);\n      }\n    }\n  }\n}\n","sourceCodeStart":157,"sourceCodeEnd":180,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/data/FlinkAvroWriter.java#L157-L180","documentation":"FlinkAvroWriter.primitive() throws UnsupportedOperationException 'Unsupported type: <primitive>' when the Iceberg primitive type's Avro representation has no writer branch in the switch. This is a terminal catch-all meaning the Iceberg type -> Avro writer mapping cannot handle this primitive (e.g. unexpected Avro schema/type combination produced for the Iceberg type).","triggerScenarios":"Building an Avro ValueWriter for an Iceberg primitive whose resolved Avro primitive type is not one of the handled cases (NULL, BOOLEAN, INT, LONG, FLOAT, DOUBLE, STRING, FIXED, BYTES, decimal/uuid logicals).","commonSituations":"Writing tables with exotic or newly added Iceberg primitive types via the Flink Avro writer; internal type resolution producing unexpected Avro types.","solutions":["Check the table schema for the offending primitive type from the message.","Upgrade iceberg-flink to a version supporting the type.","Avoid writing the type through the Flink Avro path (e.g. use Parquet/ORC file format via table write.format.default).","Reproject/drop the unsupported column before rewriting data files."],"exampleFix":"// before\nwrite.format.default=avro  // column type unsupported by Avro writer\n// after\nALTER TABLE t SET TBLPROPERTIES ('write.format.default'='parquet');","handlingStrategy":"validation","validationCode":"schema.asStruct().fields().forEach(f -> {\n  Preconditions.checkArgument(supportedTypeIds.contains(f.type().typeId()),\n      \"Type %s not supported by Flink Avro writer\", f.type());\n});","typeGuard":"boolean avroWritable(Type.TypeID id) {\n  switch (id) {\n    case BOOLEAN: case INTEGER: case LONG: case FLOAT: case DOUBLE:\n    case STRING: case BINARY: case FIXED: case DATE:\n    case TIMESTAMP: case DECIMAL:\n      return true;\n    default:\n      return false;\n  }\n}","tryCatchPattern":"try {\n  writer.write(row);\n} catch (UnsupportedOperationException e) {\n  LOG.error(\"Avro writer cannot handle: {}\", e.getMessage());\n  throw e;\n}","preventionTips":["Use write.format.default=parquet for uncommon types.","Validate table schema against supported Avro types before writing.","Keep iceberg-flink up to date."],"tags":["flink","avro","writer","unsupported-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"}