{"record":{"id":"55249dd1bfdad0be","repo":"apache/beam","slug":"the-category-category-is-not-supported","errorCode":null,"errorMessage":"The category '{category}' is not supported.","messagePattern":"The category '(.+?)' is not supported\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/hcatalog/src/main/java/org/apache/beam/sdk/io/hcatalog/SchemaUtils.java","lineNumber":89,"sourceCode":"\n    switch (hCatFieldSchema.getCategory()) {\n      case PRIMITIVE:\n        {\n          if (!HCAT_TO_BEAM_TYPES_MAP.containsKey(hCatFieldSchema.getType())) {\n            throw new UnsupportedOperationException(\n                \"The Primitive HCat type '\"\n                    + field.getType()\n                    + \"' of field '\"\n                    + name\n                    + \"' cannot be converted to Beam FieldType\");\n          }\n\n          FieldType fieldType = HCAT_TO_BEAM_TYPES_MAP.get(hCatFieldSchema.getType());\n          return Schema.Field.of(name, fieldType).withNullable(true);\n        }\n        // TODO: Add Support for Complex Types i.e. ARRAY, MAP, STRUCT\n      default:\n        throw new UnsupportedOperationException(\n            \"The category '\" + hCatFieldSchema.getCategory() + \"' is not supported.\");\n    }\n  }\n}\n","sourceCodeStart":71,"sourceCodeEnd":94,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/hcatalog/src/main/java/org/apache/beam/sdk/io/hcatalog/SchemaUtils.java#L71-L94","documentation":"SchemaUtils.toBeamField currently supports only the PRIMITIVE category of HCatFieldSchema. Complex categories (ARRAY, MAP, STRUCT, UNION) fall into the default branch and throw UnsupportedOperationException, since complex-type support is explicitly a TODO in this library.","triggerScenarios":"Calling HCatalogIO.read() on a table whose schema contains any complex-typed column (array<...>, map<...>, struct<...>, uniontype<...>).","commonSituations":"Hive tables with nested/array columns common in log or JSON-ingest tables; attempting full-table reads instead of selecting scalar columns.","solutions":["Create a Hive view flattening or excluding complex columns and read that view","Extract nested fields into separate scalar columns via HiveQL (LATERAL VIEW / explode)","Contribute complex-type support by extending the switch in SchemaUtils with ARRAY/MAP/STRUCT handling","Use a different Beam IO (e.g. read the underlying files with ParquetIO) if complex types are essential"],"exampleFix":"// before\nCREATE TABLE t (tags array<string>);\n// after\nCREATE VIEW t_scalar AS SELECT ... other cols ... FROM t;\nHCatalogIO.read().withTable(\"t_scalar\")","handlingStrategy":"validation","validationCode":"boolean simple = hcatSchema.getFields().stream().allMatch(f -> { try { return HCatSchemaUtils.getHCatFieldSchema(f).getCategory()==Category.PRIMITIVE; } catch (HCatException e){ return false; } });","typeGuard":"null","tryCatchPattern":"try { ... } catch (UnsupportedOperationException e) { throw new IllegalArgumentException(\"Complex types not supported by HCatalogIO; use a flattened view\", e); }","preventionTips":["Design read-target tables with scalar columns only","Use Hive views to flatten complex columns","Consider ParquetIO for nested schemas","Track Beam releases for complex-type support"],"tags":["java","schema","hcatalog","complex-types"],"backgroundTag":"unsupported-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}