Skip to content

Commit 42f7fb1

Browse files
authored
Merge branch 'dev' into dev-jdbc-improve-load-metadata
2 parents a9a60fd + 454c339 commit 42f7fb1

File tree

577 files changed

+30915
-4157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

577 files changed

+30915
-4157
lines changed

.github/workflows/documents.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ jobs:
4545
4646
- uses: actions/setup-node@v2
4747
with:
48-
node-version: 14
48+
node-version: 16.19.0
4949

5050
- name: Run docusaurus build
5151
run: |
5252
cd seatunnel-website
53+
npm set strict-ssl false
5354
npm install
5455
npm run build
5556

docs/en/command/connector-check.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Connector check command usage
2+
3+
## Command Entrypoint
4+
5+
```shell
6+
bin/seatunnel-connector.sh
7+
```
8+
9+
## Options
10+
11+
```text
12+
Usage: seatunnel-connector.sh [options]
13+
Options:
14+
-h, --help Show the usage message
15+
-l, --list List all supported plugins(sources, sinks, transforms)
16+
(default: false)
17+
-o, --option-rule Get option rule of the plugin by the plugin
18+
identifier(connector name or transform name)
19+
-pt, --plugin-type SeaTunnel plugin type, support [source, sink,
20+
transform]
21+
```
22+
23+
## Example
24+
25+
```shell
26+
# List all supported connectors(sources and sinks) and transforms
27+
bin/seatunnel-connector.sh -l
28+
# List all supported sinks
29+
bin/seatunnel-connector.sh -l -pt sink
30+
# Get option rule of the connector or transform by the name
31+
bin/seatunnel-connector.sh -o Paimon
32+
# Get option rule of paimon sink
33+
bin/seatunnel-connector.sh -o Paimon -pt sink
34+
```
35+

docs/en/concept/JobEnvConfig.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# JobEnvConfig
1+
# Job Env Config
22

33
This document describes env configuration information, the common parameters can be used in all engines. In order to better distinguish between engine parameters, the additional parameters of other engine need to carry a prefix.
44
In flink engine, we use `flink.` as the prefix. In the spark engine, we do not use any prefixes to modify parameters, because the official spark parameters themselves start with `spark.`
@@ -29,6 +29,10 @@ In `STREAMING` mode, checkpoints is required, if you do not set it, it will be o
2929

3030
This parameter configures the parallelism of source and sink.
3131

32+
### job.retry.times
33+
34+
Used to control the default retry times when a job fails. The default value is 3, and it only works in the Zeta engine.
35+
3236
### shade.identifier
3337

3438
Specify the method of encryption, if you didn't have the requirement for encrypting or decrypting config files, this option can be ignored.

docs/en/concept/config.md

+125
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ configure the Config file.
1212
The main format of the Config file is `hocon`, for more details of this format type you can refer to [HOCON-GUIDE](https://github.com/lightbend/config/blob/main/HOCON.md),
1313
BTW, we also support the `json` format, but you should know that the name of the config file should end with `.json`
1414

15+
We also support the `SQL` format, for details, please refer to the [SQL configuration](sql-config.md) file.
16+
1517
## Example
1618

1719
Before you read on, you can find config file
@@ -64,6 +66,19 @@ sink {
6466
}
6567
```
6668

69+
#### multi-line support
70+
71+
In `hocon`, multiline strings are supported, which allows you to include extended passages of text without worrying about newline characters or special formatting. This is achieved by enclosing the text within triple quotes **`"""`** . For example:
72+
73+
```
74+
var = """
75+
Apache SeaTunnel is a
76+
next-generation high-performance,
77+
distributed, massive data integration tool.
78+
"""
79+
sql = """ select * from "table" """
80+
```
81+
6782
### json
6883

6984
```json
@@ -193,6 +208,116 @@ configured with these two parameters, because in SeaTunnel, there is a default c
193208
parameters are not configured, then the generated data from the last module of the previous node will be used.
194209
This is much more convenient when there is only one source.
195210

211+
## Config variable substitution
212+
213+
In config file we can define some variables and replace it in run time. **This is only support `hocon` format file**.
214+
215+
```hocon
216+
env {
217+
job.mode = "BATCH"
218+
job.name = ${jobName}
219+
parallelism = 2
220+
}
221+
222+
source {
223+
FakeSource {
224+
result_table_name = ${resName}
225+
row.num = ${rowNum}
226+
string.template = ${strTemplate}
227+
int.template = [20, 21]
228+
schema = {
229+
fields {
230+
name = ${nameType}
231+
age = "int"
232+
}
233+
}
234+
}
235+
}
236+
237+
transform {
238+
sql {
239+
source_table_name = "fake"
240+
result_table_name = "sql"
241+
query = "select * from "${resName}" where name = '"${nameVal}"' "
242+
}
243+
244+
}
245+
246+
sink {
247+
Console {
248+
source_table_name = "sql"
249+
username = ${username}
250+
password = ${password}
251+
blankSpace = ${blankSpace}
252+
}
253+
}
254+
255+
```
256+
257+
In the above config, we define some variables, like `${rowNum}`, `${resName}`.
258+
We can replace those parameters with this shell command:
259+
260+
```shell
261+
./bin/seatunnel.sh -c <this_config_file>
262+
-i jobName='st var job'
263+
-i resName=fake
264+
-i rowNum=10
265+
-i strTemplate=['abc','d~f','h i']
266+
-i nameType=string
267+
-i nameVal=abc
268+
-i username=seatunnel=2.3.1
269+
-i password='$a^b%c.d~e0*9('
270+
-i blankSpace='2023-12-26 11:30:00'
271+
-e local
272+
```
273+
274+
Then the final submitted config is:
275+
276+
```hocon
277+
env {
278+
job.mode = "BATCH"
279+
job.name = "st var job"
280+
parallelism = 2
281+
}
282+
283+
source {
284+
FakeSource {
285+
result_table_name = "fake"
286+
row.num = 10
287+
string.template = ["abc","d~f","h i"]
288+
int.template = [20, 21]
289+
schema = {
290+
fields {
291+
name = string
292+
age = "int"
293+
}
294+
}
295+
}
296+
}
297+
298+
transform {
299+
sql {
300+
source_table_name = "fake"
301+
result_table_name = "sql"
302+
query = "select * from fake where name = 'abc' "
303+
}
304+
305+
}
306+
307+
sink {
308+
Console {
309+
source_table_name = "sql"
310+
username = "seatunnel=2.3.1"
311+
password = "$a^b%c.d~e0*9("
312+
blankSpace = "2023-12-26 11:30:00"
313+
}
314+
}
315+
```
316+
317+
Some Notes:
318+
- quota with `'` if the value has space ` ` or special character (like `(`)
319+
- if the replacement variables is in `"` or `'`, like `resName` and `nameVal`, you need add `"`
320+
196321
## What's More
197322

198323
If you want to know the details of this format configuration, Please

0 commit comments

Comments
 (0)