{"record":{"id":"cf17d0c480003888","repo":"apache/iceberg","slug":"not-an-integer-column-cf17d0","errorCode":null,"errorMessage":"Not an integer column","messagePattern":"Not an integer column","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/TripleWriter.java","lineNumber":51,"sourceCode":"\n  /**\n   * Write a triple.\n   *\n   * @param rl repetition level\n   * @param value the boolean value\n   */\n  default void writeBoolean(int rl, boolean value) {\n    throw new UnsupportedOperationException(\"Not a boolean column\");\n  }\n\n  /**\n   * Write a triple.\n   *\n   * @param rl repetition level\n   * @param value the integer value\n   */\n  default void writeInteger(int rl, int value) {\n    throw new UnsupportedOperationException(\"Not an integer column\");\n  }\n\n  /**\n   * Write a triple.\n   *\n   * @param rl repetition level\n   * @param value the long value\n   */\n  default void writeLong(int rl, long value) {\n    throw new UnsupportedOperationException(\"Not an long column\");\n  }\n\n  /**\n   * Write a triple.\n   *\n   * @param rl repetition level\n   * @param value the float value\n   */","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/TripleWriter.java#L33-L69","documentation":"TripleWriter's writeInteger default implementation throws UnsupportedOperationException because the method only exists to be overridden by writers for INT32 Parquet columns. Calling it on a writer bound to a column of a different physical type hits the default throwing body. It is a compile-time-dispatchable but runtime-enforced type check for column writers.","triggerScenarios":"Calling column.writeInteger(rl, value) on a TripleWriter whose Parquet column is not INT32 (e.g. INT64, FLOAT, BOOLEAN).","commonSituations":"Writing Iceberg int values through a writer constructed for a differently-typed column; custom writer subclasses that did not override writeInteger; schema drift after changing a column from int to long without regenerating writers.","solutions":["Confirm the column's physical type is INT32 before calling writeInteger.","Override writeInteger in custom TripleWriter implementations for INT32 columns.","Regenerate/rebuild the appender-writer chain after any Iceberg schema type change."],"exampleFix":"// before\nwriter.writeInteger(rl, value); // column is INT64\n// after\nwriter.writeLong(rl, value); // use the method matching the column's physical type","handlingStrategy":"type-guard","validationCode":"boolean isInt32Column(ColumnDescriptor col) {\n  return col.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.INT32;\n}","typeGuard":"if (col.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.INT32) { writer.writeInteger(rl, value); }","tryCatchPattern":null,"preventionTips":["Match writeX calls to the column's PrimitiveTypeName (INT32 -> writeInteger).","Regenerate writers whenever the Iceberg schema changes a field's type.","Cover each physical type 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-14T21:17:11.552Z"}