{"record":{"id":"79a127f965dd1215","repo":"apache/iceberg","slug":"unsupported-type-byte-79a127","errorCode":null,"errorMessage":"Unsupported type - byte","messagePattern":"Unsupported type - byte","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":90,"sourceCode":"\n  @Override\n  public int numNulls() {\n    return nullabilityHolder.numNulls();\n  }\n\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","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/IcebergArrowColumnVector.java#L72-L108","documentation":"IcebergArrowColumnVector delegates column access to an Arrow accessor for the vectorized Parquet reader. Iceberg's Spark vectorized read path never maps any physical/logical Iceberg type to an Arrow byte column, so getByte is intentionally unsupported and always throws UnsupportedOperationException.","triggerScenarios":"Spark's VectorizedColumnReader or generated code invokes getByte(rowId) on an IcebergArrowColumnVector — e.g. reading a column whose Spark type is ByteType that got planned through the Arrow-based vectorized reader.","commonSituations":"Queries selecting tinyint columns where vectorization settings force the Arrow path; using an Iceberg/Spark version combination where byte-typed columns aren't covered by vectorized reads; schema mapping experiments that route byte data through Arrow readers.","solutions":["Disable vectorized reads for tables with byte-typed columns: set read.vectorization.enabled=false on the table or session.","Check that the Iceberg runtime version matches your Spark version (spark.sql.extensions and iceberg-spark-runtime artifact); mismatched runtimes are a common cause.","Cast the tinyint column to integer in the query as a workaround so it uses getInt.","Upgrade Iceberg to a version adding byte support to IcebergArrowColumnVector, or implement getByte via an appropriate Arrow accessor."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (schema.fields().stream().anyMatch(f -> f.dataType() == ByteType)) {\n  spark.conf.set(\"read.vectorization.enabled\", \"false\");\n}","typeGuard":null,"tryCatchPattern":"try { vector.getByte(rowId); } catch (UnsupportedOperationException e) {\n  byte v = (byte) vector.getInt(rowId); // fallback via int accessor\n}","preventionTips":["Prefer int/long over tinyint for Iceberg columns read with Spark vectorization.","Keep iceberg-spark-runtime aligned with the Spark version.","Check vectorization coverage for your schema's types before enabling it table-wide."],"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"}