{"record":{"id":"5a6d33f8a1ecb1c1","repo":"apache/iceberg","slug":"unhandled-type-primitive-5a6d33","errorCode":null,"errorMessage":"Unhandled type ${primitive}","messagePattern":"Unhandled type (.+?)","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/VectorizedSparkOrcReaders.java","lineNumber":164,"sourceCode":"          primitiveValueReader = SparkOrcValueReaders.timestampTzs();\n          break;\n        case DECIMAL:\n          primitiveValueReader =\n              SparkOrcValueReaders.decimals(primitive.getPrecision(), primitive.getScale());\n          break;\n        case CHAR:\n        case VARCHAR:\n        case STRING:\n          primitiveValueReader = SparkOrcValueReaders.utf8String();\n          break;\n        case BINARY:\n          primitiveValueReader =\n              Type.TypeID.UUID == iPrimitive.typeId()\n                  ? SparkOrcValueReaders.uuids()\n                  : OrcValueReaders.bytes();\n          break;\n        default:\n          throw new IllegalArgumentException(\"Unhandled type \" + primitive);\n      }\n      return (columnVector, batchSize, batchOffsetInFile, isSelectedInUse, selected) ->\n          new PrimitiveOrcColumnVector(\n              iPrimitive, batchSize, columnVector, primitiveValueReader, isSelectedInUse, selected);\n    }\n  }\n\n  private abstract static class BaseOrcColumnVector extends ColumnVector {\n    private final org.apache.orc.storage.ql.exec.vector.ColumnVector vector;\n    private final int batchSize;\n    private final boolean isSelectedInUse;\n    private final int[] selected;\n    private Integer numNulls;\n\n    BaseOrcColumnVector(\n        Type type,\n        int batchSize,\n        org.apache.orc.storage.ql.exec.vector.ColumnVector vector,","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/VectorizedSparkOrcReaders.java#L146-L182","documentation":"VectorizedSparkOrcReaders maps Iceberg primitive types to ORC value readers for the vectorized ORC path. The switch over the primitive's type id has no reader for the encountered type, so it hits the default branch and throws IllegalArgumentException. This means the Iceberg type has no vectorized ORC reader implementation in this version.","triggerScenarios":"Running a vectorized ORC scan over a table whose schema contains a primitive type not handled by the switch — commonly types like uuid, variant, unknown future types, or nested-in-list/map primitives the reader doesn't cover.","commonSituations":"Reading ORC tables written by newer Iceberg versions (e.g. with UUID columns) using an older runtime; tables whose schemas evolved to include types the vectorized ORC reader predates; misconfigured vectorization over exotic types.","solutions":["Identify the offending column type from the message and disable vectorization for that read (read.vectorization.enabled=false).","Upgrade Iceberg to a version whose VectorizedSparkOrcReaders supports the type (e.g. UUID support was added later).","Recreate/rewrite the table with a supported type (e.g. store UUID as fixed(16) or string) if an upgrade is not possible.","If you maintain the code, add a case for the missing TypeID mapping to an appropriate OrcValueReader."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"boolean unsupported = schema.columns().stream()\n    .anyMatch(c -> c.type().typeId() == Type.TypeID.UUID);\nif (unsupported && format.equals(\"orc\")) { spark.conf.set(\"read.vectorization.enabled\", \"false\"); }","typeGuard":null,"tryCatchPattern":"try {\n  orcScan = VectorizedSparkOrcReaders.reader(...);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unhandled type\")) { useBatchReaderInstead(); } else throw e;\n}","preventionTips":["Before enabling vectorized ORC reads, confirm all schema types are covered by your Iceberg version.","Upgrade Iceberg when reading ORC tables with newer types like UUID.","Set read.vectorization.enabled=false at table level for tables with exotic types."],"tags":["spark","orc","vectorized-read","unsupported-type"],"backgroundTag":"unsupported-enum-value","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"}