Skip to content

Commit 3e266ce

Browse files
Scorpio777888Gemini147258davidzollo
authored
[Doc][Improve] support chinese [docs/zh/connector-v2/sink/SelectDB-Cloud.md] (#8850)
Co-authored-by: Gemini147258 <[email protected]> Co-authored-by: David Zollo <[email protected]>
1 parent 438edc6 commit 3e266ce

File tree

1 file changed

+173
-0
lines changed

1 file changed

+173
-0
lines changed

Diff for: docs/zh/connector-v2/sink/SelectDB-Cloud.md

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# SelectDB Cloud
2+
3+
> SelectDB Cloud Sink 连接器
4+
5+
## 支持的引擎
6+
7+
> Spark<br/>
8+
> Flink<br/>
9+
> SeaTunnel Zeta<br/>
10+
11+
## 主要特性
12+
13+
- [x] [精确一次](../../concept/connector-v2-features.md)
14+
- [x] [cdc](../../concept/connector-v2-features.md)
15+
16+
## 描述
17+
18+
用于将数据发送到 SelectDB Cloud。支持流式和批处理模式。
19+
20+
SelectDB Cloud 接收器连接器的内部实现是在批量缓存后上传数据,并提交 CopyInto SQL 以将数据加载到表中。
21+
22+
## 支持的数据源信息
23+
24+
:::提示
25+
26+
支持的版本
27+
28+
* 支持的 `SelectDB Cloud 版本 >= 2.2.x`
29+
30+
:::
31+
32+
## 接收器选项
33+
34+
| 名称 | 类型 | 是否必填 | 默认值 | 描述 |
35+
|--------------------|--------|----------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
36+
| load-url | String || - | `SelectDB Cloud` 仓库的 HTTP 地址,格式为 `warehouse_ip:http_port` |
37+
| jdbc-url | String || - | `SelectDB Cloud` 仓库的 JDBC 地址,格式为 `warehouse_ip:mysql_port` |
38+
| cluster-name | String || - | `SelectDB Cloud` 集群名称 |
39+
| username | String || - | `SelectDB Cloud` 用户名 |
40+
| password | String || - | `SelectDB Cloud` 用户密码 |
41+
| sink.enable-2pc | bool || true | 是否启用两阶段提交(2pc),默认为 true,以确保 Exactly-Once 语义。SelectDB 使用缓存文件加载数据。当数据量较大时,缓存数据可能会失效(默认过期时间为 1 小时)。如果遇到大量数据写入丢失的情况,请将 sink.enable-2pc 配置为 false。 |
42+
| table.identifier | String || - | `SelectDB Cloud` 表的名称,格式为 `database.table` |
43+
| sink.enable-delete | bool || false | 是否启用删除功能。此选项要求 SelectDB Cloud 表启用批量删除功能,并且仅支持 Unique 模型。 |
44+
| sink.max-retries | int || 3 | 写入数据库失败时的最大重试次数 |
45+
| sink.buffer-size | int || 10 * 1024 * 1024 (1MB) | 用于流式加载的数据缓存缓冲区大小 |
46+
| sink.buffer-count | int || 10000 | 用于流式加载的数据缓存缓冲区数量 |
47+
| selectdb.config | map || - | 此选项用于在自动生成 SQL 时支持 `insert``delete``update` 等操作,并支持多种格式。 |
48+
49+
## 数据类型映射
50+
51+
| SelectDB Cloud 数据类型 | SeaTunnel 数据类型 |
52+
|--------------------------|-----------------------------------------|
53+
| BOOLEAN | BOOLEAN |
54+
| TINYINT | TINYINT |
55+
| SMALLINT | SMALLINT<br/>TINYINT |
56+
| INT | INT<br/>SMALLINT<br/>TINYINT |
57+
| BIGINT | BIGINT<br/>INT<br/>SMALLINT<br/>TINYINT |
58+
| LARGEINT | BIGINT<br/>INT<br/>SMALLINT<br/>TINYINT |
59+
| FLOAT | FLOAT |
60+
| DOUBLE | DOUBLE<br/>FLOAT |
61+
| DECIMAL | DECIMAL<br/>DOUBLE<br/>FLOAT |
62+
| DATE | DATE |
63+
| DATETIME | TIMESTAMP |
64+
| CHAR | STRING |
65+
| VARCHAR | STRING |
66+
| STRING | STRING |
67+
| ARRAY | ARRAY |
68+
| MAP | MAP |
69+
| JSON | STRING |
70+
| HLL | 尚未支持 |
71+
| BITMAP | 尚未支持 |
72+
| QUANTILE_STATE | 尚未支持 |
73+
| STRUCT | 尚未支持 |
74+
75+
#### 支持的导入数据格式
76+
77+
支持的格式包括 CSV 和 JSON
78+
79+
## 任务示例
80+
81+
### 简单示例:
82+
83+
> 以下示例描述了将多种数据类型写入 SelectDBCloud,用户需要在下游创建相应的表
84+
85+
```hocon
86+
env {
87+
parallelism = 1
88+
job.mode = "BATCH"
89+
checkpoint.interval = 10000
90+
}
91+
92+
source {
93+
FakeSource {
94+
row.num = 10
95+
map.size = 10
96+
array.size = 10
97+
bytes.length = 10
98+
string.length = 10
99+
schema = {
100+
fields {
101+
c_map = "map<string, array<int>>"
102+
c_array = "array<int>"
103+
c_string = string
104+
c_boolean = boolean
105+
c_tinyint = tinyint
106+
c_smallint = smallint
107+
c_int = int
108+
c_bigint = bigint
109+
c_float = float
110+
c_double = double
111+
c_decimal = "decimal(16, 1)"
112+
c_null = "null"
113+
c_bytes = bytes
114+
c_date = date
115+
c_timestamp = timestamp
116+
}
117+
}
118+
}
119+
}
120+
121+
sink {
122+
SelectDBCloud {
123+
load-url = "warehouse_ip:http_port"
124+
jdbc-url = "warehouse_ip:mysql_port"
125+
cluster-name = "Cluster"
126+
table.identifier = "test.test"
127+
username = "admin"
128+
password = "******"
129+
selectdb.config {
130+
file.type = "json"
131+
}
132+
}
133+
}
134+
```
135+
136+
### 使用 JSON 格式导入数据
137+
138+
```
139+
sink {
140+
SelectDBCloud {
141+
load-url = "warehouse_ip:http_port"
142+
jdbc-url = "warehouse_ip:mysql_port"
143+
cluster-name = "Cluster"
144+
table.identifier = "test.test"
145+
username = "admin"
146+
password = "******"
147+
selectdb.config {
148+
file.type = "json"
149+
}
150+
}
151+
}
152+
153+
```
154+
155+
### 使用 CSV 格式导入数据
156+
157+
```
158+
sink {
159+
SelectDBCloud {
160+
load-url = "warehouse_ip:http_port"
161+
jdbc-url = "warehouse_ip:mysql_port"
162+
cluster-name = "Cluster"
163+
table.identifier = "test.test"
164+
username = "admin"
165+
password = "******"
166+
selectdb.config {
167+
file.type = "csv"
168+
file.column_separator = ","
169+
file.line_delimiter = "\n"
170+
}
171+
}
172+
}
173+
```

0 commit comments

Comments
 (0)