{"record":{"id":"8e49c3b8a1494854","repo":"apache/iceberg","slug":"creating-s-from-a-dictionary-is-not-supported","errorCode":null,"errorMessage":"Creating %s from a Dictionary is not supported","messagePattern":"Creating (.+?) from a Dictionary is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/GenericArrowVectorAccessorFactory.java","lineNumber":827,"sourceCode":"   */\n  protected interface StringFactory<Utf8StringT> {\n    /** Class of concrete UTF8 String type. */\n    Class<Utf8StringT> getGenericClass();\n\n    /** Create a UTF8 String from the row value in the arrow vector. */\n    Utf8StringT ofRow(VarCharVector vector, int rowId);\n\n    /** Create a UTF8 String from the row value in the FixedSizeBinaryVector vector. */\n    default Utf8StringT ofRow(FixedSizeBinaryVector vector, int rowId) {\n      throw new UnsupportedOperationException(\n          String.format(\n              \"Creating %s from a FixedSizeBinaryVector is not supported\",\n              getGenericClass().getSimpleName()));\n    }\n\n    /** Create a UTF8 String from the row value in the Dictionary. */\n    default Utf8StringT ofRow(IntVector offsetVector, Dictionary dictionary, int rowId) {\n      throw new UnsupportedOperationException(\n          String.format(\n              \"Creating %s from a Dictionary is not supported\", getGenericClass().getSimpleName()));\n    }\n\n    /** Create a UTF8 String from the byte array. */\n    Utf8StringT ofBytes(byte[] bytes);\n\n    /** Create a UTF8 String from the byte buffer. */\n    Utf8StringT ofByteBuffer(ByteBuffer byteBuffer);\n  }\n\n  /**\n   * Create an array value of type {@code ArrayT} from arrow vector value.\n   *\n   * @param <ArrayT> A concrete type that can represent an array value in a list vector, e.g.\n   *     Spark's ColumnarArray.\n   * @param <ChildVectorT> A concrete type that can represent a child vector in a struct, e.g.\n   *     Spark's ArrowColumnVector.","sourceCodeStart":809,"sourceCodeEnd":845,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/GenericArrowVectorAccessorFactory.java#L809-L845","documentation":"The string factory interface's default ofRow(IntVector, Dictionary, int) throws UnsupportedOperationException because dictionary-encoded values cannot be converted to the generic UTF8 type without an engine-specific implementation. Only concrete factories that implement dictionary decoding support this path.","triggerScenarios":"A dictionary-encoded VarChar column read via vectorized path where the reader takes the dictionary branch (offsets vector + Dictionary) and the configured StringFactory did not override ofRow(IntVector, Dictionary, int).","commonSituations":"Parquet files written with dictionary encoding for string columns (very common) read by an engine integration lacking dictionary string support; older Iceberg versions before the engine factory implemented dictionary decoding.","solutions":["Upgrade Iceberg to a version where the engine's StringFactory implements dictionary-based ofRow","Disable vectorized reads for the affected scans","Rewrite/compact the Parquet files with dictionary encoding disabled (writer option) if unavoidable"],"exampleFix":"// before\n// dictionary-encoded strings + default factory -> throws\n// after\ntable.updateProperties().set(TableProperties.PARQUET_VECTORIZATION_ENABLED, \"false\");","handlingStrategy":"fallback","validationCode":"ParquetMetadata meta = ParquetFileReader.readFooter(...);\nif (meta.getFileMetaData().getEncodingStats().hasDictionaryEncoding()\n    && !factorySupportsDictionary()) {\n  // use generic reader\n}","typeGuard":null,"tryCatchPattern":"try {\n  return vectorizedReaderFactory.create();\n} catch (UnsupportedOperationException e) {\n  return nonVectorizedReader();\n}","preventionTips":["Upgrade Iceberg so dictionary-encoded string decoding is supported","Check file encoding stats before enabling vectorization","Use a writer configuration avoiding dictionary encoding if readers are old"],"tags":["arrow","dictionary-encoding","vectorized-reads"],"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"}