apache/beam · error · UnsupportedOperationException
Creating tables in HCatalog is not supported
Error message
Creating tables in HCatalog is not supported
What it means
The HCatalogTableProvider (top-level catalog for hcatalog table type) rejects DDL: createTable throws UnsupportedOperationException because tables must be defined in the Hive metastore, not via Beam SQL.
Solutions
- Create tables in Hive/HCatalog before referencing them in Beam SQL.
- Guard framework code so it doesn't call createTable on read-only providers.
- Use a provider type that supports DDL for table creation workflows.
Example fix
// before provider.createTable(tblSpec); // after // issue HiveQL DDL via Hive metastore client first, then query from Beam
Defensive patterns
Strategy: validation
Validate before calling
if (provider instanceof HCatalogTableProvider && creatingTables) {
throw new IllegalArgumentException("Create tables in Hive metastore first");
} Try / catch
try {
provider.createTable(table);
} catch (UnsupportedOperationException e) {
// run DDL via Hive/metastore client instead
} Prevention
- Pre-provision hcatalog tables with Hive DDL.
- Check getTableType() before invoking generic DDL paths.
- Keep Beam SQL queries free of CREATE TABLE for hcatalog.
When it happens
Trigger: Calling createTable(Table) on HCatalogTableProvider, e.g. when a CREATE TABLE statement targets an hcatalog catalog.
Common situations: Same as 1232 but at the top-level provider: DDL scripts ported from other providers; framework code that generically calls createTable on any TableProvider.
Related errors
- Creating tables is not supported in HCatalog
- Deleting tables in HCatalog is not supported
- Deleting tables is not supported in HCatalog
- 'CREATE TABLE' is not supported in SQL. You can use 'CREATE…
- Extracting all tables from HCatalog is not supported
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/391d34bc33001a59.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/extensions/sql/hcatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/hcatalog/HCatalogTableProvider.java:69
this.metastoreSchema = metastoreSchema;
}
public static HCatalogTableProvider create(Map<String, String> configuration) {
HCatalogBeamSchema metastoreSchema = HCatalogBeamSchema.create(configuration);
return new HCatalogTableProvider(
new HashMap<>(configuration),
metastoreSchema,
new DatabaseProvider("default", metastoreSchema, configuration));
}
@Override
public String getTableType() {
return "hcatalog";
}
@Override
public void createTable(Table table) {
throw new UnsupportedOperationException("Creating tables in HCatalog is not supported");
}
@Override
public void dropTable(String tableName) {
throw new UnsupportedOperationException("Deleting tables in HCatalog is not supported");
}
@Override
public Map<String, Table> getTables() {
throw new UnsupportedOperationException("Extracting all tables from HCatalog is not supported");
}
@Nullable
@Override
public Table getTable(String name) {
// Tables should have been looked up from sub-providers.
// If we reached this then getSubProvider(name) returned null
// meaning there's no such DB. Try to look up the table in the default DB instead.View on GitHub (pinned to 12126d8942)