diff --git a/docs/en/connector-v2/source/Doris.md b/docs/en/connector-v2/source/Doris.md
index c67444b58c8..373b84f8fdd 100644
--- a/docs/en/connector-v2/source/Doris.md
+++ b/docs/en/connector-v2/source/Doris.md
@@ -13,15 +13,14 @@
- [x] [batch](../../concept/connector-v2-features.md)
- [ ] [stream](../../concept/connector-v2-features.md)
- [ ] [exactly-once](../../concept/connector-v2-features.md)
-- [x] [schema projection](../../concept/connector-v2-features.md)
+- [x] [column projection](../../concept/connector-v2-features.md)
- [x] [parallelism](../../concept/connector-v2-features.md)
- [x] [support user-defined split](../../concept/connector-v2-features.md)
+- [x] [support multiple table read](../../concept/connector-v2-features.md)
## Description
-Used to read data from Doris.
-Doris Source will send a SQL to FE, FE will parse it into an execution plan, send it to BE, and BE will
-directly return the data
+Used to read data from Apache Doris.
## Supported DataSource Info
@@ -29,11 +28,6 @@ directly return the data
|------------|--------------------------------------|--------|-----|-------|
| Doris | Only Doris2.0 or later is supported. | - | - | - |
-## Database Dependency
-
-> Please download the support list corresponding to 'Maven' and copy it to the '$SEATNUNNEL_HOME/plugins/jdbc/lib/'
-> working directory
-
## Data Type Mapping
| Doris Data type | SeaTunnel Data type |
@@ -54,29 +48,40 @@ directly return the data
## Source Options
+Base configuration:
+
| Name | Type | Required | Default | Description |
|----------------------------------|--------|----------|------------|-----------------------------------------------------------------------------------------------------|
| fenodes | string | yes | - | FE address, the format is `"fe_host:fe_http_port"` |
| username | string | yes | - | User username |
| password | string | yes | - | User password |
+| doris.request.retries | int | no | 3 | Number of retries to send requests to Doris FE. |
+| doris.request.read.timeout.ms | int | no | 30000 | |
+| doris.request.connect.timeout.ms | int | no | 30000 | |
+| query-port | string | no | 9030 | Doris QueryPort |
+| doris.request.query.timeout.s | int | no | 3600 | Timeout period of Doris scan data, expressed in seconds. |
+| table_list | string | 否 | - | table list |
+
+Table list configuration:
+
+| Name | Type | Required | Default | Description |
+|----------------------------------|--------|----------|------------|-----------------------------------------------------------------------------------------------------|
| database | string | yes | - | The name of Doris database |
| table | string | yes | - | The name of Doris table |
| doris.read.field | string | no | - | Use the 'doris.read.field' parameter to select the doris table columns to read |
-| query-port | string | no | 9030 | Doris QueryPort |
| doris.filter.query | string | no | - | Data filtering in doris. the format is "field = value",example : doris.filter.query = "F_ID > 2" |
| doris.batch.size | int | no | 1024 | The maximum value that can be obtained by reading Doris BE once. |
-| doris.request.query.timeout.s | int | no | 3600 | Timeout period of Doris scan data, expressed in seconds. |
| doris.exec.mem.limit | long | no | 2147483648 | Maximum memory that can be used by a single be scan request. The default memory is 2G (2147483648). |
-| doris.request.retries | int | no | 3 | Number of retries to send requests to Doris FE. |
-| doris.request.read.timeout.ms | int | no | 30000 | |
-| doris.request.connect.timeout.ms | int | no | 30000 | |
+
+Note: When this configuration corresponds to a single table, you can flatten the configuration items in table_list to the outer layer.
### Tips
> It is not recommended to modify advanced parameters at will
-## Task Example
+## Example
+### single table
> This is an example of reading a Doris table and writing to Console.
```
@@ -159,4 +164,49 @@ sink {
Console {}
}
```
+### Multiple table
+```
+env{
+ parallelism = 1
+ job.mode = "BATCH"
+}
+source{
+ Doris {
+ fenodes = "xxxx:8030"
+ username = root
+ password = ""
+ table_list = [
+ {
+ database = "st_source_0"
+ table = "doris_table_0"
+ doris.read.field = "F_ID,F_INT,F_BIGINT,F_TINYINT"
+ doris.filter.query = "F_ID >= 50"
+ },
+ {
+ database = "st_source_1"
+ table = "doris_table_1"
+ }
+ ]
+ }
+}
+
+transform {}
+
+sink{
+ Doris {
+ fenodes = "xxxx:8030"
+ schema_save_mode = "RECREATE_SCHEMA"
+ username = root
+ password = ""
+ database = "st_sink"
+ table = "${table_name}"
+ sink.enable-2pc = "true"
+ sink.label-prefix = "test_json"
+ doris.config = {
+ format="json"
+ read_json_by_line="true"
+ }
+ }
+}
+```
diff --git a/docs/zh/connector-v2/source/Doris.md b/docs/zh/connector-v2/source/Doris.md
new file mode 100644
index 00000000000..ba3549473a5
--- /dev/null
+++ b/docs/zh/connector-v2/source/Doris.md
@@ -0,0 +1,212 @@
+# Doris
+
+> Doris 源连接器
+
+## 支持的引擎
+
+> Spark
+> Flink
+> SeaTunnel Zeta
+
+## 主要功能
+
+- [x] [批处理](../../concept/connector-v2-features.md)
+- [ ] [流处理](../../concept/connector-v2-features.md)
+- [ ] [精确一次](../../concept/connector-v2-features.md)
+- [x] [列投影](../../concept/connector-v2-features.md)
+- [x] [并行度](../../concept/connector-v2-features.md)
+- [x] [支持用户自定义分片](../../concept/connector-v2-features.md)
+- [x] [支持多表读](../../concept/connector-v2-features.md)
+
+## 描述
+
+用于 Apache Doris 的源连接器。
+
+## 支持的数据源信息
+
+| 数据源 | 支持版本 | 驱动 | Url | Maven |
+|------------|--------------------------------------|--------|-----|-------|
+| Doris | 仅支持Doris2.0及以上版本. | - | - | - |
+
+## 数据类型映射
+
+| Doris 数据类型 | SeaTunnel 数据类型 |
+|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
+| INT | INT |
+| TINYINT | TINYINT |
+| SMALLINT | SMALLINT |
+| BIGINT | BIGINT |
+| LARGEINT | STRING |
+| BOOLEAN | BOOLEAN |
+| DECIMAL | DECIMAL((Get the designated column's specified column size)+1,
(Gets the designated column's number of digits to right of the decimal point.))) |
+| FLOAT | FLOAT |
+| DOUBLE | DOUBLE |
+| CHAR
VARCHAR
STRING
TEXT | STRING |
+| DATE | DATE |
+| DATETIME
DATETIME(p) | TIMESTAMP |
+| ARRAY | ARRAY |
+
+## 源选项
+
+基础配置:
+
+| 名称 | 类型 | 是否必须 | 默认值 | 描述 |
+|----------------------------------|--------|----------|------------|-----------------------------------------------------------------------------------------------------|
+| fenodes | string | yes | - | FE 地址, 格式:`"fe_host:fe_http_port"` |
+| username | string | yes | - | 用户名 |
+| password | string | yes | - | 密码 |
+| doris.request.retries | int | no | 3 | 请求Doris FE的重试次数 |
+| doris.request.read.timeout.ms | int | no | 30000 | |
+| doris.request.connect.timeout.ms | int | no | 30000 | |
+| query-port | string | no | 9030 | Doris查询端口 |
+| doris.request.query.timeout.s | int | no | 3600 | Doris扫描数据的超时时间,单位秒 |
+| table_list | string | 否 | - | 表清单 |
+
+表清单配置:
+
+| 名称 | 类型 | 是否必须 | 默认值 | 描述 |
+|----------------------------------|--------|----------|------------|-----------------------------------------------------------------------------------------------------|
+| database | string | yes | - | 数据库 |
+| table | string | yes | - | 表名 |
+| doris.read.field | string | no | - | 选择要读取的Doris表字段 |
+| doris.filter.query | string | no | - | 数据过滤. 格式:"字段 = 值", 例如:doris.filter.query = "F_ID > 2" |
+| doris.batch.size | int | no | 1024 | 每次能够从BE中读取到的最大行数 |
+| doris.exec.mem.limit | long | no | 2147483648 | 单个be扫描请求可以使用的最大内存。默认内存为2G(2147483648) |
+
+注意: 当此配置对应于单个表时,您可以将table_list中的配置项展平到外层。
+
+### 提示
+
+> 不建议随意修改高级参数
+
+## 例子
+
+### 单表
+> 这是一个从doris读取数据后,输出到控制台的例子:
+
+```
+env {
+ parallelism = 2
+ job.mode = "BATCH"
+}
+source{
+ Doris {
+ fenodes = "doris_e2e:8030"
+ username = root
+ password = ""
+ database = "e2e_source"
+ table = "doris_e2e_table"
+ }
+}
+
+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/sql
+}
+
+sink {
+ Console {}
+}
+```
+
+使用`doris.read.field`参数来选择需要读取的Doris表字段:
+
+```
+env {
+ parallelism = 2
+ job.mode = "BATCH"
+}
+source{
+ Doris {
+ fenodes = "doris_e2e:8030"
+ username = root
+ password = ""
+ database = "e2e_source"
+ table = "doris_e2e_table"
+ doris.read.field = "F_ID,F_INT,F_BIGINT,F_TINYINT,F_SMALLINT"
+ }
+}
+
+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/sql
+}
+
+sink {
+ Console {}
+}
+```
+
+使用`doris.filter.query`来过滤数据,参数值将作为过滤条件直接传递到doris:
+
+```
+env {
+ parallelism = 2
+ job.mode = "BATCH"
+}
+source{
+ Doris {
+ fenodes = "doris_e2e:8030"
+ username = root
+ password = ""
+ database = "e2e_source"
+ table = "doris_e2e_table"
+ doris.filter.query = "F_ID > 2"
+ }
+}
+
+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/sql
+}
+
+sink {
+ Console {}
+}
+```
+### 多表
+```
+env{
+ parallelism = 1
+ job.mode = "BATCH"
+}
+
+source{
+ Doris {
+ fenodes = "xxxx:8030"
+ username = root
+ password = ""
+ table_list = [
+ {
+ database = "st_source_0"
+ table = "doris_table_0"
+ doris.read.field = "F_ID,F_INT,F_BIGINT,F_TINYINT"
+ doris.filter.query = "F_ID >= 50"
+ },
+ {
+ database = "st_source_1"
+ table = "doris_table_1"
+ }
+ ]
+ }
+}
+
+transform {}
+
+sink{
+ Doris {
+ fenodes = "xxxx:8030"
+ schema_save_mode = "RECREATE_SCHEMA"
+ username = root
+ password = ""
+ database = "st_sink"
+ table = "${table_name}"
+ sink.enable-2pc = "true"
+ sink.label-prefix = "test_json"
+ doris.config = {
+ format="json"
+ read_json_by_line="true"
+ }
+ }
+}
+```
diff --git a/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/backend/BackendClient.java b/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/backend/BackendClient.java
index 31bdb2a78e7..04f96d2d607 100644
--- a/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/backend/BackendClient.java
+++ b/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/backend/BackendClient.java
@@ -25,7 +25,7 @@
import org.apache.seatunnel.shade.org.apache.thrift.transport.TTransport;
import org.apache.seatunnel.shade.org.apache.thrift.transport.TTransportException;
-import org.apache.seatunnel.connectors.doris.config.DorisConfig;
+import org.apache.seatunnel.connectors.doris.config.DorisSourceConfig;
import org.apache.seatunnel.connectors.doris.exception.DorisConnectorErrorCode;
import org.apache.seatunnel.connectors.doris.exception.DorisConnectorException;
import org.apache.seatunnel.connectors.doris.source.serialization.Routing;
@@ -55,7 +55,7 @@ public class BackendClient {
private final int socketTimeout;
private final int connectTimeout;
- public BackendClient(Routing routing, DorisConfig readOptions) {
+ public BackendClient(Routing routing, DorisSourceConfig readOptions) {
this.routing = routing;
this.connectTimeout = readOptions.getRequestConnectTimeoutMs();
this.socketTimeout = readOptions.getRequestReadTimeoutMs();
diff --git a/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalog.java b/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalog.java
index a7f5eabf63d..324200e5e4d 100644
--- a/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalog.java
+++ b/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalog.java
@@ -37,7 +37,6 @@
import org.apache.seatunnel.common.exception.CommonError;
import org.apache.seatunnel.common.exception.CommonErrorCode;
import org.apache.seatunnel.common.exception.SeaTunnelRuntimeException;
-import org.apache.seatunnel.connectors.doris.config.DorisConfig;
import org.apache.seatunnel.connectors.doris.config.DorisOptions;
import org.apache.seatunnel.connectors.doris.datatype.DorisTypeConverterFactory;
import org.apache.seatunnel.connectors.doris.datatype.DorisTypeConverterV2;
@@ -85,7 +84,7 @@ public class DorisCatalog implements Catalog {
private Connection conn;
- private DorisConfig dorisConfig;
+ private String createTableTemplate;
private String dorisVersion;
@@ -110,9 +109,9 @@ public DorisCatalog(
Integer queryPort,
String username,
String password,
- DorisConfig config) {
+ String createTableTemplate) {
this(catalogName, frontEndNodes, queryPort, username, password);
- this.dorisConfig = config;
+ this.createTableTemplate = createTableTemplate;
}
public DorisCatalog(
@@ -121,9 +120,9 @@ public DorisCatalog(
Integer queryPort,
String username,
String password,
- DorisConfig config,
+ String createTableTemplate,
String defaultDatabase) {
- this(catalogName, frontEndNodes, queryPort, username, password, config);
+ this(catalogName, frontEndNodes, queryPort, username, password, createTableTemplate);
this.defaultDatabase = defaultDatabase;
}
@@ -414,7 +413,7 @@ public void createTable(TablePath tablePath, CatalogTable table, boolean ignoreI
String stmt =
DorisCatalogUtil.getCreateTableStatement(
- dorisConfig.getCreateTableTemplate(), tablePath, table, typeConverter);
+ createTableTemplate, tablePath, table, typeConverter);
try (Statement statement = conn.createStatement()) {
statement.execute(stmt);
} catch (SQLException e) {
@@ -510,7 +509,7 @@ public PreviewResult previewAction(
checkArgument(catalogTable.isPresent(), "CatalogTable cannot be null");
return new SQLPreviewResult(
DorisCatalogUtil.getCreateTableStatement(
- dorisConfig.getCreateTableTemplate(),
+ createTableTemplate,
tablePath,
catalogTable.get(),
// used for test when typeConverter is null
diff --git a/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalogFactory.java b/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalogFactory.java
index 1071b52f05a..7fd1da603e2 100644
--- a/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalogFactory.java
+++ b/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalogFactory.java
@@ -22,11 +22,14 @@
import org.apache.seatunnel.api.table.catalog.Catalog;
import org.apache.seatunnel.api.table.factory.CatalogFactory;
import org.apache.seatunnel.api.table.factory.Factory;
-import org.apache.seatunnel.connectors.doris.config.DorisConfig;
import org.apache.seatunnel.connectors.doris.config.DorisOptions;
+import org.apache.seatunnel.connectors.doris.config.DorisSinkOptions;
import com.google.auto.service.AutoService;
+import static org.apache.seatunnel.connectors.doris.config.DorisOptions.IDENTIFIER;
+import static org.apache.seatunnel.connectors.doris.config.DorisSinkOptions.SAVE_MODE_CREATE_TEMPLATE;
+
@AutoService(Factory.class)
public class DorisCatalogFactory implements CatalogFactory {
@@ -38,13 +41,13 @@ public Catalog createCatalog(String catalogName, ReadonlyConfig options) {
options.get(DorisOptions.QUERY_PORT),
options.get(DorisOptions.USERNAME),
options.get(DorisOptions.PASSWORD),
- DorisConfig.of(options),
- options.get(DorisOptions.DEFAULT_DATABASE));
+ options.get(SAVE_MODE_CREATE_TEMPLATE),
+ options.get(DorisSinkOptions.DEFAULT_DATABASE));
}
@Override
public String factoryIdentifier() {
- return DorisConfig.IDENTIFIER;
+ return IDENTIFIER;
}
@Override
diff --git a/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/config/DorisConfig.java b/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/config/DorisConfig.java
deleted file mode 100644
index f7155e8a647..00000000000
--- a/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/config/DorisConfig.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.seatunnel.connectors.doris.config;
-
-import org.apache.seatunnel.shade.com.typesafe.config.Config;
-
-import org.apache.seatunnel.api.configuration.ReadonlyConfig;
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.Properties;
-
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DATABASE;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_BATCH_SIZE;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_DESERIALIZE_ARROW_ASYNC;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_DESERIALIZE_QUEUE_SIZE;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_EXEC_MEM_LIMIT;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_FILTER_QUERY;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_READ_FIELD;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_REQUEST_CONNECT_TIMEOUT_MS;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_REQUEST_QUERY_TIMEOUT_S;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_REQUEST_READ_TIMEOUT_MS;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_REQUEST_RETRIES;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_SINK_CONFIG_PREFIX;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.DORIS_TABLET_SIZE;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.FENODES;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.NEEDS_UNSUPPORTED_TYPE_CASTING;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.PASSWORD;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.QUERY_PORT;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.SAVE_MODE_CREATE_TEMPLATE;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.SINK_BUFFER_COUNT;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.SINK_BUFFER_SIZE;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.SINK_CHECK_INTERVAL;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.SINK_ENABLE_2PC;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.SINK_ENABLE_DELETE;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.SINK_LABEL_PREFIX;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.SINK_MAX_RETRIES;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.TABLE;
-import static org.apache.seatunnel.connectors.doris.config.DorisOptions.USERNAME;
-
-@Setter
-@Getter
-@ToString
-public class DorisConfig implements Serializable {
-
- public static final String IDENTIFIER = "Doris";
-
- // common option
- private String frontends;
- private String database;
- private String table;
- private String username;
- private String password;
- private Integer queryPort;
- private int batchSize;
-
- // source option
- private String readField;
- private String filterQuery;
- private Integer tabletSize;
- private Integer requestConnectTimeoutMs;
- private Integer requestReadTimeoutMs;
- private Integer requestQueryTimeoutS;
- private Integer requestRetries;
- private Boolean deserializeArrowAsync;
- private int deserializeQueueSize;
- private Long execMemLimit;
- private boolean useOldApi;
-
- // sink option
- private Boolean enable2PC;
- private Boolean enableDelete;
- private String labelPrefix;
- private Integer checkInterval;
- private Integer maxRetries;
- private Integer bufferSize;
- private Integer bufferCount;
- private Properties streamLoadProps;
- private boolean needsUnsupportedTypeCasting;
-
- // create table option
- private String createTableTemplate;
-
- public static DorisConfig of(Config pluginConfig) {
- return of(ReadonlyConfig.fromConfig(pluginConfig));
- }
-
- public static DorisConfig of(ReadonlyConfig config) {
-
- DorisConfig dorisConfig = new DorisConfig();
-
- // common option
- dorisConfig.setFrontends(config.get(FENODES));
- dorisConfig.setUsername(config.get(USERNAME));
- dorisConfig.setPassword(config.get(PASSWORD));
- dorisConfig.setQueryPort(config.get(QUERY_PORT));
- dorisConfig.setStreamLoadProps(parseStreamLoadProperties(config));
- dorisConfig.setDatabase(config.get(DATABASE));
- dorisConfig.setTable(config.get(TABLE));
-
- // source option
- dorisConfig.setReadField(config.get(DORIS_READ_FIELD));
- dorisConfig.setFilterQuery(config.get(DORIS_FILTER_QUERY));
- dorisConfig.setTabletSize(config.get(DORIS_TABLET_SIZE));
- dorisConfig.setRequestConnectTimeoutMs(config.get(DORIS_REQUEST_CONNECT_TIMEOUT_MS));
- dorisConfig.setRequestQueryTimeoutS(config.get(DORIS_REQUEST_QUERY_TIMEOUT_S));
- dorisConfig.setRequestReadTimeoutMs(config.get(DORIS_REQUEST_READ_TIMEOUT_MS));
- dorisConfig.setRequestRetries(config.get(DORIS_REQUEST_RETRIES));
- dorisConfig.setDeserializeArrowAsync(config.get(DORIS_DESERIALIZE_ARROW_ASYNC));
- dorisConfig.setDeserializeQueueSize(config.get(DORIS_DESERIALIZE_QUEUE_SIZE));
- dorisConfig.setBatchSize(config.get(DORIS_BATCH_SIZE));
- dorisConfig.setExecMemLimit(config.get(DORIS_EXEC_MEM_LIMIT));
-
- // sink option
- dorisConfig.setEnable2PC(config.get(SINK_ENABLE_2PC));
- dorisConfig.setLabelPrefix(config.get(SINK_LABEL_PREFIX));
- dorisConfig.setCheckInterval(config.get(SINK_CHECK_INTERVAL));
- dorisConfig.setMaxRetries(config.get(SINK_MAX_RETRIES));
- dorisConfig.setBufferSize(config.get(SINK_BUFFER_SIZE));
- dorisConfig.setBufferCount(config.get(SINK_BUFFER_COUNT));
- dorisConfig.setEnableDelete(config.get(SINK_ENABLE_DELETE));
- dorisConfig.setNeedsUnsupportedTypeCasting(config.get(NEEDS_UNSUPPORTED_TYPE_CASTING));
-
- // create table option
- dorisConfig.setCreateTableTemplate(config.get(SAVE_MODE_CREATE_TEMPLATE));
-
- return dorisConfig;
- }
-
- private static Properties parseStreamLoadProperties(ReadonlyConfig config) {
- Properties streamLoadProps = new Properties();
- if (config.getOptional(DORIS_SINK_CONFIG_PREFIX).isPresent()) {
- Map map = config.getOptional(DORIS_SINK_CONFIG_PREFIX).get();
- map.forEach(
- (key, value) -> {
- streamLoadProps.put(key.toLowerCase(), value);
- });
- }
- return streamLoadProps;
- }
-}
diff --git a/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/config/DorisOptions.java b/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/config/DorisOptions.java
index ddf1195b6ed..bcdf24c9d7b 100644
--- a/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/config/DorisOptions.java
+++ b/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/config/DorisOptions.java
@@ -20,32 +20,12 @@
import org.apache.seatunnel.api.configuration.Option;
import org.apache.seatunnel.api.configuration.Options;
import org.apache.seatunnel.api.configuration.util.OptionRule;
-import org.apache.seatunnel.api.sink.DataSaveMode;
-import org.apache.seatunnel.api.sink.SaveModePlaceHolder;
-import org.apache.seatunnel.api.sink.SchemaSaveMode;
-
-import java.util.Map;
-
-import static org.apache.seatunnel.api.sink.SinkCommonOptions.MULTI_TABLE_SINK_REPLICA;
public interface DorisOptions {
- int DORIS_TABLET_SIZE_MIN = 1;
- int DORIS_TABLET_SIZE_DEFAULT = Integer.MAX_VALUE;
- int DORIS_REQUEST_CONNECT_TIMEOUT_MS_DEFAULT = 30 * 1000;
- int DORIS_REQUEST_READ_TIMEOUT_MS_DEFAULT = 30 * 1000;
- int DORIS_REQUEST_QUERY_TIMEOUT_S_DEFAULT = 3600;
- int DORIS_REQUEST_RETRIES_DEFAULT = 3;
- Boolean DORIS_DESERIALIZE_ARROW_ASYNC_DEFAULT = false;
- int DORIS_DESERIALIZE_QUEUE_SIZE_DEFAULT = 64;
- int DORIS_BATCH_SIZE_DEFAULT = 1024;
- long DORIS_EXEC_MEM_LIMIT_DEFAULT = 2147483648L;
- int DEFAULT_SINK_CHECK_INTERVAL = 10000;
- int DEFAULT_SINK_MAX_RETRIES = 3;
- int DEFAULT_SINK_BUFFER_SIZE = 256 * 1024;
- int DEFAULT_SINK_BUFFER_COUNT = 3;
-
+ String IDENTIFIER = "Doris";
String DORIS_DEFAULT_CLUSTER = "default_cluster";
+ int DORIS_BATCH_SIZE_DEFAULT = 1024;
// common option
Option FENODES =
@@ -72,6 +52,7 @@ public interface DorisOptions {
.stringType()
.noDefaultValue()
.withDescription("the doris user name.");
+
Option PASSWORD =
Options.key("password")
.stringType()
@@ -79,202 +60,17 @@ public interface DorisOptions {
.withDescription("the doris password.");
Option TABLE =
- Options.key("table")
- .stringType()
- .noDefaultValue()
- .withDescription("the doris table name.");
+ Options.key("table").stringType().noDefaultValue().withDescription("table");
+
Option DATABASE =
- Options.key("database")
- .stringType()
- .noDefaultValue()
- .withDescription("the doris database name.");
+ Options.key("database").stringType().noDefaultValue().withDescription("database");
+
Option DORIS_BATCH_SIZE =
Options.key("doris.batch.size")
.intType()
.defaultValue(DORIS_BATCH_SIZE_DEFAULT)
.withDescription("the batch size of the doris read/write.");
- // source config options
- Option DORIS_READ_FIELD =
- Options.key("doris.read.field")
- .stringType()
- .noDefaultValue()
- .withDescription(
- "List of column names in the Doris table, separated by commas");
- Option DORIS_FILTER_QUERY =
- Options.key("doris.filter.query")
- .stringType()
- .noDefaultValue()
- .withDescription(
- "Filter expression of the query, which is transparently transmitted to Doris. Doris uses this expression to complete source-side data filtering");
- Option DORIS_TABLET_SIZE =
- Options.key("doris.request.tablet.size")
- .intType()
- .defaultValue(DORIS_TABLET_SIZE_DEFAULT)
- .withDescription("");
- Option DORIS_REQUEST_CONNECT_TIMEOUT_MS =
- Options.key("doris.request.connect.timeout.ms")
- .intType()
- .defaultValue(DORIS_REQUEST_CONNECT_TIMEOUT_MS_DEFAULT)
- .withDescription("");
- Option DORIS_REQUEST_READ_TIMEOUT_MS =
- Options.key("doris.request.read.timeout.ms")
- .intType()
- .defaultValue(DORIS_REQUEST_READ_TIMEOUT_MS_DEFAULT)
- .withDescription("");
- Option DORIS_REQUEST_QUERY_TIMEOUT_S =
- Options.key("doris.request.query.timeout.s")
- .intType()
- .defaultValue(DORIS_REQUEST_QUERY_TIMEOUT_S_DEFAULT)
- .withDescription("");
- Option DORIS_REQUEST_RETRIES =
- Options.key("doris.request.retries")
- .intType()
- .defaultValue(DORIS_REQUEST_RETRIES_DEFAULT)
- .withDescription("");
- Option DORIS_DESERIALIZE_ARROW_ASYNC =
- Options.key("doris.deserialize.arrow.async")
- .booleanType()
- .defaultValue(DORIS_DESERIALIZE_ARROW_ASYNC_DEFAULT)
- .withDescription("");
- Option DORIS_DESERIALIZE_QUEUE_SIZE =
- Options.key("doris.request.retriesdoris.deserialize.queue.size")
- .intType()
- .defaultValue(DORIS_DESERIALIZE_QUEUE_SIZE_DEFAULT)
- .withDescription("");
-
- Option DORIS_EXEC_MEM_LIMIT =
- Options.key("doris.exec.mem.limit")
- .longType()
- .defaultValue(DORIS_EXEC_MEM_LIMIT_DEFAULT)
- .withDescription("");
-
- // sink config options
- Option SINK_ENABLE_2PC =
- Options.key("sink.enable-2pc")
- .booleanType()
- .defaultValue(false)
- .withDescription("enable 2PC while loading");
-
- Option SINK_CHECK_INTERVAL =
- Options.key("sink.check-interval")
- .intType()
- .defaultValue(DEFAULT_SINK_CHECK_INTERVAL)
- .withDescription("check exception with the interval while loading");
- Option SINK_MAX_RETRIES =
- Options.key("sink.max-retries")
- .intType()
- .defaultValue(DEFAULT_SINK_MAX_RETRIES)
- .withDescription("the max retry times if writing records to database failed.");
- Option SINK_BUFFER_SIZE =
- Options.key("sink.buffer-size")
- .intType()
- .defaultValue(DEFAULT_SINK_BUFFER_SIZE)
- .withDescription("the buffer size to cache data for stream load.");
- Option SINK_BUFFER_COUNT =
- Options.key("sink.buffer-count")
- .intType()
- .defaultValue(DEFAULT_SINK_BUFFER_COUNT)
- .withDescription("the buffer count to cache data for stream load.");
- Option SINK_LABEL_PREFIX =
- Options.key("sink.label-prefix")
- .stringType()
- .defaultValue("")
- .withDescription("the unique label prefix.");
- Option SINK_ENABLE_DELETE =
- Options.key("sink.enable-delete")
- .booleanType()
- .defaultValue(false)
- .withDescription("whether to enable the delete function");
-
- Option