{"record":{"id":"1f0558f3c1423210","repo":"apache/iceberg","slug":"unsupported-type-primitive-1f0558","errorCode":null,"errorMessage":"Unsupported type: ${primitive}","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkAvroWriter.java","lineNumber":169,"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":151,"sourceCodeEnd":174,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkAvroWriter.java#L151-L174","documentation":"FlinkAvroWriter maps Iceberg primitive types to Avro ValueWriters. When the primitive's type falls into no supported case, the method throws IllegalArgumentException 'Unsupported type'. The write path only handles a fixed set of Iceberg primitives.","triggerScenarios":"Writing Avro files for a table schema containing a primitive the Avro writer does not implement (e.g. newer/unknown Iceberg primitives).","commonSituations":"Schema written by a newer Iceberg version than the Flink integration in use; tables containing exotic types pushed through the Avro path; module version skew between iceberg-core and iceberg-flink.","solutions":["Align the iceberg-flink version with the iceberg-core version that produced the schema","Check the table schema and replace unsupported types with supported equivalents","Extend the switch in FlinkAvroWriter if the type must be written"],"exampleFix":"// before\nTypes.TimestampNanoPrecision in schema -> FlinkAvroWriter throws\n// after\nUse timestamp(6) in schema, or upgrade iceberg-flink to a version supporting nanos","handlingStrategy":"validation","validationCode":"schema.columns().forEach(f -> checkTypeSupported(f.type()));","typeGuard":null,"tryCatchPattern":"try { write(table); } catch (IllegalArgumentException e) { LOG.error(\"Unsupported Iceberg type for Avro write: {}\", e.getMessage()); throw e; }","preventionTips":["Align iceberg-flink with iceberg-core versions","Validate schema types at job startup","Prefer Parquet/ORC formats when using newer types"],"tags":["flink","avro","type-conversion"],"backgroundTag":"unsupported-enum-value","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"}