Hi Team - I have a quick question around external ...
# questions-and-troubleshooting
a
Hi Team - I have a quick question around external catalogs created in starrocks. Is there anyway the catalogs can be exposed with all the databases and the tables in IDE?
@Rocky Can you please help?
r
Hello! I'm Rocky, your StarRocks assistant. I'd be happy to help. Could you please provide more details about your question or the issue you're encountering? For example, are you looking for help with: * Installing or configuring StarRocks? * Writing a specific SQL query? * Performance tuning or troubleshooting an error? * Understanding a specific feature? Feel free to share any share any error messages or context you have!
a
@Rocky Is there anyway the external catalogs can be exposed with all the databases and the tables in IDE like Datagrip
r
Yes, you can expose catalogs, databases, and tables in DataGrip. To get the best experience with StarRocks' 3-tier hierarchy (Catalog > Database > Table), it is highly recommended to use the native StarRocks JDBC driver rather than the standard MySQL driver. 1. Use the StarRocks JDBC Driver (Recommended) The native StarRocks JDBC driver is designed to handle metadata discovery for catalogs. This allows DataGrip to browse the full schema, provide auto-completion, and introspect tables across different catalogs. * Download: You can find the
starrocks-connector-j
JAR on Maven Central. * DataGrip Setup: 1. Go to File > Data Sources. 2. In the Drivers tab, click + to create a new driver named "StarRocks". 3. Add the downloaded JAR file. 4. Set the Class to
com.starrocks.cj.jdbc.Driver
. 5. Set the URL template to
jdbc:starrocks://{host}:{port}
. 6. Create a new Data Source using this driver and connect using your FE host and query port (default
9030
). 2. Using the MySQL Driver (Alternative) If you prefer or must use the standard MySQL driver, be aware that it traditionally only shows the
default_catalog
. To see a specific external catalog, you must point the connection directly to it: * Connection String: In the DataGrip connection settings, set the Database field to the format:
catalog_name.database_name
(e.g.,
hive_catalog.my_db
). * Limitation: This method typically only exposes that specific database/catalog. You won't be able to browse all catalogs simultaneously in the sidebar as easily as with the native driver. 3. Tips for Visibility * Refresh Metadata: After connecting in DataGrip, the sidebar might only show the database list. You often need to right-click the database or catalog and select Refresh (or use the shortcut) to fetch and display the tables. * Privileges: Ensure the user you are connecting with has the
USAGE
privilege on the external catalogs. You can check your available catalogs by running
SHOW CATALOGS;
in a console. * DataGrip Schema Filter: If you don't see all databases, click the "N of M" button (schema selector) in the Database Explorer header and ensure the catalogs/databases you want to see are checked. References • integrations/IDE_integrations/DataGrip.md • data_source/catalog/jdbc_catalog.md • data_source/catalog/default_catalog.md • data_source/catalog/catalog_overview.md
Yes, you can expose StarRocks' 3-tier hierarchy (Catalog > Database > Table) in DataGrip. The most effective way to see all internal and external catalogs simultaneously is to use the native StarRocks JDBC driver instead of the standard MySQL driver. 1. Use the StarRocks JDBC Driver (Recommended) The native StarRocks JDBC driver (
starrocks-connector-j
) is optimized for StarRocks' metadata structure, allowing DataGrip to discover and browse all catalogs and databases in the sidebar. * Download: Get the latest
starrocks-connector-j
JAR from Maven Central. * DataGrip Setup: 1. Go to File > Data Sources. 2. In the Drivers tab, click + to create a new driver named "StarRocks". 3. Add the downloaded JAR file under Driver Files. 4. Set the Class to
com.starrocks.cj.jdbc.Driver
. 5. Set the URL template to
jdbc:starrocks://{host}:{port}
. 6. Create a new Data Source using this driver and connect to your FE host and query port (default
9030
). 2. Configure Visibility in DataGrip Even with the correct driver, DataGrip may not show all catalogs by default due to its introspection settings: * Select Schemas: In the Database Explorer sidebar, click the "N of M" button (next to the data source name) or the Schemas tab in the connection settings. Ensure that the external catalogs and databases you want to see are checked. * Refresh Metadata: After connecting, DataGrip often only loads the database names. You must right-click a catalog or database in the sidebar and select Refresh (or press
Cmd + Opt + R
/
Ctrl + Alt + R
) to introspect and display the tables. * Privileges: Ensure your user has
USAGE
privileges on the catalogs. You can verify what is visible to your user by running
SHOW CATALOGS;
in the console. 3. Using the MySQL Driver (Alternative) If you prefer the standard MySQL driver, you can still access external catalogs, but it is typically limited to one at a time: * In the Database field of the connection settings, use the format:
catalog_name.database_name
. * Note that the MySQL protocol does not naturally support the 3-tier hierarchy in the same way, so you may not be able to "browse" between different catalogs as easily as with the native StarRocks driver. Summary of Benefits Using the StarRocks JDBC Driver provides: * Full 3-tier browsing: See
default_catalog
alongside Hive, Iceberg, and JDBC catalogs. * Better Autocomplete: The IDE can index tables across different catalogs for SQL completion. * Accurate Metadata: Proper mapping of StarRocks-specific data types. References • integrations/IDE_integrations/DataGrip.md • data_source/catalog/jdbc_catalog.md • data_source/catalog/default_catalog.md • data_source/catalog/catalog_overview.md
a
@Rocky How about external catalogs how do we see external catalogs in the UI? the screenshot shows are internal schemas. Is there a way to expose external schema at the UI level?
r
To expose external catalogs and browse their databases and tables in DataGrip's UI, you should use the native StarRocks JDBC driver rather than the standard MySQL driver. The native driver is specifically designed to handle StarRocks' 3-tier metadata structure (Catalog > Database > Table). 1. Install the Native StarRocks JDBC Driver The standard MySQL driver often limits the view to a single database within the
default_catalog
. The StarRocks native driver allows DataGrip to discover all internal and external catalogs. * Download: Get the
starrocks-connector-j
JAR from Maven Central. * Create Driver in DataGrip: 1. Go to File > Data Sources. 2. In the Drivers tab, click + and create a new driver named "StarRocks". 3. Add the downloaded JAR file. 4. Set the Class to
com.starrocks.cj.jdbc.Driver
. 5. Set the URL template to
jdbc:starrocks://{host}:{port}
. 2. Configure the Data Source for Visibility Once the driver is set up, create a new Data Source using it: * Connection String: You can leave the "Database" field empty to see all catalogs, or specify a default in the format
catalog_name.database_name
. * Enable All Schemas: This is the most important step for UI visibility. 1. In the Data Source settings, go to the Schemas tab. 2. Check "All catalogs" and "All databases" (or specifically select the external catalogs you want to see). 3. If they don't appear immediately, click the Refresh button in that tab to force DataGrip to poll the StarRocks FE for the full list. 3. Browsing and Refreshing the UI * Database Explorer: After connecting, look at the Database Explorer sidebar. You should see a hierarchy where the top level represents your Catalogs (e.g.,
default_catalog
,
hive_catalog
,
iceberg_catalog
). * Forcing Introspection: DataGrip often only loads the top-level names initially to save resources. If you don't see tables: * Right-click on the specific external database in the sidebar and select Refresh. * This triggers the driver to fetch the table metadata for that specific external schema. Why this works The native driver implements the standard JDBC
DatabaseMetaData
API in a way that maps StarRocks' Catalogs to JDBC Catalogs. Standard MySQL drivers do not understand this 3-tier system and will typically only show the databases inside the catalog you are currently "logged into" (which defaults to
default_catalog
). References • integrations/IDE_integrations/DataGrip.md • data_source/catalog/catalog_overview.md • sql-reference/sql-statements/Catalog/SHOW_CATALOGS.md References • integrations/IDE_integrations/DataGrip.md • data_source/catalog/jdbc_catalog.md • data_source/catalog/default_catalog.md • data_source/catalog/catalog_overview.md