{"record":{"id":"9fbda91583ef5035","repo":"apache/iceberg","slug":"readbyte-is-not-supported","errorCode":null,"errorMessage":"readByte is not supported","messagePattern":"readByte 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":46,"sourceCode":" * 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 */\n  default long readLong() {\n    throw new UnsupportedOperationException(\"readLong is not supported\");\n  }\n\n  /** Read a single float */","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedValuesReader.java#L28-L64","documentation":"VectorizedValuesReader.readByte is a default interface method that throws UnsupportedOperationException. Byte (single-byte) reads are only supported by implementations that override it; the default exists so unrelated reader implementations compile without a no-op stub.","triggerScenarios":"Calling readByte() on a VectorizedValuesReader implementation that does not override it — typically while decoding a narrow-width column where the concrete reader lacks the byte-reading method.","commonSituations":"Reading Parquet INT32 data annotated as 1-byte ints through a reader implementation that only supports the full-width readInteger path; custom reader subclasses.","solutions":["Use a reader implementation that overrides readByte (the standard stream-backed implementations do).","Read the value as readInteger() and narrow to byte in the caller.","Override readByte in your custom VectorizedValuesReader implementation."],"exampleFix":"// before\nbyte b = valuesReader.readByte(); // throws on non-overriding reader\n// after\nbyte b = (byte) valuesReader.readInteger(); // width-safe on all implementations","handlingStrategy":"type-guard","validationCode":"if (typeWidth == 1 && !supportsByte(valuesReader)) { useNonVectorizedPath = true; }","typeGuard":"if (typeWidth == 1 && !overrides(valuesReader, \"readByte\")) {\n  valuesReader = new StreamBackedValuesReader(...); // swap to full implementation\n}","tryCatchPattern":null,"preventionTips":["Route 1-byte-width columns only to readers that override readByte.","Prefer readInteger + narrowing when reader capability is unknown.","Keep reader capability matrices in tests per primitive width."],"tags":["parquet","vectorized-reads","int32"],"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"}