{"record":{"id":"a620e4586e047949","repo":"apache/iceberg","slug":"unknown-catalog-type-s-must-be-hive-hadoop-a620e4","errorCode":null,"errorMessage":"Unknown catalog-type: %s (Must be 'hive', 'hadoop' or 'rest')","messagePattern":"Unknown catalog-type: (.+?) \\(Must be 'hive', 'hadoop' or 'rest'\\)","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalogFactory.java","lineNumber":119,"sourceCode":"    String catalogType = properties.getOrDefault(ICEBERG_CATALOG_TYPE, ICEBERG_CATALOG_TYPE_HIVE);\n    switch (catalogType.toLowerCase(Locale.ROOT)) {\n      case ICEBERG_CATALOG_TYPE_HIVE:\n        // The values of properties 'uri', 'warehouse', 'hive-conf-dir' are allowed to be null, in\n        // that case it will\n        // fallback to parse those values from hadoop configuration which is loaded from classpath.\n        String hiveConfDir = properties.get(HIVE_CONF_DIR);\n        String hadoopConfDir = properties.get(HADOOP_CONF_DIR);\n        Configuration newHadoopConf = mergeHiveConf(hadoopConf, hiveConfDir, hadoopConfDir);\n        return CatalogLoader.hive(name, newHadoopConf, properties);\n\n      case ICEBERG_CATALOG_TYPE_HADOOP:\n        return CatalogLoader.hadoop(name, hadoopConf, properties);\n\n      case ICEBERG_CATALOG_TYPE_REST:\n        return CatalogLoader.rest(name, hadoopConf, properties);\n\n      default:\n        throw new UnsupportedOperationException(\n            \"Unknown catalog-type: \" + catalogType + \" (Must be 'hive', 'hadoop' or 'rest')\");\n    }\n  }\n\n  @Override\n  public String factoryIdentifier() {\n    return FACTORY_IDENTIFIER;\n  }\n\n  @Override\n  public Set<ConfigOption<?>> requiredOptions() {\n    return ImmutableSet.<ConfigOption<?>>builder().build();\n  }\n\n  @Override\n  public Set<ConfigOption<?>> optionalOptions() {\n    return ImmutableSet.<ConfigOption<?>>builder().build();\n  }","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalogFactory.java#L101-L137","documentation":"FlinkCatalogFactory.createCatalogLoader selects a CatalogLoader based on the 'catalog-type' property, which must be 'hive', 'hadoop' or 'rest'. If the configured value matches none of the known constants, the switch falls through to default and throws UnsupportedOperationException. It is a configuration error indicating a mistyped or unsupported catalog-type value.","triggerScenarios":"Setting the Flink table/DDL option 'catalog-type' (or CatalogProperties ICEBERG_CATALOG_TYPE) to any value other than 'hive', 'hadoop' or 'rest' — e.g. a typo like 'hdfs', 'jdbc', 'nessie', or wrong casing — when calling createCatalogLoader via catalogLoader.","commonSituations":"Copying a catalog config from another engine that supports more catalog types (jdbc, nessie); typos in the CREATE CATALOG ... WITH ('catalog-type'='...') clause; assuming case-insensitive values like 'Hive'.","solutions":["Set 'catalog-type' to exactly one of 'hive', 'hadoop' or 'rest' (lowercase).","Check the concrete value with a log/print of the properties passed to the factory; fix the typo.","If you need a catalog type not in this list (e.g. jdbc/nessie), use a Flink/Iceberg version that supports it or a custom CatalogLoader — this factory only supports the three."],"exampleFix":"// before\nCREATE CATALOG iceberg WITH ('type'='iceberg', 'catalog-type'='nessie');\n// after\nCREATE CATALOG iceberg WITH ('type'='iceberg', 'catalog-type'='rest', 'uri'='http://nessie:19120/api/v2');","handlingStrategy":"validation","validationCode":"java.util.Set<String> supported = java.util.Set.of(\"hive\", \"hadoop\", \"rest\");\nString type = options.get(\"catalog-type\");\nif (type == null || !supported.contains(type)) {\n  throw new IllegalArgumentException(\"catalog-type must be hive|hadop... actually one of \" + supported + \", got: \" + type);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use lowercase literal values 'hive', 'hadoop', 'rest' for catalog-type.","Keep catalog config in version-controlled SQL/scripts and review before submitting.","When porting configs between engines, verify each option against this factory's supported set."],"tags":["flink","catalog","configuration","unsupported-operation"],"backgroundTag":"invalid-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}