{"record":{"id":"9811578ac7b3c7de","repo":"apache/iceberg","slug":"unsupported-type-primitive-981157","errorCode":null,"errorMessage":"Unsupported type: ${primitive}","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java","lineNumber":191,"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":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java#L173-L209","documentation":"In FlinkParquetWriters.primitive(), when a primitive column has no logical type annotation, the code switches on the Parquet physical primitive type; unknown types fall to this default and throw UnsupportedOperationException. It means the physical Parquet type is not one of the supported mappings (boolean, int, long, float, double, etc.).","triggerScenarios":"Encountering a Parquet primitive of a physical type with no case in the switch, e.g. FIXED_LEN_BYTE_ARRAY without a logical annotation, or newer physical types from files written by other engines.","commonSituations":"Parquet files produced by external systems using fixed_len_byte_array without a decimal/uuid annotation; corrupted or hand-crafted schemas; using an older Iceberg build that lacks a mapping for a newer type.","solutions":["Inspect the Parquet schema (parquet-tools/schema) and add or rely on a logical type annotation for FIXED_LEN_BYTE_ARRAY columns (decimal or uuid).","Rewrite the source data so all unannotated columns use supported physical types (boolean, int32, int64, float, double, binary).","Upgrade Iceberg to a version whose FlinkParquetWriters covers the physical type in question.","Exclude or transform the offending column in the Flink pipeline before writing."],"exampleFix":"// before: parquet schema has `required fixed_len_byte_array(16) id;` with no annotation\n// after: writer adds a logical annotation so a writer can be produced\n// Schema: required fixed_len_byte_array(16) id (UUID)\n// or cast the column to binary/string in the upstream pipeline","handlingStrategy":"validation","validationCode":"PrimitiveType p = desc.getPrimitiveType();\nSet<PrimitiveTypeName> supported = Set.of(BOOLEAN, INT32, INT64, FLOAT, DOUBLE, BINARY, FIXED_LEN_BYTE_ARRAY);\nif (!supported.contains(p.getPrimitiveTypeName())) throw new IllegalArgumentException(\"unsupported \" + p);","typeGuard":null,"tryCatchPattern":"try {\n  reader = FlinkParquetReaders.readBuilder(schema, projectedSchema).build();\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"Unsupported type:\")) {\n    // fall back to a generic engine or transform the column\n  }\n}","preventionTips":["Require logical annotations on fixed_len_byte_array columns when producing files","Rewrite externally-produced Parquet through Iceberg before Flink processing","Upgrade Iceberg when consuming files from newer writers"],"tags":["flink","parquet","unsupported-type"],"backgroundTag":"incompatible-source-type","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"}