All Products
Search
Document Center

Realtime Compute for Apache Flink:Manage StarRocks catalogs

Last Updated:Mar 26, 2026

StarRocks catalogs let you access StarRocks metadata—databases, tables, and partitions—directly in the Realtime Compute for Apache Flink development console, without manually writing DDL statements for each table. Flink maps StarRocks tables automatically so you can query or write data right away.

This topic covers how to create, view, use, and drop a StarRocks catalog.

Limitations

  • StarRocks catalogs require engine version vvr-6.0.6-flink-1.15 or later.

  • StarRocks catalogs are read-only with respect to schema: you cannot create or modify StarRocks tables through a catalog.

Create a StarRocks catalog

Two methods are available: the console UI and Flink SQL. The UI is the recommended method.

Create a StarRocks catalog on the console

  1. Log on to the Realtime Compute for Apache Flink console. Find the workspace you want to manage and click Console in the Actions column.

  2. In the left-side navigation pane, click Catalogs.

  3. On the Catalog List page, click Create Catalog. In the Create Catalog wizard, select StarRocks on the Built-in Catalog tab and click Next.

  4. Configure the catalog parameters.

    Important

    StarRocks catalog configurations cannot be modified after creation. To change any setting, drop the existing catalog and create a new one.

    ParameterDescriptionRequiredNotes
    catalog nameName of the StarRocks catalog.YesLowercase letters and digits only. Hyphens (-), underscores (_), and uppercase letters are not allowed.
    endpointEndpoint of a FrontEnd (FE) node.YesFormat: jdbc:mysql://ip:port. The default JDBC port is 9030.
    dbnameDefault StarRocks database to connect to.Yes
    usernameUsername for accessing StarRocks.Yes
    passwordPassword for accessing StarRocks.YesUse a variable instead of a plaintext password to avoid credential exposure. See Manage variables.

    image

  5. Click Confirm.

The catalog appears on the Catalog List page.

Create a StarRocks catalog using Flink SQL

In the SQL editor on the Scripts page, enter a CREATE CATALOG statement, select the statement, and click Run on the left side.

CREATE CATALOG <catalogname> WITH (
  'type' = 'starrocks',
  'endpoint' = '<ip>:<port>',
  'username' = '<userName>',
  'password' = '<password>',
  'dbname' = '<dbname>'
);
image..png

The configuration options differ depending on your VVR version.

VVR 11+

OptionDescriptionRequiredNotes
catalognameName of the StarRocks catalog.YesLowercase letters (a–z) and digits (0–9) only.
typeConnector type.YesSet to starrocks.
endpointFrontEnd (FE) endpoint.NoFormat: jdbc:mysql://ip:port. Default port: 9030. Use this option to avoid configuring jdbc-url and http-url separately.
jdbc-urlJDBC URL for the FE MySQL server.NoSeparate multiple addresses with commas. Format: jdbc:mysql://<fe_host1>:<fe_query_port1>,<fe_host2>:<fe_query_port2>. Must be used together with http-url.
http-urlHTTP URL for the FE HTTP server.NoSeparate multiple addresses with semicolons. Format: <fe_host1>:<fe_http_port1>;<fe_host2>:<fe_http_port2>. Must be used together with jdbc-url.
usernameUsername for accessing StarRocks.Yes
passwordPassword for accessing StarRocks.YesUse a variable instead of a plaintext value. See Namespace variables.
dbnameDefault database to connect to.NoEquivalent to default-database. Use either one.
default-databaseDefault database to connect to.NoCompatibility alias for dbname. Use either one.
table.num-bucketsDefault number of buckets per partition for tables created through the catalog.No
table.char-expand-multipleMultiplier applied to VARCHAR and CHAR column lengths when creating tables through the catalog.NoDefault: 4.
table.binary-paddingNumber of characters added to VARBINARY and BINARY column lengths when creating tables through the catalog.NoDefault: 2.
table.key-typeTable type for tables created through the catalog.NoValid values: PRI (default, primary key table), UNI (unique key table), AGG (aggregate table), DUP (duplicate key table).
table.keysKey fields for tables created through the catalog.No
table.distribution-keysDistribution key fields for tables created through the catalog.No
table.enable-null-primary-keyWhether Flink treats nullable primary key columns in StarRocks as non-nullable.NoValid values: false (default), true. When set to true, make sure upstream data has no NULL values in primary key columns to avoid unexpected behavior.

VVR 8 and earlier

OptionDescriptionRequiredNotes
catalognameName of the StarRocks catalog.YesLowercase letters (a–z) and digits (0–9) only.
typeConnector type.YesSet to starrocks.
endpointFrontEnd (FE) endpoint.YesFormat: jdbc:mysql://ip:port. Default port: 9030.
usernameUsername for accessing StarRocks.Yes
passwordPassword for accessing StarRocks.YesUse a variable instead of a plaintext value. See Namespace variables.
dbnameDefault database to connect to.Yes

View a StarRocks catalog

  1. Log on to the Realtime Compute for Apache Flink console. Find the workspace you want and click Console in the Actions column.

  2. In the left-side navigation pane, click Catalogs.

  3. On the Catalog List page, find the catalog. The Name and Type columns show its basic details.

    Note

    To browse the databases and tables inside the catalog, click View in the Actions column.

Use a StarRocks catalog

A catalog exposes StarRocks data as a three-level namespace: catalog_name.db_name.table_name. Reference tables in Flink SQL using backtick-quoted identifiers at each level.

Flink namespace levelStarRocks equivalent
Catalog nameDefined in Flink only
Database nameStarRocks database name
Table nameStarRocks table name

Read data from a StarRocks table

VVR 11+

INSERT INTO ${other_sink_table}
SELECT ...
FROM `${catalog_name}`.`${db_name}`.`${table_name}`

VVR 8 and earlier

The OPTIONS hint is required to specify the connector parameters for the source table.

INSERT INTO ${other_sink_table}
SELECT ...
FROM `${catalog_name}`.`${db_name}`.`${table_name}`
    /*+
        OPTIONS('connector' = 'starrocks', 'jdbc-url' = 'jdbc:mysql://ip:port', 'scan-url' = 'ip:port')
    */

Write data to a StarRocks table

VVR 11+

INSERT INTO `${catalog_name}`.`${db_name}`.`${table_name}`
SELECT ...
FROM ${other_source_table}

VVR 8 and earlier

The OPTIONS hint is required to specify the connector parameters for the result table.

INSERT INTO `${catalog_name}`.`${db_name}`.`${table_name}`
    /*+
        OPTIONS('connector' = 'starrocks', 'jdbc-url' = 'jdbc:mysql://ip:port', 'load-url' = 'ip:port', 'sink.buffer-flush.interval-ms' = '5000', 'sink.properties.row_delimiter' = '\x02', 'sink.properties.column_separator' = '\x01')
    */
SELECT ...
FROM ${other_source_table}

Use CTAS or CDAS to write to StarRocks

CTAS (CREATE TABLE AS SELECT) and CDAS (CREATE DATABASE AS DATABASE) let you create StarRocks tables or databases from existing sources in a single statement.

USE CATALOG sr_catalog;

CREATE TABLE IF NOT EXISTS `${table_name}`
WITH (
  ...
) AS TABLE ${other_source_table};


CREATE DATABASE IF NOT EXISTS `${db_name}`
WITH (
  ...
) AS DATABASE ${other_source_database};

For a complete walkthrough, see Ingest data from MySQL to StarRocks with Flink.

Drop a StarRocks catalog

Important

Dropping a catalog does not affect running deployments. However, deployments that are not yet published or that need to be suspended will be affected. Proceed with caution.

Two methods are available: the console UI and Flink SQL. The UI is the recommended method.

Drop a StarRocks catalog on the console

  1. Log on to the Realtime Compute for Apache Flink console. Find the workspace you want and click Console in the Actions column.

  2. In the left-side navigation pane, click Catalogs.

  3. On the Catalog List page, find the catalog and click Delete in the Actions column.

  4. In the confirmation dialog, click Delete.

The catalog is removed from the Catalogs pane in the left-side navigation.

Drop a StarRocks catalog using Flink SQL

In the SQL editor on the Scripts page, enter the following statement, right-click it, and select Run.

DROP CATALOG `<catalog name>`;

Replace <catalog name> with the name of the catalog you want to drop.

After the statement runs, verify the catalog is removed by checking the Catalogs pane in the left-side navigation.