{"record":{"id":"5a8069c14a3b14da","repo":"apache/iceberg","slug":"not-a-double-column","errorCode":null,"errorMessage":"Not a double column","messagePattern":"Not a double column","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/TripleIterator.java","lineNumber":107,"sourceCode":"   * @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   *\n   * <p>This method has the same behavior as {@link #next()} and will advance this iterator.\n   *\n   * @return the next value as a Binary\n   * @throws java.util.NoSuchElementException if there are no more elements\n   * @throws UnsupportedOperationException if the underlying data values are not binary\n   */\n  default Binary nextBinary() {\n    throw new UnsupportedOperationException(\"Not a binary column\");\n  }\n\n  /**\n   * Returns null and advances the iterator.\n   *","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/TripleIterator.java#L89-L125","documentation":"TripleIterator.nextDouble() is a default method that throws UnsupportedOperationException; only iterators for DOUBLE columns override it. The message indicates the double accessor was called on a column that is not physically DOUBLE — the iterator was constructed for a different primitive type.","triggerScenarios":"Calling nextDouble() on a TripleIterator whose primitive type is not DOUBLE — e.g. an Iceberg double column stored as FLOAT in the file, or a custom materializer routing a FLOAT/decimal column into the double reader.","commonSituations":"Files written by another engine using FLOAT for 32-bit real values; schema/projection mismatch where Iceberg declares double but physical type is FLOAT or DECIMAL; custom reader dispatch errors in extension code.","solutions":["Check the physical type in the Parquet footer — nextDouble() requires DOUBLE; for FLOAT use nextFloat() and widen","Correct the reader/materializer dispatch so double columns bind to the DOUBLE reader","Align the Iceberg projection with the file's physical schema (float vs double promotion)","Prefer the generic next() accessor when the physical type may vary","Rewrite data files whose physical types diverge from the declared schema"],"exampleFix":"// before: double accessor on a FLOAT column\ndouble d = iterator.nextDouble();\n\n// after: dispatch on physical type\ndouble d = desc.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.DOUBLE\n    ? iterator.nextDouble()\n    : iterator.nextFloat();","handlingStrategy":"type-guard","validationCode":"if (desc.getPrimitiveType().getPrimitiveTypeName() != PrimitiveTypeName.DOUBLE) {\n  throw new IllegalArgumentException(\"Column \" + desc + \" is not DOUBLE\");\n}","typeGuard":"boolean isFloat64Column(ColumnDescriptor desc) {\n  return desc.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.DOUBLE;\n}","tryCatchPattern":"try { v = iterator.nextDouble(); } catch (UnsupportedOperationException e) { throw new IllegalStateException(\"Expected DOUBLE column but got: \" + desc.getPrimitiveType(), e); }","preventionTips":["Verify physical DOUBLE type before using the double accessor; fall back to nextFloat() with widening","Keep Iceberg double projections aligned with physical DOUBLE columns","Inspect footer schema in read planning and fail early on divergence","Add cross-engine round-trip tests for floating point columns"],"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"}