{"record":{"id":"07f9a6fdc707ff34","repo":"apache/iceberg","slug":"not-an-binary-column","errorCode":null,"errorMessage":"Not an binary column","messagePattern":"Not an binary column","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/TripleWriter.java","lineNumber":91,"sourceCode":"\n  /**\n   * Write a triple.\n   *\n   * @param rl repetition level\n   * @param value the double value\n   */\n  default void writeDouble(int rl, double value) {\n    throw new UnsupportedOperationException(\"Not an double column\");\n  }\n\n  /**\n   * Write a triple.\n   *\n   * @param rl repetition level\n   * @param value the binary value\n   */\n  default void writeBinary(int rl, Binary value) {\n    throw new UnsupportedOperationException(\"Not an binary column\");\n  }\n\n  /**\n   * Write a triple for a null value.\n   *\n   * @param rl repetition level\n   * @param dl definition level\n   */\n  void writeNull(int rl, int dl);\n}\n","sourceCodeStart":73,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/TripleWriter.java#L73-L102","documentation":"TripleWriter.writeBinary's default implementation throws 'Not an binary column'. Only writers for BINARY-typed Parquet columns (strings, bytes, decimals, etc. backed by BINARY) override it; other writers keep the throwing default.","triggerScenarios":"Calling column.writeBinary(rl, ByteBuffer) on a TripleWriter whose Parquet column is not BINARY (e.g. INT32, BOOLEAN, DOUBLE).","commonSituations":"Writing string/bytes/uuid/decimal values through a numeric column writer; custom TripleWriter implementations missing the writeBinary override; mismatched Iceberg-to-Parquet type mapping.","solutions":["Confirm the column's physical type is BINARY before calling writeBinary.","Override writeBinary in custom TripleWriter implementations for BINARY-backed columns.","Check TypeToMessageType output to ensure string/decimal/uuid fields map to BINARY physical type."],"exampleFix":"// before\nwriter.writeBinary(rl, buffer); // column is INT64\n// after\nwriter.writeLong(rl, value); // or correct the schema so the column is BINARY","handlingStrategy":"type-guard","validationCode":"boolean isBinaryColumn(ColumnDescriptor col) {\n  return col.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.BINARY;\n}","typeGuard":"if (col.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.BINARY) { writer.writeBinary(rl, buffer); }","tryCatchPattern":null,"preventionTips":["Route string/decimal/uuid/bytes fields (BINARY-backed) through writeBinary only.","Validate the physical type before writing instead of relying on runtime exceptions.","Cover string and binary columns in writer tests."],"tags":["parquet","unsupported-type","writer"],"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"}