{"record":{"id":"5309cdad877b3c69","repo":"apache/iceberg","slug":"readshort-is-not-supported","errorCode":null,"errorMessage":"readShort is not supported","messagePattern":"readShort 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":51,"sourceCode":"\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 */\n  default float readFloat() {\n    throw new UnsupportedOperationException(\"readFloat is not supported\");\n  }\n\n  /** Read a single double */","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/VectorizedValuesReader.java#L33-L69","documentation":"VectorizedValuesReader.readShort is a default interface method that throws UnsupportedOperationException. Short (2-byte) reads require an implementation that overrides this method; the default is a guard against unsupported reader types.","triggerScenarios":"Calling readShort() on a VectorizedValuesReader implementation that does not override it — typically when decoding an INT32 column into a 2-byte-width vector and the active reader lacks short support.","commonSituations":"Vectorized reads of 2-byte-width INT32 columns (e.g. smallint-backed data) via a reader that only implements full-width integer reads.","solutions":["Use a values reader implementation that overrides readShort.","Read via readInteger() and narrow to short in the caller.","Override readShort in custom implementations."],"exampleFix":"// before\nshort s = valuesReader.readShort(); // throws\n// after\nshort s = (short) valuesReader.readInteger();","handlingStrategy":"type-guard","validationCode":"if (typeWidth == 2 && !supportsShort(valuesReader)) { useGenericPath = true; }","typeGuard":"if (typeWidth == 2 && !overrides(valuesReader, \"readShort\")) {\n  valuesReader = new StreamBackedValuesReader(...);\n}","tryCatchPattern":null,"preventionTips":["Route 2-byte-width columns only to short-capable readers.","Fallback to readInteger + cast when capability is unknown.","Test vectorized reads over all INT32 logical widths (1/2/4 bytes)."],"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"}