apache/beam · error · UnsupportedOperationException
The category ' ' is not supported.
Error message
The category '{category}' is not supported. What it means
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.
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
Example fix
// before
CREATE TABLE t (tags array<string>);
// after
CREATE VIEW t_scalar AS SELECT ... other cols ... FROM t;
HCatalogIO.read().withTable("t_scalar") Defensive patterns
Strategy: validation
Validate before calling
boolean simple = hcatSchema.getFields().stream().allMatch(f -> { try { return HCatSchemaUtils.getHCatFieldSchema(f).getCategory()==Category.PRIMITIVE; } catch (HCatException e){ return false; } }); Type guard
null
Try / catch
try { ... } catch (UnsupportedOperationException e) { throw new IllegalArgumentException("Complex types not supported by HCatalogIO; use a flattened view", e); } Prevention
- 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
When it happens
Trigger: Calling HCatalogIO.read() on a table whose schema contains any complex-typed column (array<...>, map<...>, struct<...>, uniontype<...>).
Common situations: Hive tables with nested/array columns common in log or JSON-ingest tables; attempting full-table reads instead of selecting scalar columns.
Related errors
- Error while converting FieldSchema to HCatFieldSchema
- The Primitive HCat type
- Arrow schema conversion does not support Beam type
- Cannot call getFromRowFunction when there is no schema
- Cannot call getSchema when there is no schema
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/55249dd1bfdad0be.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/io/hcatalog/src/main/java/org/apache/beam/sdk/io/hcatalog/SchemaUtils.java:89
switch (hCatFieldSchema.getCategory()) {
case PRIMITIVE:
{
if (!HCAT_TO_BEAM_TYPES_MAP.containsKey(hCatFieldSchema.getType())) {
throw new UnsupportedOperationException(
"The Primitive HCat type '"
+ field.getType()
+ "' of field '"
+ name
+ "' cannot be converted to Beam FieldType");
}
FieldType fieldType = HCAT_TO_BEAM_TYPES_MAP.get(hCatFieldSchema.getType());
return Schema.Field.of(name, fieldType).withNullable(true);
}
// TODO: Add Support for Complex Types i.e. ARRAY, MAP, STRUCT
default:
throw new UnsupportedOperationException(
"The category '" + hCatFieldSchema.getCategory() + "' is not supported.");
}
}
}
View on GitHub (pinned to 12126d8942)