{"record":{"id":"d7cfc135e6a5c5a2","repo":"apache/iceberg","slug":"unsupported-type-d7cfc1","errorCode":null,"errorMessage":"Unsupported type: ","messagePattern":"Unsupported type: ","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/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.3/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java#L195-L231","documentation":"The same primitive(...) factory in FlinkParquetWriters falls back to a switch on the Parquet physical type (for columns without a handled annotation). Only the supported physical types get writers; any other physical type reaches the default branch and throws UnsupportedOperationException naming the primitive.","triggerScenarios":"Creating a Parquet value writer for a column whose unannotated primitive type is not in the supported set (e.g. INT96, or another physical type the builder does not map).","commonSituations":"Writing into a schema derived from legacy files with INT96 timestamps; programmatic schema construction using unusual Parquet physical types; engine-written schemas with types Iceberg's Flink writer does not handle.","solutions":["Change the write schema to a supported physical type (INT32/INT64/FLOAT/DOUBLE/FIXED_LEN_BYTE_ARRAY/BINARY as appropriate).","For timestamps, use INT64 with TIMESTAMP logical annotation instead of INT96.","Add a mapping case in the switch if a new physical type needs support, and upstream the change."],"exampleFix":"// before\n// Column: ts INT96\n// after\n// Column: ts INT64 (TIMESTAMP(MICROS)) via TimestampType in the Iceberg schema","handlingStrategy":"validation","validationCode":"// java\nSet<PrimitiveTypeName> ok = EnumSet.of(INT32, INT64, FLOAT, DOUBLE, BOOLEAN, BINARY, FIXED_LEN_BYTE_ARRAY);\nif (!ok.contains(primitive.getPrimitiveTypeName())) {\n  throw new IllegalArgumentException(\"Unsupported physical type: \" + primitive.getPrimitiveTypeName());\n}","typeGuard":null,"tryCatchPattern":"// java\ntry {\n  ParquetValueWriter<?> w = FlinkParquetWriters.createWriter(...);\n} catch (UnsupportedOperationException e) {\n  // reject schema or remap the column before writing\n}","preventionTips":["Never write INT96 columns; always use INT64 with a timestamp annotation.","Derive the Parquet write schema from the Iceberg schema, not from input files.","Validate all physical types during schema planning, not at write time."],"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"}