{"record":{"id":"5a401855a8884967","repo":"apache/iceberg","slug":"unsupported-type-s-5a4018","errorCode":null,"errorMessage":"Unsupported type: %s","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java","lineNumber":213,"sourceCode":"        }\n      }\n\n      switch (primitive.getPrimitiveTypeName()) {\n        case FIXED_LEN_BYTE_ARRAY:\n        case BINARY:\n          return byteArrays(desc);\n        case BOOLEAN:\n          return ParquetValueWriters.booleans(desc);\n        case INT32:\n          return ints(fType, desc);\n        case INT64:\n          return ParquetValueWriters.longs(desc);\n        case FLOAT:\n          return ParquetValueWriters.floats(desc);\n        case DOUBLE:\n          return ParquetValueWriters.doubles(desc);\n        default:\n          throw new UnsupportedOperationException(\"Unsupported type: \" + primitive);\n      }\n    }\n  }\n\n  private static class LogicalTypeWriterBuilder\n      implements LogicalTypeAnnotationVisitor<ParquetValueWriter<?>> {\n    private final LogicalType flinkType;\n    private final ColumnDescriptor desc;\n\n    private LogicalTypeWriterBuilder(LogicalType flinkType, ColumnDescriptor desc) {\n      this.flinkType = flinkType;\n      this.desc = desc;\n    }\n\n    @Override\n    public Optional<ParquetValueWriter<?>> visit(StringLogicalTypeAnnotation strings) {\n      return Optional.of(strings(desc));\n    }","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java#L195-L231","documentation":"FlinkParquetWriters.primitive() throws UnsupportedOperationException 'Unsupported type: <primitive>' when the Parquet physical primitive type has no writer branch in the final switch — the physical type cannot be mapped to a ParquetValueWriter for the expected Flink/Iceberg value.","triggerScenarios":"Writing Parquet where a column's physical type (per the message-writer mapping, e.g. unexpected FIXED_LEN_BYTE_ARRAY usage or missing mapping) isn't one of the supported branches (BOOLEAN, INT32, INT64, FLOAT, DOUBLE, BINARY, etc.).","commonSituations":"Mismatch between the message/parquet type mapping and the actual primitive; unsupported physical encodings introduced by custom writers.","solutions":["Identify the physical type from the message and retype the column to a supported type.","Use another file format (ORC/Avro) if the type mapping exists there.","Upgrade iceberg-flink to a version with broader physical type support.","Adjust the write pipeline so the parquet physical type matches the Iceberg type mapping."],"exampleFix":"// before\n// physical type unsupported by Flink writer switch\n// after\n// map column to BINARY/STRING standard physical type or switch format","handlingStrategy":"validation","validationCode":"schema.columns().forEach(c -> {\n  Type.TypeID id = c.type().typeId();\n  Preconditions.checkArgument(id != Type.TypeID.UNKNOWN,\n      \"Type %s has no supported Parquet physical mapping\", c.type());\n});","typeGuard":"boolean parquetWritable(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  if (e.getMessage().startsWith(\"Unsupported type\")) {\n    LOG.error(\"Parquet writer cannot handle physical type: {}\", e.getMessage());\n  }\n  throw e;\n}","preventionTips":["Use standard file formats for standard types; switch format if a type is unsupported.","Validate schema types against writer support before job launch.","Keep iceberg-flink and parquet-columnar versions aligned."],"tags":["flink","parquet","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"}