Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
⭐️ If you like Apache SeaTunnel, give it a star on GitHub ⭐️
This is documentation for Apache SeaTunnel2.3.9, which is no longer actively maintained.
For up-to-date documentation, see thelatest version (2.3.11).
Version: 2.3.9

Clickhouse

Clickhouse source connector

Support Those Engines

Spark
Flink
SeaTunnel Zeta

Key Features

supports query SQL and can achieve projection effect.

Description

Used to read data from Clickhouse.

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.

DatasourceSupported VersionsDependency
ClickhouseuniversalDownload

Data Type Mapping

Clickhouse Data TypeSeaTunnel Data Type
String / Int128 / UInt128 / Int256 / UInt256 / Point / Ring / Polygon MultiPolygonSTRING
Int8 / UInt8 / Int16 / UInt16 / Int32INT
UInt64 / Int64 / IntervalYear / IntervalQuarter / IntervalMonth / IntervalWeek / IntervalDay / IntervalHour / IntervalMinute / IntervalSecondBIGINT
Float64DOUBLE
DecimalDECIMAL
Float32FLOAT
DateDATE
DateTimeTIME
ArrayARRAY
MapMAP

Source Options

NameTypeRequiredDefaultDescription
hostStringYes-ClickHouse cluster address, the format ishost:port , allowing multiplehosts to be specified. Such as"host1:8123,host2:8123" .
databaseStringYes-TheClickHouse database.
sqlStringYes-The query sql used to search data though Clickhouse server.
usernameStringYes-ClickHouse user username.
passwordStringYes-ClickHouse user password.
clickhouse.configMapNo-In addition to the above mandatory parameters that must be specified byclickhouse-jdbc , users can also specify multiple optional parameters, which cover all theparameters provided byclickhouse-jdbc.
server_time_zoneStringNoZoneId.systemDefault()The session time zone in database server. If not set, then ZoneId.systemDefault() is used to determine the server time zone.
common-optionsNo-Source plugin common parameters, please refer toSource Common Options 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:

# Set the basic configuration of the task to be performed
env{
parallelism=10
job.mode="BATCH"
}

# Create a source to connect to Clickhouse
source{
Clickhouse{
host="localhost:8123"
database="default"
sql="select * from test where age = 20 limit 100"
username="xxxxx"
password="xxxxx"
server_time_zone="UTC"
plugin_output="test"
clickhouse.config={
"socket_timeout":"300000"
}
}
}

# Console printing of the read Clickhouse data
sink{
Console{
parallelism=1
}
}

Tips

1.SeaTunnel Deployment Document.


[8]ページ先頭

©2009-2025 Movatter.jp