apache/iceberg · error · java.lang.UnsupportedOperationException

Unknown catalog-type: %s (Must be 'hive', 'hadoop' or 'rest'

Error message

Unknown catalog-type: %s (Must be 'hive', 'hadoop' or 'rest')

What it means

FlinkCatalogFactory.createCatalogLoader switches on the configured 'catalog-type' and only supports 'hive', 'hadoop', and 'rest'. Any other value falls through to default and throws UnsupportedOperationException with 'Unknown catalog-type: %s (Must be 'hive', 'hadoop' or 'rest')'.

Source

Thrown at flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalogFactory.java:119

    String catalogType = properties.getOrDefault(ICEBERG_CATALOG_TYPE, ICEBERG_CATALOG_TYPE_HIVE);
    switch (catalogType.toLowerCase(Locale.ROOT)) {
      case ICEBERG_CATALOG_TYPE_HIVE:
        // The values of properties 'uri', 'warehouse', 'hive-conf-dir' are allowed to be null, in
        // that case it will
        // fallback to parse those values from hadoop configuration which is loaded from classpath.
        String hiveConfDir = properties.get(HIVE_CONF_DIR);
        String hadoopConfDir = properties.get(HADOOP_CONF_DIR);
        Configuration newHadoopConf = mergeHiveConf(hadoopConf, hiveConfDir, hadoopConfDir);
        return CatalogLoader.hive(name, newHadoopConf, properties);

      case ICEBERG_CATALOG_TYPE_HADOOP:
        return CatalogLoader.hadoop(name, hadoopConf, properties);

      case ICEBERG_CATALOG_TYPE_REST:
        return CatalogLoader.rest(name, hadoopConf, properties);

      default:
        throw new UnsupportedOperationException(
            "Unknown catalog-type: " + catalogType + " (Must be 'hive', 'hadoop' or 'rest')");
    }
  }

  @Override
  public String factoryIdentifier() {
    return FACTORY_IDENTIFIER;
  }

  @Override
  public Set<ConfigOption<?>> requiredOptions() {
    return ImmutableSet.<ConfigOption<?>>builder().build();
  }

  @Override
  public Set<ConfigOption<?>> optionalOptions() {
    return ImmutableSet.<ConfigOption<?>>builder().build();
  }

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Set 'catalog-type' to exactly one of 'hive', 'hadoop', or 'rest'
  2. If you need another catalog type (jdbc, nessie, glue), use a Flink version/module that supports it or configure it via a custom CatalogLoader
  3. Check for case or whitespace issues in the configured value

Example fix

// before
CREATE CATALOG ice WITH ('type'='iceberg', 'catalog-type'='jdbc', ...);

// after
CREATE CATALOG ice WITH ('type'='iceberg', 'catalog-type'='hive', 'uri'='thrift://metastore:9083');
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = Set.of("hive", "hadoop", "rest");
if (!allowed.contains(catalogType)) { throw new IllegalArgumentException("catalog-type must be hive|hadop|rest"); }

Prevention

When it happens

Trigger: Setting Flink option 'catalog-type' (factory identifier iceberg) to a misspelled or unsupported value such as 'jdbc', 'nessie', 'glue', 'HADOOP', or an empty string when creating an Iceberg catalog via SQL DDL.

Common situations: Copying catalog configs from Iceberg core (which supports more catalog implementations) into Flink SQL; typos like 'hadoop' vs 'hdfs'; assuming JDBC/Nessie catalogs are wired in this Flink module; case-sensitivity mistakes.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/53fa1f62e1771a36. Report an issue: GitHub.