{"record":{"id":"00064baaec6b1fa3","repo":"apache/iceberg","slug":"unhandled-type-00064b","errorCode":null,"errorMessage":"Unhandled type ","messagePattern":"Unhandled type ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/data/SparkOrcReader.java","lineNumber":131,"sourceCode":"          return OrcValueReaders.floats();\n        case DOUBLE:\n          return OrcValueReaders.doubles();\n        case TIMESTAMP_INSTANT:\n        case TIMESTAMP:\n          return SparkOrcValueReaders.timestampTzs();\n        case DECIMAL:\n          return SparkOrcValueReaders.decimals(primitive.getPrecision(), primitive.getScale());\n        case CHAR:\n        case VARCHAR:\n        case STRING:\n          return SparkOrcValueReaders.utf8String();\n        case BINARY:\n          if (Type.TypeID.UUID == iPrimitive.typeId()) {\n            return SparkOrcValueReaders.uuids();\n          }\n          return OrcValueReaders.bytes();\n        default:\n          throw new IllegalArgumentException(\"Unhandled type \" + primitive);\n      }\n    }\n  }\n}\n","sourceCodeStart":113,"sourceCodeEnd":136,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/data/SparkOrcReader.java#L113-L136","documentation":"SparkOrcReader.primitive maps Iceberg/ORC primitive types to ORC value readers. Covered cases include all standard types plus UUID via BINARY; the default branch throws for any primitive the reader does not handle. This IllegalArgumentException means an Iceberg type in the schema could not be translated into an ORC reader during a Spark read.","triggerScenarios":"Reading an ORC file whose Iceberg schema includes a primitive type with no reader mapping (e.g. an unexpected type reaching the default case such as an unknown/future type id in a BINARY-less position or a type the Spark ORC reader does not support).","commonSituations":"Reading tables written by newer Iceberg versions or other engines that use types this Spark reader version does not understand; version-skew between writer and reader.","solutions":["Upgrade the Iceberg Spark runtime so the reader supports the type.","Rewrite the table with supported types (e.g. store uuid as binary if on an old reader).","Check the table schema for unusual types and map them to supported primitives.","Ensure writer and reader Iceberg versions are aligned."],"exampleFix":"// before: table column of unsupported type\n// after: alter/rewrite schema to a supported type, e.g.\nALTER TABLE t ALTER COLUMN u SET // uuid supported in newer versions; otherwise use binary","handlingStrategy":"validation","validationCode":"// Check the table schema for types the Spark ORC reader may not handle before scanning\nfor (org.apache.iceberg.types.Types.NestedField f : table.schema().columns()) {\n  if (f.type().typeId() == org.apache.iceberg.types.Type.TypeID.UUID) {\n    // ensure your Iceberg Spark runtime supports uuid in ORC reads\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  spark.read().format(\"iceberg\").load(\"db.t\").collect();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unhandled type\")) {\n    // fall back: upgrade runtime or read a rewritten table\n  } else throw e;\n}","preventionTips":["Keep writer and reader Iceberg versions aligned","Avoid exotic type ids in table schemas","Test reads after schema migrations"],"tags":["spark","orc","unsupported-type","reader"],"backgroundTag":"incompatible-source-type","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"}