{"record":{"id":"2eebf82db8f3bc96","repo":"apache/iceberg","slug":"unsupported-logical-type-s-2eebf8","errorCode":null,"errorMessage":"Unsupported logical type: %s","messagePattern":"Unsupported logical 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":193,"sourceCode":"    }\n\n    private ParquetValueWriter<?> newOption(Type fieldType, ParquetValueWriter<?> writer) {\n      int maxD = type.getMaxDefinitionLevel(path(fieldType.getName()));\n      return ParquetValueWriters.option(fieldType, maxD, writer);\n    }\n\n    @Override\n    public ParquetValueWriter<?> primitive(LogicalType fType, PrimitiveType primitive) {\n      ColumnDescriptor desc = type.getColumnDescription(currentPath());\n\n      LogicalTypeAnnotation annotation = primitive.getLogicalTypeAnnotation();\n      if (annotation != null) {\n        Optional<ParquetValueWriter<?>> writer =\n            annotation.accept(new LogicalTypeWriterBuilder(fType, desc));\n        if (writer.isPresent()) {\n          return writer.get();\n        } else {\n          throw new UnsupportedOperationException(\n              \"Unsupported logical type: \" + primitive.getOriginalType());\n        }\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);","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java#L175-L211","documentation":"FlinkParquetWriters.primitive() throws UnsupportedOperationException 'Unsupported logical type: <originalType>' when a Parquet column carries a logical type annotation (OriginalType) that LogicalTypeWriterBuilder explicitly rejects (visitor returned empty), e.g. an unusual annotation like MAP keys or interval types not supported by the Flink writer.","triggerScenarios":"Writing Parquet files where a primitive's Parquet logical type annotation is not accepted by the LogicalTypeWriterBuilder visitor (annotation present but no writer produced).","commonSituations":"Columns with exotic parquet annotations (e.g. ENUM, JSON, INTERVAL) mapped from Iceberg types; version drift between parquet-columnar and iceberg-flink.","solutions":["Check the annotation in the message and retype the column to a supported Iceberg type (e.g. string instead of enum/json annotation).","Write with a different file format (ORC/Avro) that handles the type.","Upgrade iceberg-flink for potentially broader annotation support.","Transform the data pipeline to drop/convert the unsupported column."],"exampleFix":"// before\nTypes.NestedField.of(1, false, \"status\", Types.StringType.get()) // mapped with ENUM annotation\n// after\n// ensure the parquet type carries no unsupported annotation (plain STRING)","handlingStrategy":"validation","validationCode":"// ensure columns map to supported parquet logical annotations\nschema.columns().forEach(c -> {\n  if (c.type() instanceof Types.StringType || c.type() instanceof Types.BinaryType) {\n    // plain STRING / BINARY annotations are supported; avoid ENUM/JSON/INTERVAL\n  }\n});","typeGuard":null,"tryCatchPattern":"try {\n  writer.write(row);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"Unsupported logical type\")) {\n    throw new IllegalStateException(\"Retype column or switch format: \" + e.getMessage());\n  }\n  throw e;\n}","preventionTips":["Keep column types as plain Iceberg strings/bytes rather than annotated types.","Prefer parquet for standard types; use ORC/Avro for exotic ones.","Confirm LogicalTypeVisitor support before adopting new annotation types."],"tags":["flink","parquet","writer","unsupported-logical-type"],"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"}