{"record":{"id":"a2cbd0d545eb4704","repo":"apache/iceberg","slug":"unsupported-type-short-a2cbd0","errorCode":null,"errorMessage":"Unsupported type - short","messagePattern":"Unsupported type - short","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/IcebergArrowColumnVector.java","lineNumber":95,"sourceCode":"\n  @Override\n  public boolean isNullAt(int rowId) {\n    return nullabilityHolder.isNullAt(rowId) == 1;\n  }\n\n  @Override\n  public boolean getBoolean(int rowId) {\n    return accessor.getBoolean(rowId);\n  }\n\n  @Override\n  public byte getByte(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type - byte\");\n  }\n\n  @Override\n  public short getShort(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type - short\");\n  }\n\n  @Override\n  public int getInt(int rowId) {\n    return accessor.getInt(rowId);\n  }\n\n  @Override\n  public long getLong(int rowId) {\n    return accessor.getLong(rowId);\n  }\n\n  @Override\n  public float getFloat(int rowId) {\n    return accessor.getFloat(rowId);\n  }\n\n  @Override","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/IcebergArrowColumnVector.java#L77-L113","documentation":"IcebergArrowColumnVector supports a fixed set of Arrow-backed accessors (boolean, int, long, float, double, decimal, etc.). getShort is deliberately not implemented — no Iceberg type is read through a short Arrow vector in the Spark vectorized path — so any call throws UnsupportedOperationException.","triggerScenarios":"Spark vectorized reading invokes getShort(rowId) on an IcebergArrowColumnVector — typically when a smallint column is planned through the Arrow vectorized reader, or engine-generated code accesses the vector with a short accessor.","commonSituations":"Selecting smallint columns with vectorized reads enabled; Iceberg/Spark runtime version mismatches; custom readers or UDFs that call the short accessor directly on the column vector.","solutions":["Set read.vectorization.enabled=false for tables containing smallint columns, or cast the column to int in the query.","Verify the iceberg-spark-runtime artifact matches your Spark major version (e.g. 4.2 runtime with Spark 4.2).","Upgrade Iceberg — newer releases may add short support to the Arrow column vector.","If you control the build, implement getShort by delegating to an Int-accessor with a cast, or add the appropriate Arrow accessor."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (schema.fields().stream().anyMatch(f -> f.dataType() == ShortType)) {\n  spark.conf.set(\"read.vectorization.enabled\", \"false\");\n}","typeGuard":null,"tryCatchPattern":"try { vector.getShort(rowId); } catch (UnsupportedOperationException e) {\n  short v = (short) vector.getInt(rowId);\n}","preventionTips":["Cast smallint columns to int in queries that scan with vectorization.","Verify runtime artifact matches Spark major version.","Audit schemas for short-typed columns before enabling vectorized reads."],"tags":["spark","arrow","vectorized-read","unsupported-type"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}