{"record":{"id":"5ab56db9a87ddddd","repo":"apache/iceberg","slug":"unsupported-primitive-type-s-5ab56d","errorCode":null,"errorMessage":"Unsupported primitive type: %s","messagePattern":"Unsupported primitive type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/ColumnWriter.java","lineNumber":79,"sourceCode":"      case DOUBLE:\n        return (ColumnWriter<T>)\n            new ColumnWriter<Double>(desc) {\n              @Override\n              public void write(int rl, Double value) {\n                writeDouble(rl, value);\n              }\n            };\n      case FIXED_LEN_BYTE_ARRAY:\n      case BINARY:\n        return (ColumnWriter<T>)\n            new ColumnWriter<Binary>(desc) {\n              @Override\n              public void write(int rl, Binary value) {\n                writeBinary(rl, value);\n              }\n            };\n      default:\n        throw new UnsupportedOperationException(\n            \"Unsupported primitive type: \" + desc.getPrimitiveType().getPrimitiveTypeName());\n    }\n  }\n\n  private final ColumnDescriptor desc;\n  private final int maxDefinitionLevel;\n\n  private org.apache.parquet.column.ColumnWriter columnWriter = null;\n\n  private ColumnWriter(ColumnDescriptor desc) {\n    this.desc = desc;\n    this.maxDefinitionLevel = desc.getMaxDefinitionLevel();\n  }\n\n  public void setColumnStore(ColumnWriteStore columnStore) {\n    this.columnWriter = columnStore.getColumnWriter(desc);\n  }\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/ColumnWriter.java#L61-L97","documentation":"Switch default in ColumnWriter.newWriter: the Parquet physical column type has no writer factory case (boolean/int64/float/double/binary/fixed-len-byte-array are handled). The %s is the primitive type; writing this Parquet schema with the vectorized column writer is unsupported at writer construction.","triggerScenarios":"Writing data to Parquet with a column descriptor whose PrimitiveTypeName is not handled by the switch in newWriter.","commonSituations":"Attempting to write data whose schema maps to an unsupported Parquet physical type; custom or synthetic schemas; bugs in type mapping upstream of the writer.","solutions":["Fix the write schema so every column maps to a supported Parquet primitive type","Upgrade Iceberg if the type is newly supported","Drop or cast the unsupported column before writing"],"exampleFix":"// before\nTypes.NestedField f = Types.NestedField.optional(1, \"x\", unsupportedType);\n// after\nTypes.NestedField f = Types.NestedField.optional(1, \"x\", Types.StringType.get());","handlingStrategy":"validation","validationCode":"schema.columns().forEach(f -> {\n  if (!SUPPORTED_ICEBERG_TYPES.contains(f.type())) throw new IllegalArgumentException(\"Unsupported for parquet write: \" + f.type());\n});","typeGuard":null,"tryCatchPattern":"try {\n  df.write().format(\"iceberg\").mode(\"append\").save(tableName);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"Unsupported primitive type\")) { /* fix schema */ }\n}","preventionTips":["Map Iceberg types to supported Parquet physical types in schema design","Test write paths with all schema variants used by your pipelines","Avoid custom/synthetic Parquet schemas"],"tags":["parquet","unsupported-type","write-path"],"backgroundTag":"unsupported-operation","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"}