{"record":{"id":"dfd13596a3ba61f4","repo":"apache/iceberg","slug":"type-is-not-supported","errorCode":null,"errorMessage":"<type> is not supported","messagePattern":"<type> is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hive-metastore/src/main/java/org/apache/iceberg/hive/HiveSchemaUtil.java","lineNumber":190,"sourceCode":"      case DECIMAL:\n        final Types.DecimalType decimalType = (Types.DecimalType) type;\n        return String.format(\"decimal(%s,%s)\", decimalType.precision(), decimalType.scale());\n      case STRUCT:\n        final Types.StructType structType = type.asStructType();\n        final String nameToType =\n            structType.fields().stream()\n                .map(f -> String.format(\"%s:%s\", f.name(), convert(f.type())))\n                .collect(Collectors.joining(\",\"));\n        return String.format(\"struct<%s>\", nameToType);\n      case LIST:\n        final Types.ListType listType = type.asListType();\n        return String.format(\"array<%s>\", convert(listType.elementType()));\n      case MAP:\n        final Types.MapType mapType = type.asMapType();\n        return String.format(\n            \"map<%s,%s>\", convert(mapType.keyType()), convert(mapType.valueType()));\n      default:\n        throw new UnsupportedOperationException(type + \" is not supported\");\n    }\n  }\n}\n","sourceCodeStart":172,"sourceCodeEnd":194,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveSchemaUtil.java#L172-L194","documentation":"HiveSchemaUtil.convertToTypeString throws UnsupportedOperationException when asked to convert an Iceberg type that has no Hive DDL string representation in its switch (only structured MAP/list-like branches plus primitives are handled; the default arm rejects the rest). Used when writing Iceberg schemas back as Hive type strings.","triggerScenarios":"Calling HiveSchemaUtil.convert with an Iceberg type falling to the default arm — e.g. nested unsupported structures or less common types — during Hive DDL/serde type-string generation.","commonSituations":"Creating Hive-compatible views or conversions over Iceberg schemas containing types Hive cannot express; syncing Iceberg schemas into Hive for query engines with limited type support.","solutions":["Simplify the Iceberg schema (e.g. replace the unsupported type with string/struct) before converting.","Check which type hits the default arm by inspecting the message ('<type> is not supported') and map it manually.","Update HiveSchemaUtil to add a mapping if the type is representable in your Hive version."],"exampleFix":"// before\nTypes.NestedField f = Types.NestedField.of(1, false, \"v\", Types.VariantType.get()); // no Hive mapping\n// after\nTypes.NestedField f = Types.NestedField.of(1, false, \"v\", Types.StringType.get());","handlingStrategy":"validation","validationCode":"schema.columns().forEach(f -> { if (!(f.type() instanceof Types.StringType || f.type() instanceof Types.StructType || f.type() instanceof Types.MapType || f.type() instanceof Types.ListType || f.type() instanceof Types.PrimitiveType)) throw new IllegalStateException(\"type not Hive-representable: \" + f.type()); });","typeGuard":null,"tryCatchPattern":"try { String ddl = HiveSchemaUtil.convert(schema); } catch (UnsupportedOperationException e) { /* replace offending type then retry */ }","preventionTips":["Keep Iceberg schemas within types expressible in Hive DDL when syncing to Hive.","Test schema round-trips early in migration design.","Substitute advanced types (e.g. variant) with string/struct before conversion."],"tags":["schema-conversion","unsupported-type","hive"],"backgroundTag":"unsupported-operation","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"}