Skip to main content
A StarRocks catalog is an external catalog for querying native tables in another cluster without importing their data. It can also join remote tables with local tables. Unlike default_catalog, which represents the current cluster’s internal data, a StarRocks catalog connects to a remote cluster using a configured account. This guide calls the cluster running your SQL the querying cluster and the cluster owning the tables the data cluster. Both clusters must run builds that support the StarRocks catalog protocol and the selected scan transport. An FE HTTP endpoint alone does not make an older cluster compatible.

Prerequisites

  • On the querying cluster, the user creating the catalog needs the system-level CREATE EXTERNAL CATALOG privilege. Users querying it need the applicable catalog and table privileges. See Query external data.
  • On the data cluster, the account configured in the catalog needs SELECT on the tables to query. Requests use this configured account, not the querying user’s remote identity. Local permissions and remote permissions are separate checks; grant local access accordingly.
  • Querying FEs must reach the data cluster’s FE HTTP endpoints. Use the HTTP port, not the MySQL or FE RPC port.
  • For remote scans, querying BEs or CNs must reach the data cluster’s BE or CN addresses and the transport ports returned by that cluster. Making only the FE reachable is insufficient.
  • For direct reads, querying workers must reach the storage endpoints. The data cluster must also reach the credential service required by its storage provider.

Choose a scan transport

Remote scans support native tables and materialized views in the data cluster, including shared-nothing and shared-data tables. Remote views and tables belonging to another external catalog are not exposed as queryable tables through this catalog. direct_lake only supports shared-data tables and materialized views.

Create a catalog

Replace the endpoint hosts, ports, account, and password with your deployment’s values. The account in this example must already exist on the data cluster.
To use Arrow Flight, set starrocks.scan.transport to arrow_flight.

Connection and scan properties

Unknown properties are rejected. Do not use JDBC properties such as jdbc_uri, a Thrift endpoint property, or ranger.plugin.hive.service.name for this catalog.

Cache properties

Use positive values for cache intervals, capacities, and thread count. Non-positive values fall back to the defaults above. Database names, table names, and table schemas use TTL caches; the statistics refresh interval does not refresh these lists or schemas. Remote DDL and permission changes can therefore take time to appear in cached metadata. Remote scan preparation still checks the configured account’s permissions.

Query data

The following examples assume sales.orders exists on the data cluster and crm.customers exists in the querying cluster. Replace the database, table, and column names as needed.
The catalog exposes user databases; remote _statistics_, information_schema, and sys databases are excluded. It is a read interface: do not use it to create, insert into, update, or delete remote tables. To copy results into the querying cluster, use an existing local destination table with INSERT INTO ... SELECT ....

Direct reads

Note Currently, direct_lake does not support tables with cloud_native_fast_schema_evolution_v2=true. New shared-data tables enable this property by default, so even a table on S3 storage can be rejected. Use brpc_chunk or arrow_flight to query these tables instead. Use a separate catalog when you want to choose direct reads explicitly:
Storage access comes from the remote table’s storage volume. Do not add object-store keys to the catalog properties. Object-storage direct reads require the data cluster to issue temporary read-only credentials scoped to the table’s storage directories; issuance failure rejects the scan.
  • Supported object storage: S3-type volumes (AWS S3 and S3-compatible stores), Azure ADLS2, and Google Cloud Storage. The volume’s identity must be able to issue scoped credentials. For S3-type volumes, provider selection normally follows the endpoint; aws.s3.direct_read.vendor handles endpoints whose provider cannot be inferred. Valid values are aws, aliyun, tencent, huawei, and s3_compatible.
  • Huawei OBS: Disabled by default. Before setting aws.s3.direct_read.huawei.enabled=true on the source volume, use a dedicated identity with only the required OBS and applicable KMS permissions. This setting records an administrator assertion; it does not inspect IAM permissions.
  • HDFS: Disabled by default; requires hdfs.direct_read.allow_unscoped=true on the source volume. No scoped, read-only credential is issued. Effective HDFS permissions may allow other paths and writes or deletes. Enable only for a trusted querying cluster after reviewing permissions and NameNode/DataNode connectivity.
  • Unsupported direct-read storage: Azure Blob volumes without a hierarchical namespace. Use brpc_chunk or arrow_flight for these volumes or when direct-read access requirements cannot be met.
See Storage volume properties for the volume settings.

Query timeout and credential lifetime

For object storage, the data cluster requests credentials for max(starrocks_catalog_direct_read_sts_max_duration_second, 900) seconds, rather than for each query’s own timeout. The default requested lifetime is 3600 seconds. Credentials are cached and reused only while their remaining lifetime exceeds the statement’s timeout budget plus a 30-second safety margin. The budget includes the execution timeout (query_timeout for SELECT, insert_timeout for INSERT … SELECT or CTAS) and applicable query-queue waiting time. The credential reuse window can be shorter than requested because of the storage provider or role-session limits. A query that cannot be covered is rejected during preparation. Lower its timeout or configure a suitable credential lifetime and issuing identity on the data cluster. See the credential lifetime setting. GCS rejects tokens with an unknown expiration or a lifetime exceeding the requested ceiling by default. The source-volume option gcp.gcs.direct_read.allow_extended_lifetime=true explicitly accepts a longer provider lifetime. The ceiling still limits cache reuse and query admission, but does not shorten the actual token lifetime. Revoking SQL access does not revoke tokens already delivered. See Storage volume properties for details. The timeout budget must also not exceed the data cluster’s lake_autovacuum_grace_period_minutes (converted to seconds), because direct-read versions are not pinned against vacuum. A query exceeding this bound is rejected before scanning.

Row-access and column-masking policies

Direct reads cannot enforce the data cluster’s row-access or column-masking policies. By default, querying an affected table through direct_lake fails. To allow a remote scan that enforces these policies on the data cluster:
Ensure the remote-scan network prerequisites are also met. This switch applies to policy-related fallback; it is not a general fallback for storage or credential failures. Ordinary EXPLAIN skips the remote policy probe and still shows a direct-read plan, even when execution would fall back. To observe an actual fallback, use EXPLAIN ANALYZE (which executes the query), or inspect the profile or execution plan of an executed query. See System variables for this switch.

Manage the catalog and refresh metadata

REFRESH EXTERNAL TABLE can be run with the REFRESH privilege on the external table. The ALTER privilege is also accepted for compatibility. It invalidates the cached table metadata, its database’s table-name list, and the table’s statistics, then reloads the table metadata. Statistics are loaded again on demand. It does not refresh the database-name list, so it cannot make a newly created remote database visible immediately. With caching disabled, it has no cache to refresh. See REFRESH EXTERNAL TABLE. To remove the local catalog definition without deleting remote data:

Troubleshooting