Doris关联Hive表

Doris关联Hive外部数据源

元数据创建

1
2
3
4
5
6
7
8
9
10
11
CREATE CATALOG test_hive PROPERTIES (
'type'='hms',
'hive.metastore.uris' = 'thrift://172.22.17.20:9083,thrift://172.22.17.21:9083,thrift://172.22.17.22:9083',
'hadoop.username' = 'hive',
'dfs.nameservices' = 'Tdsop',
'dfs.ha.namenodes.Tdsop' = 'nn1,nn2',
'dfs.namenode.rpc-address.Tdsop.nn1' = '172.22.17.20:8022',
'dfs.namenode.rpc-address.Tdsop.nn2' = '172.22.17.21:8022',
'dfs.client.failover.proxy.provider.Tdsop' = 'org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider'
);

常用命令

1
2
3
4
5
6
SHOW catalogs;
SHOW CATALOG test_hive;
SHOW DATABASES FROM test_hive;
SHOW TABLES FROM test_hive.ods;
SELECT * FROM test_hive.ods.ce_flight;