{"record":{"id":"5a4147a6098fcf4d","repo":"apache/iceberg","slug":"unhandled-type-primitive-5a4147","errorCode":null,"errorMessage":"Unhandled type ${primitive}","messagePattern":"Unhandled type (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v4.2/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/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/SparkOrcReader.java#L113-L136","documentation":"SparkOrcReader.primitive maps ORC primitive types to Spark ORC value readers; the default branch throws IllegalArgumentException for ORC primitives it cannot handle. The BINARY branch additionally special-cases UUID; anything after that falls through to the throw.","triggerScenarios":"Reading ORC data files into Spark via Iceberg when the file schema contains an ORC primitive type with no reader mapping (types not in the handled set of the reader builder).","commonSituations":"ORC files written by external engines or newer writers with types this Iceberg version doesn't map (e.g. new ORC type ids).","solutions":["Upgrade the Iceberg Spark runtime to a version whose SparkOrcReader covers the type.","Rewrite the ORC files with supported types (cast columns before writing).","Exclude the unsupported column from the scan projection if possible."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check ORC schema types against supported readers before scanning\nTypeDescription.getSchema(file).getChildren().forEach(c -> /* verify c.getCategory() is handled */);","typeGuard":"boolean readable(TypeDescription t) { switch (t.getCategory()) { /* list handled categories */ default: return false; } }","tryCatchPattern":"try { scan/table read } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unhandled type\")) { /* exclude column or upgrade runtime */ } else throw e; }","preventionTips":["Write ORC data files through Iceberg so only mapped types appear","Check file schemas when ingesting ORC from external engines","Keep the Spark runtime current for new ORC type support"],"tags":["spark","orc","reader","unsupported-type"],"backgroundTag":"unsupported-dtype","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"}