跳到主要内容

Hive Connector介绍

GeaFlow 支持通过 Hive metastore 服务器读取 Hive 表中的数据。目前,我们支持 Hive 2.3.x系列版本。

语法​

CREATE TABLE hive_table (
id BIGINT,
name VARCHAR,
age INT
) WITH (
type='hive',
geaflow.dsl.hive.database.name = 'default',
geaflow.dsl.hive.table.name = 'user',
geaflow.dsl.hive.metastore.uris = 'thrift://localhost:9083'
)

参数​

参数名是否必须描述
geaflow.dsl.hive.database.name是Hive数据库名字
geaflow.dsl.hive.table.name是Hive表名
geaflow.dsl.hive.metastore.uris是连接Hive元数据metastore的uri列表
geaflow.dsl.hive.splits.per.partition否每个Hive分片的逻辑分片数量,默认为1

示例​

CREATE TABLE hive_table (
id BIGINT,
name VARCHAR,
age INT
) WITH (
type='hive',
geaflow.dsl.hive.database.name = 'default',
geaflow.dsl.hive.table.name = 'user',
geaflow.dsl.hive.metastore.uris = 'thrift://localhost:9083'
);

CREATE TABLE console (
id BIGINT,
name VARCHAR,
age INT
) WITH (
type='console'
);

INSERT INTO console
SELECT * FROM hive_table;