apache/iceberg · error · UnsupportedOperationException

Not an binary column

Error message

Not an binary column

What it means

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.

Solutions

  1. Confirm the column's physical type is BINARY before calling writeBinary.
  2. Override writeBinary in custom TripleWriter implementations for BINARY-backed columns.
  3. Check TypeToMessageType output to ensure string/decimal/uuid fields map to BINARY physical type.

Example fix

// before
writer.writeBinary(rl, buffer); // column is INT64
// after
writer.writeLong(rl, value); // or correct the schema so the column is BINARY
Defensive patterns

Strategy: type-guard

Validate before calling

boolean isBinaryColumn(ColumnDescriptor col) {
  return col.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.BINARY;
}

Type guard

if (col.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.BINARY) { writer.writeBinary(rl, buffer); }

Prevention

When it happens

Trigger: Calling column.writeBinary(rl, ByteBuffer) on a TripleWriter whose Parquet column is not BINARY (e.g. INT32, BOOLEAN, DOUBLE).

Common situations: Writing string/bytes/uuid/decimal values through a numeric column writer; custom TripleWriter implementations missing the writeBinary override; mismatched Iceberg-to-Parquet type mapping.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/07f9a6fdc707ff34. Report an issue: GitHub.

Appendix: source

Thrown at parquet/src/main/java/org/apache/iceberg/parquet/TripleWriter.java:91

  /**
   * Write a triple.
   *
   * @param rl repetition level
   * @param value the double value
   */
  default void writeDouble(int rl, double value) {
    throw new UnsupportedOperationException("Not an double column");
  }

  /**
   * Write a triple.
   *
   * @param rl repetition level
   * @param value the binary value
   */
  default void writeBinary(int rl, Binary value) {
    throw new UnsupportedOperationException("Not an binary column");
  }

  /**
   * Write a triple for a null value.
   *
   * @param rl repetition level
   * @param dl definition level
   */
  void writeNull(int rl, int dl);
}

View on GitHub (pinned to 86d9c8fc54)