Skip to content

Commit

Permalink
[Improve][Connector-V2] Optimize doc
Browse files Browse the repository at this point in the history
  • Loading branch information
corgy-w committed Sep 14, 2024
1 parent 615d710 commit 3015a28
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 201 deletions.
63 changes: 22 additions & 41 deletions docs/en/connector-v2/source/CosFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,32 @@ Read all the data in a split in a pollNext call. What splits are read will be sa
- [x] [parallelism](../../concept/connector-v2-features.md)
- [ ] [support user-defined split](../../concept/connector-v2-features.md)
- [x] file format type
- [x] text
- [x] csv
- [x] parquet
- [x] orc
- [x] json
- [x] excel
- [x] xml
- [x] binary
- [x] text
- [x] csv
- [x] parquet
- [x] orc
- [x] json
- [x] excel
- [x] xml
- [x] binary

## Description

Read data from aliyun Cos file system.

:::tip

If you use spark/flink, In order to use this connector, You must ensure your spark/flink cluster already integrated
hadoop. The tested hadoop version is 2.x.
If you use spark/flink, In order to use this connector, You must ensure your spark/flink cluster already integrated hadoop. The tested hadoop version is 2.x.

If you use SeaTunnel Engine, It automatically integrated the hadoop jar when you download and install SeaTunnel Engine.
You can check the jar package under ${SEATUNNEL_HOME}/lib to confirm this.
If you use SeaTunnel Engine, It automatically integrated the hadoop jar when you download and install SeaTunnel Engine. You can check the jar package under ${SEATUNNEL_HOME}/lib to confirm this.

To use this connector you need put hadoop-cos-{hadoop.version}-{version}.jar and cos_api-bundle-{version}.jar in
${SEATUNNEL_HOME}/lib dir, download: [Hadoop-Cos-release](https://github.com/tencentyun/hadoop-cos/releases). It only
supports hadoop version 2.6.5+ and version 8.0.2+.
To use this connector you need put hadoop-cos-{hadoop.version}-{version}.jar and cos_api-bundle-{version}.jar in ${SEATUNNEL_HOME}/lib dir, download: [Hadoop-Cos-release](https://github.com/tencentyun/hadoop-cos/releases). It only supports hadoop version 2.6.5+ and version 8.0.2+.

:::

## Options

| name | type | required | default value |
| name | type | required | default value |
|---------------------------|---------|----------|---------------------|
| path | string | yes | - |
| file_format_type | string | yes | - |
Expand Down Expand Up @@ -84,37 +80,24 @@ File type, supported as the following file types:

`text` `csv` `parquet` `orc` `json` `excel` `xml` `binary`

If you assign file type to `json`, you should also assign schema option to tell connector how to parse data to the row
you want.
If you assign file type to `json`, you should also assign schema option to tell connector how to parse data to the row you want.

For example:

upstream data is the following:

```json

{
"code": 200,
"data": "get success",
"success": true
}
{"code": 200, "data": "get success", "success": true}

```

You can also save multiple pieces of data in one file and split them by newline:

```json lines

{
"code": 200,
"data": "get success",
"success": true
}
{
"code": 300,
"data": "get failed",
"success": false
}
{"code": 200, "data": "get success", "success": true}
{"code": 300, "data": "get failed", "success": false}

```

Expand All @@ -134,12 +117,11 @@ schema {

connector will generate data as the following:

| code | data | success |
| code | data | success |
|------|-------------|---------|
| 200 | get success | true |

If you assign file type to `parquet` `orc`, schema option not required, connector can find the schema of upstream data
automatically.
If you assign file type to `parquet` `orc`, schema option not required, connector can find the schema of upstream data automatically.

If you assign file type to `text` `csv`, you can choose to specify the schema information or not.

Expand All @@ -153,7 +135,7 @@ tyrantlucifer#26#male

If you do not assign data schema connector will treat the upstream data as the following:

| content |
| content |
|-----------------------|
| tyrantlucifer#26#male |

Expand All @@ -176,7 +158,7 @@ schema {

connector will generate data as the following:

| name | age | gender |
| name | age | gender |
|---------------|-----|--------|
| tyrantlucifer | 26 | male |

Expand Down Expand Up @@ -223,7 +205,7 @@ For example if you read a file from path `cosn://hadoop-cluster/tmp/seatunnel/pa

Every record data from file will be added these two fields:

| name | age |
| name | age |
|---------------|-----|
| tyrantlucifer | 26 |

Expand Down Expand Up @@ -265,8 +247,7 @@ default `HH:mm:ss`

### schema [config]

Only need to be configured when the file_format_type are text, json, excel, xml or csv ( Or other format we can't read
the schema from metadata).
Only need to be configured when the file_format_type are text, json, excel, xml or csv ( Or other format we can't read the schema from metadata).

#### fields [Config]

Expand Down
40 changes: 16 additions & 24 deletions docs/en/connector-v2/source/FtpFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,28 @@
- [x] [parallelism](../../concept/connector-v2-features.md)
- [ ] [support user-defined split](../../concept/connector-v2-features.md)
- [x] file format type
- [x] text
- [x] csv
- [x] json
- [x] excel
- [x] xml
- [x] binary
- [x] text
- [x] csv
- [x] json
- [x] excel
- [x] xml
- [x] binary

## Description

Read data from ftp file server.

:::tip

If you use spark/flink, In order to use this connector, You must ensure your spark/flink cluster already integrated
hadoop. The tested hadoop version is 2.x.
If you use spark/flink, In order to use this connector, You must ensure your spark/flink cluster already integrated hadoop. The tested hadoop version is 2.x.

If you use SeaTunnel Engine, It automatically integrated the hadoop jar when you download and install SeaTunnel Engine.
You can check the jar package under ${SEATUNNEL_HOME}/lib to confirm this.
If you use SeaTunnel Engine, It automatically integrated the hadoop jar when you download and install SeaTunnel Engine. You can check the jar package under ${SEATUNNEL_HOME}/lib to confirm this.

:::

## Options

| name | type | required | default value |
| name | type | required | default value |
|---------------------------|---------|----------|---------------------|
| host | string | yes | - |
| port | int | yes | - |
Expand Down Expand Up @@ -92,20 +90,15 @@ File type, supported as the following file types:

`text` `csv` `parquet` `orc` `json` `excel` `xml` `binary`

If you assign file type to `json` , you should also assign schema option to tell connector how to parse data to the row
you want.
If you assign file type to `json` , you should also assign schema option to tell connector how to parse data to the row you want.

For example:

upstream data is the following:

```json

{
"code": 200,
"data": "get success",
"success": true
}
{"code": 200, "data": "get success", "success": true}

```

Expand All @@ -125,7 +118,7 @@ schema {

connector will generate data as the following:

| code | data | success |
| code | data | success |
|------|-------------|---------|
| 200 | get success | true |

Expand All @@ -141,7 +134,7 @@ tyrantlucifer#26#male

If you do not assign data schema connector will treat the upstream data as the following:

| content |
| content |
|-----------------------|
| tyrantlucifer#26#male |

Expand All @@ -164,7 +157,7 @@ schema {

connector will generate data as the following:

| name | age | gender |
| name | age | gender |
|---------------|-----|--------|
| tyrantlucifer | 26 | male |

Expand Down Expand Up @@ -197,7 +190,7 @@ For example if you read a file from path `ftp://hadoop-cluster/tmp/seatunnel/par

Every record data from file will be added these two fields:

| name | age |
| name | age |
|---------------|-----|
| tyrantlucifer | 26 |

Expand Down Expand Up @@ -239,8 +232,7 @@ then SeaTunnel will skip the first 2 lines from source files

### schema [config]

Only need to be configured when the file_format_type are text, json, excel, xml or csv ( Or other format we can't read
the schema from metadata).
Only need to be configured when the file_format_type are text, json, excel, xml or csv ( Or other format we can't read the schema from metadata).

The schema information of upstream data.

Expand Down
24 changes: 11 additions & 13 deletions docs/en/connector-v2/source/HdfsFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Read all the data in a split in a pollNext call. What splits are read will be sa
- [x] [parallelism](../../concept/connector-v2-features.md)
- [ ] [support user-defined split](../../concept/connector-v2-features.md)
- [x] file format file
- [x] text
- [x] csv
- [x] parquet
- [x] orc
- [x] json
- [x] excel
- [x] xml
- [x] binary
- [x] text
- [x] csv
- [x] parquet
- [x] orc
- [x] json
- [x] excel
- [x] xml
- [x] binary

## Description

Expand All @@ -41,7 +41,7 @@ Read data from hdfs file system.

## Source Options

| Name | Type | Required | Default | Description |
| Name | Type | Required | Default | Description |
|---------------------------|---------|----------|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| path | string | yes | - | The source file path. |
| file_format_type | string | yes | - | We supported as the following file types:`text` `csv` `parquet` `orc` `json` `excel` `xml` `binary`.Please note that, The final file name will end with the file_format's suffix, the suffix of the text file is `txt`. |
Expand Down Expand Up @@ -99,15 +99,13 @@ The encoding of the file to read. This param will be parsed by `Charset.forName(

### Tips

> If you use spark/flink, In order to use this connector, You must ensure your spark/flink cluster already integrated
> hadoop. The tested hadoop version is 2.x. If you use SeaTunnel Engine, It automatically integrated the hadoop jar when
> you download and install SeaTunnel Engine. You can check the jar package under ${SEATUNNEL_HOME}/lib to confirm this.
> If you use spark/flink, In order to use this connector, You must ensure your spark/flink cluster already integrated hadoop. The tested hadoop version is 2.x. If you use SeaTunnel Engine, It automatically integrated the hadoop jar when you download and install SeaTunnel Engine. You can check the jar package under ${SEATUNNEL_HOME}/lib to confirm this.
## Task Example

### Simple:

> This example defines a SeaTunnel synchronization task that read data from Hdfs and sends it to Hdfs.
> This example defines a SeaTunnel synchronization task that read data from Hdfs and sends it to Hdfs.
```
# Defining the runtime environment
Expand Down
2 changes: 1 addition & 1 deletion docs/en/connector-v2/source/LocalFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ If you use SeaTunnel Engine, It automatically integrated the hadoop jar when you

## Options

| name | type | required | default value |
| name | type | required | default value |
|---------------------------|---------|----------|--------------------------------------|
| path | string | yes | - |
| file_format_type | string | yes | - |
Expand Down
Loading

0 comments on commit 3015a28

Please sign in to comment.