{"record":{"id":"e93e0d5fdeca40c8","repo":"apache/iceberg","slug":"not-a-float-column","errorCode":null,"errorMessage":"Not a float column","messagePattern":"Not a float column","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/TripleIterator.java","lineNumber":94,"sourceCode":"   * @return the next value as an un-boxed long\n   * @throws java.util.NoSuchElementException if there are no more elements\n   * @throws UnsupportedOperationException if the underlying data values are not longs\n   */\n  default long nextLong() {\n    throw new UnsupportedOperationException(\"Not a long column\");\n  }\n\n  /**\n   * Returns the next value as an un-boxed float.\n   *\n   * <p>This method has the same behavior as {@link #next()} and will advance this iterator.\n   *\n   * @return the next value as an un-boxed float\n   * @throws java.util.NoSuchElementException if there are no more elements\n   * @throws UnsupportedOperationException if the underlying data values are not floats\n   */\n  default float nextFloat() {\n    throw new UnsupportedOperationException(\"Not a float column\");\n  }\n\n  /**\n   * Returns the next value as an un-boxed double.\n   *\n   * <p>This method has the same behavior as {@link #next()} and will advance this iterator.\n   *\n   * @return the next value as an un-boxed double\n   * @throws java.util.NoSuchElementException if there are no more elements\n   * @throws UnsupportedOperationException if the underlying data values are not doubles\n   */\n  default double nextDouble() {\n    throw new UnsupportedOperationException(\"Not a double column\");\n  }\n\n  /**\n   * Returns the next value as a Binary.\n   *","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/TripleIterator.java#L76-L112","documentation":"TripleIterator.nextFloat() is a default method that throws UnsupportedOperationException; only iterators for FLOAT (IEEE single-precision) columns override it. Seeing this message means the float accessor was invoked on a column that is not physically FLOAT — usually a double or decimal column bound to the float reader.","triggerScenarios":"Calling nextFloat() on a TripleIterator whose primitive type is not FLOAT — e.g. an Iceberg float column whose Parquet file stores DOUBLE, or a custom reader dispatching a DOUBLE/decimal column to the float reader.","commonSituations":"Schema written by another engine stored a float as double; Iceberg projection type (float) disagrees with the physical column type (DOUBLE); hand-written ParquetValueReaders mapping by Iceberg type without checking physical type.","solutions":["Verify the column's physical type is FLOAT; if it is DOUBLE, call nextDouble() and cast","Fix the reader dispatch table so float columns bind to the FLOAT reader","Reconcile the Iceberg projected schema (float) with the file schema (double) using proper type promotion","Use the generic next() accessor in custom code when the physical type is unknown","Rewrite divergent data files to match the table's declared schema"],"exampleFix":"// before: float accessor on a DOUBLE column\nfloat f = iterator.nextFloat();\n\n// after: dispatch on physical type\nfloat f = desc.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.FLOAT\n    ? iterator.nextFloat()\n    : (float) iterator.nextDouble();","handlingStrategy":"type-guard","validationCode":"if (desc.getPrimitiveType().getPrimitiveTypeName() != PrimitiveTypeName.FLOAT) {\n  throw new IllegalArgumentException(\"Column \" + desc + \" is not FLOAT\");\n}","typeGuard":"boolean isFloat32Column(ColumnDescriptor desc) {\n  return desc.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.FLOAT;\n}","tryCatchPattern":"try { v = iterator.nextFloat(); } catch (UnsupportedOperationException e) { throw new IllegalStateException(\"Expected FLOAT column but got: \" + desc.getPrimitiveType(), e); }","preventionTips":["Distinguish FLOAT vs DOUBLE physical types in reader dispatch; widen explicitly when needed","Check the file footer's schema before binding readers","Do not assume Iceberg float projects to physical FLOAT without verification","Test readers against files written by multiple engines"],"tags":["parquet","type-mismatch","column-iterator"],"backgroundTag":"type-mismatch","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}