Spark
Flink
SeaTunnel Zeta引擎
支持查询SQL并可以实现投影效果。
数据源 | 支持版本 | 驱动程序 | URL | Maven |
数据库依赖需要下载对应'Maven'的支持列表并复制到 '$SEATNUNNEL_HOME/plugins/jdbc/lib/'
工作目录。
例如,DB2数据源:cp db2-connector-java-xxx.jar $SEATNUNNEL_HOME/plugins/jdbc/lib/
DB2数据类型 | SeaTunnel数据类型 |
INTEGER | |
DEC NUMERIC NUM | |
DOUBLE DOUBLE PRECISION DECFLOAT | |
VARCHAR LONG VARCHAR CLOB GRAPHIC VARGRAPHIC LONG VARGRAPHIC DBCLOB | |
XML |
名称 | 类型 | 必需 | 默认 | 描述 |
com.ibm.db2.jdbc.app.DB2Driver 。 | ||||
如果未设置 partition_column
,则将以单一并发方式运行;如果设置了partition_column
,则根据任务的并发度并行执行。
此示例在单一并发模式下查询您的测试数据库中类型为 'table' 的 16 条数据,并查询其所有字段。您还可以指定要查询的最终输出到控制台的字段。
# Defining the runtime environment
env {
# You can set flink configuration here
execution.parallelism = 2
job.mode = "BATCH"
}
source{
Jdbc {
url = "jdbc:db2://127.0.0.1:50000/dbname"
driver = "com.ibm.db2.jdbc.app.DB2Driver"
connection_check_timeout_sec = 100
user = "root"
password = "123456"
query = "select * from table_xxx"
}
}
transform {
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins,
# please go to https://seatunnel.apache.org/docs/transform-v2/sql
}
sink {
Console {}
}
source {
Jdbc {
url = "jdbc:db2://127.0.0.1:50000/dbname"
driver = "com.ibm.db2.jdbc.app.DB2Driver"
connection_check_timeout_sec = 100
user = "root"
password = "123456"
# Define query logic as required
query = "select * from type_bin"
# Parallel sharding reads fields
partition_column = "id"
# Number of fragments
partition_num = 10
}
}
source {
Jdbc {
url = "jdbc:db2://127.0.0.1:50000/dbname"
driver = "com.ibm.db2.jdbc.app.DB2Driver"
connection_check_timeout_sec = 100
user = "root"
password = "123456"
# Define query logic as required
query = "select * from type_bin"
partition_column = "id"
# Read start boundary
partition_lower_bound = 1
# Read end boundary
partition_upper_bound = 500
partition_num = 10
}
}