{"record":{"id":"5601a8d8fdc21d77","repo":"apache/iceberg","slug":"unhandled-type-5601a8","errorCode":null,"errorMessage":"Unhandled type ","messagePattern":"Unhandled type ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spark/v4.0/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.0/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 switch ends in a default that throws IllegalArgumentException('Unhandled type ' + primitive). It means an ORC primitive appeared that the reader has no Spark mapping for.","triggerScenarios":"Reading an ORC file whose declared primitive type isn't handled by the reader's switch — typically exotic/unsupported ORC types or ORC files written with types outside Iceberg's supported set.","commonSituations":"ORC files written by external tools using ORC types Iceberg doesn't map; mixed-version runtimes where a newer ORC type was written but the read path is older; corrupted schema descriptors.","solutions":["Upgrade the Iceberg runtime to a version handling the ORC primitive type","Rewrite/convert the ORC data to Iceberg-supported types","Exclude the unsupported column from the read projection","Check the exception message to identify the exact unhandled ORC type"],"exampleFix":"// before\nspark.read.format(\"iceberg\").load(\"table\") // file has unhandled ORC primitive\n// after: upgrade runtime or exclude/retype the column\ndf = spark.read.format(\"iceberg\").load(\"table\").select(\"supported_col\");","handlingStrategy":"validation","validationCode":"// check ORC schema before reading\nTypeDescription schema = reader.getSchema();\nschema.getChildren().forEach(c -> {\n  Preconditions.checkArgument(isSupported(c.getCategory()), \"Unhandled ORC type: \" + c.getCategory());\n});","typeGuard":null,"tryCatchPattern":"try { spark.read.format(\"iceberg\").load(\"table\"); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unhandled type \")) { /* upgrade or exclude column */ } else { throw e; } }","preventionTips":["Write ORC data using Iceberg-supported types only","Keep the runtime version aligned with ORC writers","Inspect ORC file schemas for exotic types before ingesting"],"tags":["spark","orc","reader","unsupported-type"],"backgroundTag":"type-mismatch","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"}