{"record":{"id":"5146367364ba3924","repo":"apache/iceberg","slug":"can-t-handle-s","errorCode":null,"errorMessage":"Can't handle %s","messagePattern":"Can't handle (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"orc/src/main/java/org/apache/iceberg/orc/OrcToIcebergVisitor.java","lineNumber":194,"sourceCode":"        }\n\n        break;\n      case TIMESTAMP_INSTANT:\n        String tsUnit = primitive.getAttributeValue(ORCSchemaUtil.TIMESTAMP_UNIT);\n        if (tsUnit == null || ORCSchemaUtil.MICROS.equalsIgnoreCase(tsUnit)) {\n          builder.ofType(Types.TimestampType.withZone());\n        } else if (tsUnit.equalsIgnoreCase(ORCSchemaUtil.NANOS)) {\n          builder.ofType(Types.TimestampNanoType.withZone());\n        } else {\n          throw new IllegalStateException(String.format(\"Invalid Timestamp type unit: %s\", tsUnit));\n        }\n\n        break;\n      case DECIMAL:\n        builder.ofType(Types.DecimalType.of(primitive.getPrecision(), primitive.getScale()));\n        break;\n      default:\n        throw new IllegalArgumentException(\"Can't handle \" + primitive);\n    }\n\n    return Optional.of(builder.build());\n  }\n\n  private static void convertLong(TypeDescription primitive, Types.NestedField.Builder builder) {\n    String longAttributeValue =\n        primitive.getAttributeValue(ORCSchemaUtil.ICEBERG_LONG_TYPE_ATTRIBUTE);\n    ORCSchemaUtil.LongType longType =\n        longAttributeValue == null\n            ? ORCSchemaUtil.LongType.LONG\n            : ORCSchemaUtil.LongType.valueOf(longAttributeValue);\n    switch (longType) {\n      case TIME:\n        builder.ofType(Types.TimeType.get());\n        break;\n      case LONG:\n        builder.ofType(Types.LongType.get());","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/orc/src/main/java/org/apache/iceberg/orc/OrcToIcebergVisitor.java#L176-L212","documentation":"OrcToIcebergVisitor.primitive maps each ORC primitive TypeDescription to an Iceberg type via convertXxx helpers keyed by the ICEBERG_LONG_TYPE_ATTRIBUTE / ICEBERG_BINARY_TYPE_ATTRIBUTE attributes. When the primitive's ORC category falls through all handled cases (including attribute-driven LONG/BINARY conversion), it throws IllegalArgumentException naming the ORC type. It means this ORC primitive has no Iceberg mapping in this code path.","triggerScenarios":"Visiting an ORC schema whose primitive category is not one of the handled types (BOOLEAN, INT, LONG-with-attribute, FLOAT, DOUBLE, STRING, VARCHAR, CHAR, DATE, TIME-with-attribute, TIMESTAMP, TIMESTAMP_INSTANT, DECIMAL, BINARY-with-attribute...) — e.g. an unanticipated category or a LONG/BINARY whose attribute conversion helper receives an unexpected default.","commonSituations":"Reading ORC files written by external tools with exotic primitive usage; Iceberg version skew where a writer produced a type mapping the reader's converter does not know; corrupted type attributes causing fall-through.","solutions":["Upgrade iceberg-orc so the converter knows the primitive type in question.","Rewrite the ORC file using Iceberg's writer with a supported schema.","Change the column's ORC type to a supported equivalent (e.g. STRING instead of an exotic category).","If this is a custom attribute-driven mapping, ensure ICEBERG_LONG_TYPE_ATTRIBUTE / ICEBERG_BINARY_TYPE_ATTRIBUTE values are valid so convertLong/convertBinary do not fall through."],"exampleFix":"// before: unsupported ORC primitive category\n// after: rewrite column as a supported type\ncolumn: interval -> string  // store as string, or upgrade Iceberg","handlingStrategy":"try-catch","validationCode":"// check the primitive category is mappable before conversion\nswitch (primitive.getCategory()) { case BOOLEAN: case BYTE: case INT: case LONG: case FLOAT: case DOUBLE: case STRING: case VARCHAR: case CHAR: case DATE: case TIMESTAMP: case DECIMAL: case BINARY: break; default: throw new IllegalArgumentException(\"Unmapped ORC primitive: \" + primitive); }","typeGuard":null,"tryCatchPattern":"try { icebergSchema = ORCSchemaUtil.convert(orcSchema); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Can't handle\")) { rewriteFileWithSupportedTypes(file); } else throw e; }","preventionTips":["Use only Iceberg-supported ORC primitives when writing with external engines","Upgrade Iceberg before reading files from newer writers","Dry-run schema conversion on external ORC files before committing to a table"],"tags":["orc","primitive-type","schema-conversion","unsupported-type"],"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-14T11:17:12.474Z"}