tencent cloud

Stream Compute Service

Doris External Table Query

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

Overview

Setats supports OLAP queries through the Doris external table method. Users can create a Setats Catalog in Doris to directly access the columnar data of Setats tables for scenarios such as ad-hoc analysis, report querying, and offline aggregation.

Prerequisites

You have created a Setats cluster and completed the Warehouse configuration.
You have deployed a Doris cluster.
If you use a Hive Catalog or a metadata acceleration bucket, Doris also needs to access the Hive Metastore.
If the underlying storage has Kerberos / CHDFS / COS acceleration buckets enabled, you must prepare the corresponding configuration files and authentication information in advance.

Scenario 1: HDFS / Hadoop Catalog

If Setats uses a Hadoop Catalog or HDFS-based metadata management, you can refer to the following method to create a Catalog:
CREATE CATALOG setats COMMENT 'setats catalog' 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, you can continue to add the following properties:
'hadoop.security.authentication' = 'kerberos',
'hadoop.kerberos.keytab' = '/usr/local/service/doris/kerberos.keytab',
'hadoop.kerberos.principal' = '<your-principal>'

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 CATALOG setats COMMENT 'setats catalog' PROPERTIES (
'type' = 'setats',
'setats.catalog.type' = 'hms',
'hive.metastore.uris' = 'thrift://<metastore-host-1>:7004,thrift://<metastore-host-2>:7004',
'cos.endpoint' = 'cos.<region>.myqcloud.com',
'cos.access_key' = '<SecretId>',
'cos.secret_key' = '<SecretKey>',
'fs.ofs.bucket.region' = '<region>',
'fs.ofs.user.appid' = '<AppId>',
'fs.ofs.tmp.cache.dir' = '/tmp/chdfs/',
'fs.ofs.upload.flush.flag' = 'true',
'broker.name' = '<BrokerName>'
);

Catalog Parameter Description

Parameter
Description
type
Catalog type, fixed as setats
setats.catalog.type
Setats Catalog type, such as hadoop or hms
warehouse
Setats Warehouse address, commonly used for Hadoop Catalog
hive.metastore.uris
Hive Metastore address, required for Hive / HMS scenarios
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
cos.endpoint
COS access domain name
cos.access_key / cos.secret_key
COS access credentials; must have QcloudCOSListOnly and QcloudCOSDataReadOnly permissions.
fs.ofs.bucket.region
Accelerated bucket region
fs.ofs.user.appid
Tencent Cloud AppID
broker.name
Doris Broker name

Querying Data

Switching Catalog Queries

SWITCH setats;
SHOW DATABASES;
USE `testdb`;
SELECT * FROM `demo_setats_table1`;

Cross-Catalog Query

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

도움말 및 지원

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

피드백