Skip to content

Commit

Permalink
[Doc] Improve Console Source & Console Sink document apache#5101
Browse files Browse the repository at this point in the history
  • Loading branch information
zhilinli123 committed Aug 5, 2023
1 parent 2917542 commit 35721f7
Showing 1 changed file with 62 additions and 37 deletions.
99 changes: 62 additions & 37 deletions docs/en/connector-v2/sink/Console.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

> Console sink connector
## Support Those Engines

> Spark<br/>
> Flink<br/>
> SeaTunnel Zeta<br/>
## Description

Used to send data to Console. Both support streaming and batch mode.
Expand All @@ -14,59 +20,88 @@ Used to send data to Console. Both support streaming and batch mode.

## Options

| name | type | required | default value |
|----------------|------|----------|---------------|
| common-options | | no | - |
| Name | Type | Required | Default | Description |
|----------------|--------|----------|---------|-----------------------------------------------------------------------------------------------------|
| common-options | String | No | - | Sink plugin common parameters, please refer to [Sink Common Options](common-options.md) for details |

### common options
## Task Example

Sink plugin common parameters, please refer to [Sink Common Options](common-options.md) for details
### Simple:

## Example
> This is a randomly generated data, written to the console, with a degree of parallelism of 1
simple:

```hocon
Console {
```
env {
execution.parallelism = 1
job.mode = "STREAMING"
}
source {
FakeSource {
result_table_name = "fake"
schema = {
fields {
name = "string"
age = "int"
}
}
}
}
sink {
Console {
source_table_name = "fake"
}
}
```

test:
### Multiple sources Simple:

* Configuring the SeaTunnel config file
> This is a multiple source and you can specify a data source to write to the specified end
```hocon
```
env {
execution.parallelism = 1
job.mode = "STREAMING"
}
source {
FakeSource {
result_table_name = "fake"
schema = {
fields {
name = "string"
age = "int"
}
FakeSource {
result_table_name = "fake1"
schema = {
fields {
id = "int"
name = "string"
age = "int"
}
}
}
FakeSource {
result_table_name = "fake2"
schema = {
fields {
name = "string"
age = "int"
}
}
}
}
sink {
Console {
}
Console {
source_table_name = "fake1"
}
Console {
source_table_name = "fake2"
}
}
```

* Start a SeaTunnel task
## Console Sample Data

* Console print data
This is a printout from our console

```text
```
2022-12-19 11:01:45,417 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - output rowType: name<STRING>, age<INT>
2022-12-19 11:01:46,489 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=1: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: CpiOd, 8520946
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=2: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: eQqTs, 1256802974
Expand All @@ -80,13 +115,3 @@ sink {
2022-12-19 11:01:46,490 INFO org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkWriter - subtaskIndex=0 rowIndex=10: SeaTunnelRow#tableId=-1 SeaTunnelRow#kind=INSERT: hBoib, 929089763
```

## Changelog

### 2.2.0-beta 2022-09-26

- Add Console Sink Connector

### 2.3.0-beta 2022-10-20

- [Improve] Console sink support print subtask index ([3000](https://github.com/apache/seatunnel/pull/3000))

0 comments on commit 35721f7

Please sign in to comment.