{"record":{"id":"4495d3a28083d82a","repo":"apache/iceberg","slug":"readboolean-is-not-supported","errorCode":null,"errorMessage":"readBoolean is not supported","messagePattern":"readBoolean is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedValuesReader.java","lineNumber":41,"sourceCode":"import org.apache.parquet.bytes.ByteBufferInputStream;\nimport org.apache.parquet.column.values.ValuesReader;\nimport org.apache.parquet.io.api.Binary;\n\n/**\n * Interface for value decoding that supports vectorized (aka batched) decoding. Implementations are\n * expected to be {@link ValuesReader} instances, and this interface \"extends\" that abstract class\n * by overriding the salient methods.\n */\ninterface VectorizedValuesReader {\n\n  int INT_SIZE = 4;\n  int LONG_SIZE = 8;\n  int FLOAT_SIZE = 4;\n  int DOUBLE_SIZE = 8;\n\n  /** Read a single boolean */\n  default boolean readBoolean() {\n    throw new UnsupportedOperationException(\"readBoolean is not supported\");\n  }\n\n  /** Read a single byte */\n  default byte readByte() {\n    throw new UnsupportedOperationException(\"readByte is not supported\");\n  }\n\n  /** Read a single short */\n  default short readShort() {\n    throw new UnsupportedOperationException(\"readShort is not supported\");\n  }\n\n  /** Read a single integer */\n  default int readInteger() {\n    throw new UnsupportedOperationException(\"readInteger is not supported\");\n  }\n\n  /** Read a single long */","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedValuesReader.java#L23-L59","documentation":"The VectorizedValuesReader interface declares readBoolean as a default method that throws UnsupportedOperationException, because not all implementing readers support reading a single boolean value. A caller invoking readBoolean on an implementation that does not override it fails.","triggerScenarios":"Calling VectorizedValuesReader.readBoolean() from a reader's nextVal path when the concrete values reader does not implement boolean reads — e.g. reading a BOOLEAN column through a reader implementation that lacks boolean support.","commonSituations":"Vectorized reads of BOOLEAN Parquet columns with a reader subclass that never overrode readBoolean (built-in implementations override it; custom or less-common implementations may not).","solutions":["Use a values reader implementation that supports readBoolean (one that reads from the page stream).","Check the column type/reader pairing before vectorized decoding; handle BOOLEAN with a supported reader.","If implementing VectorizedValuesReader, override readBoolean."],"exampleFix":"// before\nclass MyReader implements VectorizedValuesReader { /* no readBoolean */ }\n// after\nclass MyReader implements VectorizedValuesReader {\n  @Override public boolean readBoolean() { return (in.readInteger() & 1) != 0; }\n}","handlingStrategy":"type-guard","validationCode":"boolean isBool = desc.getPrimitiveType().getPrimitiveTypeName() == PrimitiveTypeName.BOOLEAN;\nboolean overridesRead = !VectorizedValuesReader.class.equals(\n    valuesReader.getClass().getMethod(\"readBoolean\").getDeclaringClass());","typeGuard":"static boolean supportsBoolean(VectorizedValuesReader r) throws NoSuchMethodException {\n  return r.getClass().getMethod(\"readBoolean\").getDeclaringClass() != VectorizedValuesReader.class;\n}","tryCatchPattern":null,"preventionTips":["Only invoke per-value read methods matching the column's primitive type.","When implementing VectorizedValuesReader, override all typed read methods.","Test reader implementations against all Parquet primitive types."],"tags":["parquet","vectorized-reads","boolean"],"backgroundTag":"method-not-implemented","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"}