{"record":{"id":"756883ee299be2f5","repo":"apache/iceberg","slug":"cannot-create-the-table-with-connector-iceberg-756883","errorCode":null,"errorMessage":"Cannot create the table with 'connector'='iceberg' table property in an iceberg catalog, Please create table with 'connector'='iceberg' property in a non-iceberg catalog or create table without 'connector'='iceberg' related properties in an iceberg table.","messagePattern":"Cannot create the table with 'connector'='iceberg' table property in an iceberg catalog, Please create table with 'connector'='iceberg' property in a non-iceberg catalog or create table without 'connector'='iceberg' related properties in an iceberg table\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java","lineNumber":420,"sourceCode":"          toIdentifier(new ObjectPath(tablePath.getDatabaseName(), newTableName)));\n    } catch (org.apache.iceberg.exceptions.NoSuchTableException e) {\n      if (!ignoreIfNotExists) {\n        throw new TableNotExistException(getName(), tablePath, e);\n      }\n    } catch (AlreadyExistsException e) {\n      throw new TableAlreadyExistException(getName(), tablePath, e);\n    }\n  }\n\n  @Override\n  public void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ignoreIfExists)\n      throws CatalogException, TableAlreadyExistException {\n    // Creating Iceberg table using connector is allowed only when table is created using LIKE\n    if (Objects.equals(\n            table.getOptions().get(FlinkCreateTableOptions.CONNECTOR_PROPS_KEY),\n            FlinkDynamicTableFactory.FACTORY_IDENTIFIER)\n        && table.getOptions().get(FlinkCreateTableOptions.SRC_CATALOG_PROPS_KEY) == null) {\n      throw new IllegalArgumentException(\n          \"Cannot create the table with 'connector'='iceberg' table property in \"\n              + \"an iceberg catalog, Please create table with 'connector'='iceberg' property in a non-iceberg catalog or \"\n              + \"create table without 'connector'='iceberg' related properties in an iceberg table.\");\n    }\n\n    Preconditions.checkArgument(\n        table instanceof ResolvedCatalogTable,\n        \"Expected a ResolvedCatalogTable but got: %s. \"\n            + \"Iceberg Flink catalog only supports resolved catalog tables \"\n            + \"(Materialized tables and other table kinds are not supported).\",\n        table == null ? \"null\" : table.getClass().getName());\n    createIcebergTable(tablePath, (ResolvedCatalogTable) table, ignoreIfExists);\n  }\n\n  void createIcebergTable(ObjectPath tablePath, ResolvedCatalogTable table, boolean ignoreIfExists)\n      throws CatalogException, TableAlreadyExistException {\n    validateFlinkTable(table);\n","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java#L402-L438","documentation":"An IllegalArgumentException from FlinkCatalog.createTable rejecting DDL that sets 'connector'='iceberg' in the table options while creating the table inside an Iceberg catalog. In an Iceberg catalog the connector property is implicit; explicitly passing it is only allowed for CREATE TABLE LIKE flows that carry the source-catalog marker property.","triggerScenarios":"Running CREATE TABLE ... WITH ('connector'='iceberg') against an Iceberg catalog where the options contain FlinkCreateTableOptions.CONNECTOR_PROPS_KEY='iceberg' but lack the SRC_CATALOG_PROPS_KEY marker set by the LIKE/CTAS machinery.","commonSituations":"Users copying Flink SQL written for a generic (non-Iceberg) Flink catalog (e.g. filesystem/hive connector registration) and executing it against an Iceberg catalog; templated DDL generators that always emit the connector option; SQL client sessions configured with the Iceberg catalog but statements written for the default catalog.","solutions":["Remove the 'connector'='iceberg' (and related) table options from the CREATE TABLE statement and just define columns/options.","If you need a Flink dynamic table over an existing Iceberg table, register a non-Iceberg catalog or use CREATE TABLE LIKE, which sets the required marker property.","Use the Iceberg catalog's table creation path (columns/partition-by/location options) instead of connector-style options."],"exampleFix":"// before\nCREATE TABLE t (id BIGINT) WITH ('connector'='iceberg');\n// after\nCREATE TABLE t (id BIGINT);","handlingStrategy":"validation","validationCode":"Map<String,String> opts = table.getOptions();\nif (\"iceberg\".equals(opts.get(\"connector\"))) { throw new IllegalArgumentException(\"drop connector option for iceberg catalog\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never include 'connector'='iceberg' in WITH options when using an Iceberg catalog","Only set connector options when registering tables in generic Flink catalogs","Use CREATE TABLE LIKE when copying connector-style definitions"],"tags":["flink","ddl","connector-property","validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}