MonsterChenzhuo commented on code in PR #5085:
URL: https://github.com/apache/seatunnel/pull/5085#discussion_r1267801088
##########
docs/en/connector-v2/source/Clickhouse.md:
##########
@@ -2,93 +2,96 @@
> Clickhouse source connector
-## Description
+## Support Those Engines
-Used to read data from Clickhouse.
+> Spark<br/>
+> Flink<br/>
+> SeaTunnel Zeta<br/>
-## Key features
+## Key Features
- [x] [batch](../../concept/connector-v2-features.md)
- [ ] [stream](../../concept/connector-v2-features.md)
- [ ] [exactly-once](../../concept/connector-v2-features.md)
- [x] [column projection](../../concept/connector-v2-features.md)
-
-supports query SQL and can achieve projection effect.
-
- [ ] [parallelism](../../concept/connector-v2-features.md)
- [ ] [support user-defined split](../../concept/connector-v2-features.md)
-## Options
-
-| name | type | required | default value |
-|------------------|--------|----------|------------------------|
-| host | string | yes | - |
-| database | string | yes | - |
-| sql | string | yes | - |
-| username | string | yes | - |
-| password | string | yes | - |
-| server_time_zone | string | no | ZoneId.systemDefault() |
-| common-options | | no | - |
-
-### host [string]
-
-`ClickHouse` cluster address, the format is `host:port` , allowing multiple
`hosts` to be specified. Such as `"host1:8123,host2:8123"` .
-
-### database [string]
-
-The `ClickHouse` database
-
-### sql [string]
-
-The query sql used to search data though Clickhouse server
-
-### username [string]
-
-`ClickHouse` user username
-
-### password [string]
-
-`ClickHouse` user password
+> supports query SQL and can achieve projection effect.
-### server_time_zone [string]
-
-The session time zone in database server. If not set, then
ZoneId.systemDefault() is used to determine the server time zone.
-
-### common options
+## Description
-Source plugin common parameters, please refer to [Source Common
Options](common-options.md) for details
+Used to read data from Clickhouse.
-## Examples
+## Supported DataSource Info
+
+In order to use the Clickhouse connector, the following dependencies are
required.
+They can be downloaded via install-plugin.sh or from the Maven central
repository.
+
+| Datasource | Supported Versions |
Dependency |
+|------------|--------------------|------------------------------------------------------------------------------------------------------------------|
+| Clickhouse | universal |
[Download](https://mvnrepository.com/artifact/org.apache.seatunnel/seatunnel-connectors-v2/connector-clickhouse)
|
+
+## Data Type Mapping
+
+| Clickhouse Data
type | SeaTunnel
Data type |
+|-----------------------------------------------------------------------------------------------------------------------------------------------|---------------------|
+| String / Int128 / UInt128 / Int256 / UInt256 / Point / Ring / Polygon
MultiPolygon |
STRING |
+| Int8 / UInt8 / Int16 / UInt16 / Int32
| INT
|
+| UInt64 / Int64 / IntervalYear / IntervalQuarter / IntervalMonth /
IntervalWeek / IntervalDay / IntervalHour / IntervalMinute / IntervalSecond |
BIGINT |
+| Float64
| DOUBLE
|
+| Decimal
| DECIMAL
|
+| Float32
| FLOAT
|
+| Date
| DATE
|
+| DateTime
| TIME
|
+| Array
| ARRAY
|
+| Map
| MAP
|
+
+## Source Options
+
+| Name | Type | Required | Default |
Description
|
+|------------------|--------|----------|------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
+| host | String | Yes | - | `ClickHouse`
cluster address, the format is `host:port` , allowing multiple `hosts` to be
specified. Such as `"host1:8123,host2:8123"` . |
+| database | String | Yes | - | The
`ClickHouse` database.
|
+| sql | String | Yes | - | The query
sql used to search data though Clickhouse server.
|
+| username | String | Yes | - | `ClickHouse`
user username.
|
+| password | String | Yes | - | `ClickHouse`
user password.
|
+| server_time_zone | String | No | ZoneId.systemDefault() | The session
time zone in database server. If not set, then ZoneId.systemDefault() is used
to determine the server time zone. |
+| common-options | | No | - | Source
plugin common parameters, please refer to [Source Common
Options](common-options.md) for details. |
+
+## How to Create a Clickhouse Data Synchronization Jobs
+
+The following example demonstrates how to create a data synchronization job
that reads data from Clickhouse and prints it on the local client:
+
+```bash
+# Set the basic configuration of the task to be performed
+env {
+ execution.parallelism = 1
+ job.mode = "BATCH"
+}
-```hocon
+# Create a source to connect to Clickhouse
source {
-
Clickhouse {
host = "localhost:8123"
database = "default"
sql = "select * from test where age = 20 limit 100"
- username = "default"
- password = ""
+ username = "xxxxx"
+ password = "xxxxx"
server_time_zone = "UTC"
result_table_name = "test"
}
-
}
-```
-
-## Changelog
-### 2.2.0-beta 2022-09-26
-
-- Add ClickHouse Source Connector
-
-### 2.3.0-beta 2022-10-20
-
-- [Improve] Clickhouse Source random use host when config multi-host
([3108](https://github.com/apache/seatunnel/pull/3108))
-
-### next version
+# Console printing of the read Clickhouse data
+sink {
+ Console {
+ parallelism = 1
+ }
+}
+```
-- [Improve] Clickhouse Source support nest type and array
type([3047](https://github.com/apache/seatunnel/pull/3047))
+### Tips
Review Comment:
@Hisoka-X "## How to Create Clickhouse Data Synchronization Jobs"
In this section, we provide a complete description of how to configure a
data synchronization job. The following sub-section titled "tips" offers
additional materials and resources related to the process. This approach offers
a better user experience compared to merely presenting a configuration file.
The following tips provide additional details for this synchronization job
configuration, such as a link to the Seatunnel deployment document. This way,
users can quickly start a data synchronization job they are interested in. All
the elements they need to know are displayed on this interface.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]