<@U0A71G31CDV> Is there a way to add multiple exis...
# questions-and-troubleshooting
c
@Rocky Is there a way to add multiple existing iceberg jdbc catalog named 'jdbc_catalog'. It seems to only support one
r
Yes, you can add multiple Iceberg JDBC catalogs to StarRocks. However, there are two different levels of "naming" you need to consider to avoid conflicts. 1. StarRocks Catalog Name In StarRocks, every external catalog must have a unique name. If you have already created a catalog named
jdbc_catalog
, you cannot create another one with the same name. You must provide a different name for the second one:
Copy code
sql
-- First catalog
CREATE EXTERNAL CATALOG iceberg_jdbc_1
PROPERTIES (
    "type" = "iceberg",
    "iceberg.catalog.type" = "jdbc",
    "iceberg.catalog.uri" = "jdbc:<mysql://ip1:port/db1>",
    ...
);

-- Second catalog (must have a different name)
CREATE EXTERNAL CATALOG iceberg_jdbc_2
PROPERTIES (
    "type" = "iceberg",
    "iceberg.catalog.type" = "jdbc",
    "iceberg.catalog.uri" = "jdbc:<mysql://ip2:port/db2>",
    ...
);
2. Internal Iceberg Catalog Name If you are trying to connect to multiple Iceberg catalogs stored within the same JDBC database, they are distinguished by a
catalog_name
column in the JDBC metadata tables (like
iceberg_tables
). By default, many Iceberg implementations (including StarRocks') may default this internal name to
jdbc_catalog
. If you need to point StarRocks to a specific named catalog instance inside your JDBC database, you can try passing the
iceberg.catalog.name
property:
Copy code
sql
CREATE EXTERNAL CATALOG my_iceberg_catalog
PROPERTIES (
    "type" = "iceberg",
    "iceberg.catalog.type" = "jdbc",
    "iceberg.catalog.name" = "custom_internal_name", -- Tells Iceberg which catalog to look for in the DB
    "iceberg.catalog.uri" = "jdbc:<mysql://ip:port/db_name>",
    ...
);
Key Requirements * Version: Ensure you are on StarRocks v3.5.0 or later, as official support for Iceberg JDBC catalogs was introduced in that version range. * Drivers: Ensure the appropriate JDBC driver (e.g., MySQL or PostgreSQL) is placed in the
fe/lib
and
be/lib/jni-packages
directories of all nodes. * Unique URIs: If the catalogs are in different databases, simply using different StarRocks catalog names (as shown in point 1) is sufficient. References • data_source/catalog/iceberg/iceberg_catalog.md • data_source/catalog/jdbc_catalog.md
c
If the catalog name is different from the actual catalog name, only information_schema is available. Is there a way to alias the catalog at least?