{"record":{"id":"9af2c71335a00993","repo":"apache/iceberg","slug":"unsupported-type-utf8string","errorCode":null,"errorMessage":"Unsupported type: UTF8String","messagePattern":"Unsupported type: UTF8String","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowVectorAccessor.java","lineNumber":81,"sourceCode":"\n  public float getFloat(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: float\");\n  }\n\n  public double getDouble(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: double\");\n  }\n\n  public byte[] getBinary(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: binary\");\n  }\n\n  public DecimalT getDecimal(int rowId, int precision, int scale) {\n    throw new UnsupportedOperationException(\"Unsupported type: decimal\");\n  }\n\n  public Utf8StringT getUTF8String(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: UTF8String\");\n  }\n\n  public ArrayT getArray(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type: array\");\n  }\n\n  public ChildVectorT childColumn(int pos) {\n    if (childColumns != null) {\n      return childColumns[pos];\n    } else {\n      throw new IndexOutOfBoundsException(\"Child columns is null hence cannot find index: \" + pos);\n    }\n  }\n\n  public final ValueVector getVector() {\n    return vector;\n  }\n}","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowVectorAccessor.java#L63-L99","documentation":"Same base-class stub pattern as the decimal case: ArrowVectorAccessor.getUTF8String throws UnsupportedOperationException by default, and only string-backed accessor subclasses override it. Calling it on a non-string vector accessor means the requested string materialization is not supported for that column.","triggerScenarios":"Calling getUTF8String(rowId) on an accessor whose ValueVector is not a VarChar/VarBinary-like string vector; toVarCharVector (per the call info) invoking getUTF8String while converting a vector that is not a string column.","commonSituations":"Row-materializing a vectorized batch where the schema says string but the underlying vector is a dictionary-encoded or binary vector without a string accessor; copying conversion code between accessor implementations where the override exists in one but not the other.","solutions":["Check the Iceberg/Arrow type of the column before calling getUTF8String; use it only for string columns","Use the generic getSingleValue/getBinary path for non-string columns","Confirm the concrete accessor class overrides getUTF8String (e.g. DictionaryStringAccessor, StringAccessor)","If reading binary data, call getBinary instead of getUTF8String"],"exampleFix":"// before\nUtf8String s = accessor.getUTF8String(rowId); // throws on non-string accessors\n// after\nObject v = accessor.getSingleValue(rowId);\nUtf8String s = (v instanceof byte[] b) ? Utf8String.fromBytes(b) : (Utf8String) v;","handlingStrategy":"type-guard","validationCode":"if (!columnType.typeId().equals(TypeID.STRING)) { throw new IllegalArgumentException(columnType + \" is not a string\"); }","typeGuard":"boolean isStringAccessor(ArrowVectorAccessor<?,?,?,?> a) { return a instanceof StringArrowAccessor || a instanceof DictionaryStringAccessor; }","tryCatchPattern":"try { return accessor.getUTF8String(rowId); } catch (UnsupportedOperationException e) { return Utf8String.fromBytes(accessor.getBinary(rowId)); }","preventionTips":["Only call getUTF8String on VarChar-backed accessors","Use getSingleValue for polymorphic column handling","Add unit tests covering every Iceberg type through the materialization path"],"tags":["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-23T08:17:48.524Z"}