Manage metadata

Updated at:
Copy as MD

The Metadata Management feature lets you view information about all databases, tables, partitions, and tasks within your instance. You can also create databases and tables, and define their columns and properties.

Prerequisites

A StarRocks instance has been created. For more information, see Create an instance.

Limitations

  • Standard users cannot view database size, cached data size, or the number of tables.

  • Standard users cannot view the complete task list.

View metadata

  1. Go to the StarRocks Manager page.

    1. Log on to the E-MapReduce console.

    2. In the left navigation pane, choose EMR Serverless > StarRocks.

    3. In the top menu bar, select the region.

    4. Click StarRocks Manager, or click Connect in the Actions column for the target instance. For details, see Connect to a StarRocks instance using EMR StarRocks Manager.

  2. In the navigation pane on the left, click Metadata Management.

  3. On the Catalogs page, click the name of the catalog you want to view.

    This page displays all databases in the current catalog.

    Important

    Do not delete the _starrocks_audit_db_ database or the starrocks_audit_tbl table. Deleting either prevents the SQL task query feature from working in StarRocks Manager.

  4. Click the name of a database to view details about its tables, views, and tasks.

    Tab

    Description

    Table

    Displays all tables in the current database. You can click a table name to view its details, including table size, cache size and type, partition information, and shard distribution across nodes. You can also sort the tables by size in ascending or descending order.

    Views

    Displays details for all views in the current database. A view is a virtual table defined by a SQL query and does not store data. The following sections are available:

    • View details: Displays all columns of the view and their properties, including column name, nullability, data type, and description.

    • Basic information: Displays basic information about the view, such as its data catalog, database name, type, creation time, and last modification time.

    • DDL: Displays the view's definition (CREATE VIEW statement), revealing its query logic and dependencies on the underlying tables.

    • Data preview: Previews the first 100 rows of data from the view. The preview is generated dynamically based on the view's definition and reflects the real-time state of the underlying physical tables.

    Materialized views

    Displays details for all materialized views in the current database. A materialized view is a physical table based on a SQL query that stores pre-computed results to accelerate complex queries. The following sections are available:

    • Basic information: Displays core properties of the materialized view, including its ID, name, and database. It also shows the view's SQL definition, revealing its query logic and underlying table dependencies.

    • Task list: Displays task records related to the materialized view, including the task name, view name, and database name.

    • Dashboard: Displays operational and performance metrics for the materialized view, such as storage size, partition count, and row count.

    • Data preview: Previews the first 100 rows of data from the materialized view.

    Tasks

    Displays all tasks in the current database.

    • Kafka import: Displays information about Routine Load tasks that import data from Kafka.

    • Other import: Displays information about data import tasks other than Kafka imports.

      Note

      Because Stream Load is a synchronous import method, its tasks are not displayed in this list.

    • Export: Displays information about tasks that export data to external storage.

    • Table Schema Change: Displays information about Schema Change tasks.

    • Materialized view creation: Displays information about all materialized view creation tasks in the current database.

Create a DLF catalog

  1. Open the Create Catalog dialog box.

    You can open the Create Catalog dialog box in one of two ways:

    • Method 1: From the Metadata Management page

      On the Metadata Management page, click Create Catalog.

    • Method 2: From the StarRocks Manager page

      In the navigation pane on the left of the StarRocks Manager page, choose Create > Catalog.

  2. In the Add Data Catalog dialog box, configure the following parameters.

    Parameter

    Description

    Catalog type

    Select DLF Data Catalog.

    Catalog name

    Enter a name for the catalog. The name must be 2 to 64 characters and can contain only letters, digits, hyphens (-), periods (.), and underscores (_).

    DLF data catalog

    Select an existing DLF data catalog from the drop-down list. If you do not have one, you can go to the DLF console to create one.

    Data type

    Select Paimon or Iceberg.

    • Paimon: For high-performance data lake use cases.

    • Iceberg: For large-scale data analytics use cases.

    User information

    The system automatically displays the current user and the associated RAM user.

    Without an associated RAM user, you cannot access the DLF data catalog after you create it.

  3. Confirm the configuration and click OK to create the DLF catalog.

Create a database

  1. Open the Create Database dialog box.

    You can open the Create Database dialog box in one of two ways:

    • Method 1: From the Metadata Management page

      1. On the Metadata Management page, click the name of the catalog where you want to create the database.

      2. Click Create.

    • Method 2: From the StarRocks Manager page

      In the navigation pane on the left of the StarRocks Manager page, choose Create > Database.

  2. In the Create Database dialog box, configure the parameters, and then click OK.

    The Preview section shows the SQL statement used to create the database. For more information, see CREATE DATABASE.

Create a table

  1. Open the Create Table dialog box.

    You can open the Create Table dialog box in one of two ways:

    • Method 1: From the Metadata Management page

      1. On the Metadata Management page, click the name of the catalog that you want to use.

      2. Click the target database.

      3. On the Table tab, click Create.

    • Method 2: From the StarRocks Manager page

      In the navigation pane on the left of the StarRocks Manager page, choose Create > Table.

  2. In the Create Table dialog box, configure the basic information, Columns, and Properties, and then click OK.

    The Preview section shows the SQL statement used to create the table. For more information, see CREATE TABLE.

FAQ

  • Q1: Why can't I access data after I create a DLF catalog?

    A: Ensure the associated RAM user has read and write permissions on the corresponding DLF data catalog in the DLF console.

  • Q2: Why is the DLF data catalog drop-down list empty, or why doesn't a newly added catalog appear?

    A: This means that either no DLF data catalogs are available under the current account or your RAM user lacks permission to access them. Go to the DLF console to create a data catalog and attach the appropriate permission policy to the target RAM user.