Skip to content

Commit e4bedb2

Browse files
committed
ck impala sink doc
1 parent 93844cf commit e4bedb2

File tree

3 files changed

+98
-13
lines changed

3 files changed

+98
-13
lines changed

docs/plugin/clickhouseSink.md

Lines changed: 81 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CREATE TABLE tableName(
2424
|----|---|
2525
| tableName| clickhouse表名称|
2626
| colName | 列名称|
27-
| colType | 列类型 [colType支持的类型](docs/colType.md)|
27+
| colType | clickhouse基本数据类型,不包括Array,Tuple,Nested等|
2828

2929
## 4.参数:
3030

@@ -36,18 +36,87 @@ CREATE TABLE tableName(
3636
| password | clickhouse 连接密码|||
3737
| tableName | clickhouse 表名称|||
3838
| parallelism | 并行度设置||1|
39+
|updateMode| 只支持APPEND模式,过滤掉回撤数据|||
40+
3941

4042
## 5.样例:
43+
44+
4145
```
46+
47+
CREATE TABLE source1 (
48+
id int,
49+
name VARCHAR
50+
)WITH(
51+
type ='kafka11',
52+
bootstrapServers ='172.16.8.107:9092',
53+
zookeeperQuorum ='172.16.8.107:2181/kafka',
54+
offsetReset ='latest',
55+
topic ='mqTest03',
56+
timezone='Asia/Shanghai',
57+
topicIsPattern ='false'
58+
);
59+
60+
61+
62+
CREATE TABLE source2(
63+
id int,
64+
address VARCHAR
65+
)WITH(
66+
type ='kafka11',
67+
bootstrapServers ='172.16.8.107:9092',
68+
zookeeperQuorum ='172.16.8.107:2181/kafka',
69+
offsetReset ='latest',
70+
topic ='mqTest04',
71+
timezone='Asia/Shanghai',
72+
topicIsPattern ='false'
73+
);
74+
75+
4276
CREATE TABLE MyResult(
43-
channel VARCHAR,
44-
pv VARCHAR
45-
)WITH(
46-
type ='clickhouse',
47-
url ='jdbc:clickhouse://172.16.8.104:3306/test?charset=utf8',
48-
userName ='dtstack',
49-
password ='abc123',
50-
tableName ='pv2',
51-
parallelism ='1'
52-
)
53-
```
77+
id int,
78+
name VARCHAR,
79+
address VARCHAR
80+
)WITH(
81+
type='clickhouse',
82+
url='jdbc:clickhouse://172.16.10.168:8123/tudou?charset=utf8',
83+
userName='dtstack',
84+
password='abc123',
85+
tableName='MyResult',
86+
updateMode = 'append'
87+
);
88+
89+
insert into MyResult
90+
select
91+
s1.id,
92+
s1.name,
93+
s2.address
94+
from
95+
source1 s1
96+
left join
97+
source2 s2
98+
on
99+
s1.id = s2.id
100+
101+
102+
```
103+
104+
105+
**Clickhouse建表语句**
106+
107+
108+
```aidl
109+
CREATE TABLE tudou.MyResult (`id` Int64, `name` String, `address` String)
110+
ENGINE = MergeTree PARTITION BY address ORDER BY id SETTINGS index_granularity = 8192
111+
```
112+
113+
114+
115+
116+
数据结果:
117+
118+
向Topic mqTest03 发送数据 {"name":"maqi","id":1001} 插入 (1001,"maqi",null)
119+
120+
向Topic mqTest04 发送数据 {"address":"hz","id":1001} 插入 (1001,"maqi","hz")
121+
122+

docs/plugin/impalaColType.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
| 支持的类型 | java对应类型 |
2+
| ------ | ----- |
3+
| boolean | Boolean |
4+
| char | Character |
5+
| double | Double|
6+
| float | Float|
7+
| tinyint | Byte |
8+
| smallint | Short|
9+
| int | Integer |
10+
| bigint | Long |
11+
| decimal |BigDecimal|
12+
| string | String |
13+
| varchar | String |
14+
| timestamp | Timestamp |

docs/plugin/impalaSink.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CREATE TABLE tableName(
2424
|----|---|
2525
| tableName| 在 sql 中使用的名称;即注册到flink-table-env上的名称|
2626
| colName | 列名称|
27-
| colType | 列类型 [colType支持的类型](docs/colType.md)|
27+
| colType | 列类型 [colType支持的类型](docs/plugin/impalaColType.md)|
2828

2929
## 4.参数:
3030

@@ -45,6 +45,8 @@ CREATE TABLE tableName(
4545
| enablePartition | 是否支持分区 ||false|
4646
| partitionFields | 分区字段名|否,enablePartition='true'时为必填||
4747
| parallelism | 并行度设置||1|
48+
| parallelism | 并行度设置||1|
49+
|updateMode| 只支持APPEND模式,过滤掉回撤数据|||
4850

4951

5052
## 5.样例:

0 commit comments

Comments
 (0)