{"record":{"id":"e7725285f319dcac","repo":"apache/iceberg","slug":"unsupported-type-s-e77252","errorCode":null,"errorMessage":"Unsupported type: %s","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/data/parquet/BaseParquetWriter.java","lineNumber":160,"sourceCode":"      }\n\n      switch (primitive.getPrimitiveTypeName()) {\n        case FIXED_LEN_BYTE_ARRAY:\n          return fixedWriter(desc);\n        case BINARY:\n          return ParquetValueWriters.byteBuffers(desc);\n        case BOOLEAN:\n          return ParquetValueWriters.booleans(desc);\n        case INT32:\n          return ParquetValueWriters.ints(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    @Override\n    public ParquetValueWriter<?> variant(\n        Types.VariantType iVariant, GroupType variant, ParquetValueWriter<?> result) {\n      return result;\n    }\n\n    @Override\n    public ParquetVariantVisitor<ParquetValueWriter<?>> variantVisitor() {\n      return new VariantWriterBuilder(type, Arrays.asList(currentPath()));\n    }\n  }\n\n  private class LogicalTypeWriterVisitor\n      implements LogicalTypeAnnotation.LogicalTypeAnnotationVisitor<ParquetValueWriter<?>> {\n    private final ColumnDescriptor desc;","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/data/parquet/BaseParquetWriter.java#L142-L178","documentation":"BaseParquetWriters' primitive() maps Iceberg primitive types to Parquet value writers and throws UnsupportedOperationException for primitives it cannot write. It indicates the writer has no serialization path for the requested Parquet primitive.","triggerScenarios":"Writing (GenericParquetWriter / Spark writers built on BaseParquetWriters) a column whose resolved primitive type falls into the default branch of the switch — a primitive type with no registered writer.","commonSituations":"New Iceberg types (e.g. geometry/geography/unknown) written with a writer version lacking support; custom schemas with exotic primitives; using generic writers where engine-specific writers are required.","solutions":["Upgrade Iceberg to a version with writer support for that primitive type.","Remove or convert the unsupported column before writing (e.g. cast/serialize as string/binary).","Route the write through the appropriate writer implementation for your engine if the generic writer lacks the type."],"exampleFix":"// before\nGenericParquetWriter.write(fileSchema, schema, ...); // throws for unknown primitive\n// after: drop/cast unsupported column\nschema = new Schema(schema.columns().stream().filter(f -> f.type().typeId() != TypeID.UNKNOWN).toList());","handlingStrategy":"validation","validationCode":"// Reject unsupported primitives before writing\nfor (Types.NestedField f : schema.columns()) {\n  switch (f.type().typeId()) {\n    case UNKNOWN: case GEOMETRY: case GEOGRAPHY:\n      throw new IllegalArgumentException(\"Type not writable here: \" + f.type());\n    default: // ok\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match writer version to schema features (e.g. don't enable variant/geometry without support)","Cast exotic types to supported ones before writing","Test write paths against the full schema in CI"],"tags":["parquet","unsupported-type","write-path"],"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-23T08:17:48.524Z"}