tencent cloud

Stream Compute Service

StarRocks External Table Queries

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-07-03 15:10:13

Overview

Setats supports OLAP queries through the StarRocks external table method. Users can create a Setats External Catalog in StarRocks to directly query the columnar snapshot data of Setats tables, meeting requirements for real-time reporting, interactive analysis, and detailed data lookup.
Note:
To use the Setats service, you must upgrade your StarRocks cluster version. Please submit a ticket to apply.

Prerequisites

You have created a Setats cluster and completed the Warehouse configuration.
You have deployed a StarRocks cluster and confirmed that the FE / BE nodes can access underlying storage such as HDFS / COS.
If the Warehouse uses a Hive Catalog, you must additionally verify the connectivity between StarRocks and the Hive Metastore.
If Kerberos, CHDFS, or COS acceleration buckets are involved, you must prepare the relevant network settings, credentials, and Hadoop configurations in advance.

Scenario 1: HDFS / Hadoop Catalog

The following example applies to the Hadoop Catalog / HDFS scenario:
CREATE EXTERNAL CATALOG setats
PROPERTIES (
'type' = 'setats',
'setats.catalog.type' = 'hadoop',
'warehouse' = 'hdfs://<nameservice>/usr/setats',
'dfs.nameservices' = '<nameservice>',
'dfs.ha.namenodes.<nameservice>' = 'nn1,nn2',
'dfs.namenode.rpc-address.<nameservice>.nn1' = '<nn1-host>:4007',
'dfs.namenode.rpc-address.<nameservice>.nn2' = '<nn2-host>:4007',
'dfs.client.failover.proxy.provider.<nameservice>' = 'org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider'
);
If Kerberos is enabled on EMR, add the relevant Kerberos parameters based on your actual environment.

Scenario 2: Hive Metastore + COS Acceleration Bucket

If Setats uses Hive Metastore and its underlying data or metadata relies on COS acceleration buckets, you can refer to the following configuration:
CREATE EXTERNAL CATALOG setats
PROPERTIES
(
"type" = "setats",
"setats.catalog.type" = "hive",
"hive.metastore.uris" = "thrift://172.28.39.128:7004,thrift://172.28.39.118:7004",
'tencent.cos.access_key' = '',
'tencent.cos.secret_key' = '',
'tencent.cos.endpoint' = ''
);

Catalog Parameter Description

Parameter
Description
type
Catalog type, fixed as setats
setats.catalog.type
Setats Catalog type, such as hadoop
warehouse
Setats Warehouse address
dfs.nameservices
HDFS NameService name
dfs.ha.namenodes.<nameservice>
HA NameNode list
dfs.namenode.rpc-address.<nameservice>.nn*
NameNode RPC address
dfs.client.failover.proxy.provider.<nameservice>
HDFS HA Failover Provider
tencent.cos.access_key/tencent.cos.secret_key
COS access credentials; must have QcloudCOSListOnly and QcloudCOSDataReadOnly permissions.
tencent.cos.endpoint
COS access domain name, for example, cos.ap-guangzhou.myqcloud.com

Querying Data

Switching Catalog Queries

SET CATALOG setats;
SHOW DATABASES;
USE `testdb`;
SELECT * FROM demo_setats_table1;

Fully Qualified Name Query

SELECT *
FROM `setats`.`testdb`.`demo_setats_table1`;


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백