This is an automated email from the ASF dual-hosted git repository.
zihaoxiang pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 3dd1720601 [DSIP-83][datasource-plugin] Add DolphinDB datasource
(#17404)
3dd1720601 is described below
commit 3dd17206017be22a7f9ba748b0f5e8e3194002ea
Author: eco8848 <[email protected]>
AuthorDate: Wed Aug 20 13:40:30 2025 +0800
[DSIP-83][datasource-plugin] Add DolphinDB datasource (#17404)
---
.github/workflows/e2e.yml | 2 +
config/plugins_config | 1 +
docs/configs/docsdev.js | 8 ++
docs/docs/en/guide/datasource/dolphindb.md | 19 +++
docs/docs/zh/guide/datasource/dolphindb.md | 19 +++
docs/img/new_ui/dev/datasource/dolphindb-en.png | Bin 0 -> 93195 bytes
docs/img/new_ui/dev/datasource/dolphindb-zh.png | Bin 0 -> 94852 bytes
dolphinscheduler-bom/pom.xml | 7 +
.../common/constants/DataSourceConstants.java | 3 +
.../dolphinscheduler-datasource-all/pom.xml | 5 +
.../dolphinscheduler-datasource-dolphindb/pom.xml | 73 ++++++++++
.../dolphindb/DolphinDBAdHocDataSourceClient.java | 29 ++++
.../dolphindb/DolphinDBDataSourceChannel.java | 37 ++++++
.../DolphinDBDataSourceChannelFactory.java | 38 ++++++
.../dolphindb/DolphinDBPooledDataSourceClient.java | 29 ++++
.../dolphindb/param/DolphinDBConnectionParam.java | 37 ++++++
.../param/DolphinDBDataSourceParamDTO.java | 42 ++++++
.../param/DolphinDBDataSourceProcessor.java | 148 +++++++++++++++++++++
.../DolphinDBDataSourceChannelFactoryTest.java | 33 +++++
.../dolphindb/DolphinDBDataSourceChannelTest.java | 41 ++++++
.../param/DolphinDBDataSourceProcessorTest.java | 107 +++++++++++++++
.../dolphindb/utils/DataSourceUtilsTest.java | 145 ++++++++++++++++++++
dolphinscheduler-datasource-plugin/pom.xml | 1 +
dolphinscheduler-dist/release-docs/LICENSE | 2 -
.../e2e/cases/DolphinDBDataSourceE2ETest.java | 107 +++++++++++++++
.../e2e/pages/datasource/DataSourcePage.java | 4 +-
.../datasource-dolphindb/docker-compose.yaml | 60 +++++++++
.../apache/dolphinscheduler/spi/enums/DbType.java | 3 +-
.../src/service/modules/data-source/types.ts | 2 +
.../src/views/datasource/list/use-form.ts | 15 ++-
.../task/components/node/fields/use-datasource.ts | 5 +
31 files changed, 1016 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index 47ee657312..76bca077d9 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -145,6 +145,8 @@ jobs:
class:
org.apache.dolphinscheduler.e2e.cases.SqlServerDataSourceE2ETest
- name: HiveDataSourceE2ETest
class: org.apache.dolphinscheduler.e2e.cases.HiveDataSourceE2ETest
+ - name: DolphinDBDataSourceE2ETest
+ class:
org.apache.dolphinscheduler.e2e.cases.DolphinDBDataSourceE2ETest
env:
RECORDING_PATH: /tmp/recording-${{ matrix.case.name }}
steps:
diff --git a/config/plugins_config b/config/plugins_config
index eff859100f..71811f1ea3 100644
--- a/config/plugins_config
+++ b/config/plugins_config
@@ -62,6 +62,7 @@ dolphinscheduler-datasource-starrocks
dolphinscheduler-datasource-trino
dolphinscheduler-datasource-vertica
dolphinscheduler-datasource-zeppelin
+dolphinscheduler-datasource-dolphindb
--end--
--storage-plugins--
diff --git a/docs/configs/docsdev.js b/docs/configs/docsdev.js
index 6942d87fb8..9b5c5340dd 100644
--- a/docs/configs/docsdev.js
+++ b/docs/configs/docsdev.js
@@ -225,6 +225,10 @@ export default {
title: 'Remote Shell',
link:
'/en-us/docs/dev/user_doc/guide/task/remoteshell.html',
},
+ {
+ title: 'DolphinDB',
+ link:
'/en-us/docs/dev/user_doc/guide/datasource/dolphindb.html',
+ },
],
},
{
@@ -940,6 +944,10 @@ export default {
title: 'Remote Shell',
link:
'/zh-cn/docs/dev/user_doc/guide/task/remoteshell.html',
},
+ {
+ title: 'DolphinDB',
+ link:
'/zh-cn/docs/dev/user_doc/guide/datasource/dolphindb.html',
+ },
],
},
{
diff --git a/docs/docs/en/guide/datasource/dolphindb.md
b/docs/docs/en/guide/datasource/dolphindb.md
new file mode 100644
index 0000000000..08678c0f4e
--- /dev/null
+++ b/docs/docs/en/guide/datasource/dolphindb.md
@@ -0,0 +1,19 @@
+# DolphinDB
+
+
+
+- Datasource: Select DOLPHINDB
+- Datasource Name: Enter the name of the DataSource
+- Description: Enter a description of the DataSource
+- IP/Host Name: Enter the DolphinDB service IP
+- Port: Enter the DolphinDB service port
+- Username: Set the username for DolphinDB connection
+- Password: Set the password for DolphinDB connection
+- JDBC connection parameters: Parameter settings for DolphinDB connection, in
JSON format
+
+## Native Supported
+
+- No, please refer to the "Datasource Center" section in [Datasource
Configuration](../installation/datasource-setting.md) to activate the
datasource before using it.
+- JDBC driver configuration reference [DolphinDB JDBC
Connector](https://docs.dolphindb.com/en/API/JDBC.html)
+- Driver Maven dependency
[com.dolphindb:jdbc:3.00.3.0](https://mvnrepository.com/artifact/com.dolphindb/jdbc/3.00.3.0)
+
diff --git a/docs/docs/zh/guide/datasource/dolphindb.md
b/docs/docs/zh/guide/datasource/dolphindb.md
new file mode 100644
index 0000000000..334f48c4e5
--- /dev/null
+++ b/docs/docs/zh/guide/datasource/dolphindb.md
@@ -0,0 +1,19 @@
+# DOLPHINDB 数据源
+
+
+
+- 数据源:选择 DOLPHINDB
+- 数据源名称:输入数据源的名称
+- 描述:输入数据源的描述
+- IP 主机名:输入连接 DOLPHINDB 的 IP
+- 端口:输入连接 DOLPHINDB 的端口
+- 用户名:设置连接 DOLPHINDB 的用户名
+- 密码:设置连接 DOLPHINDB 的密码
+- JDBC 连接参数:用于 DOLPHINDB 连接的参数设置,以 JSON 形式填写
+
+## 是否原生支持
+
+- 否,使用前需请参考 [数据源配置](../installation/datasource-setting.md) 中的 "数据源中心" 章节激活数据源。
+- JDBC驱动配置参考文档 [DolphinDB JDBC
Connector](https://docs.dolphindb.cn/zh/jdbcdoc/jdbc.html)
+- 驱动Maven依赖
[com.dolphindb:jdbc:3.00.3.0](https://mvnrepository.com/artifact/com.dolphindb/jdbc/3.00.3.0)
+
diff --git a/docs/img/new_ui/dev/datasource/dolphindb-en.png
b/docs/img/new_ui/dev/datasource/dolphindb-en.png
new file mode 100644
index 0000000000..0a59a03427
Binary files /dev/null and b/docs/img/new_ui/dev/datasource/dolphindb-en.png
differ
diff --git a/docs/img/new_ui/dev/datasource/dolphindb-zh.png
b/docs/img/new_ui/dev/datasource/dolphindb-zh.png
new file mode 100644
index 0000000000..83b3448453
Binary files /dev/null and b/docs/img/new_ui/dev/datasource/dolphindb-zh.png
differ
diff --git a/dolphinscheduler-bom/pom.xml b/dolphinscheduler-bom/pom.xml
index 645786a0fc..0e7ff95a07 100644
--- a/dolphinscheduler-bom/pom.xml
+++ b/dolphinscheduler-bom/pom.xml
@@ -57,6 +57,7 @@
<cron-utils.version>9.1.6</cron-utils.version>
<h2.version>2.2.220</h2.version>
<mysql-connector.version>8.0.33</mysql-connector.version>
+ <dolphindb-jdbc.version>3.00.3.0</dolphindb-jdbc.version>
<vertica-jdbc.version>12.0.4-0</vertica-jdbc.version>
<oracle-jdbc.version>21.5.0.0</oracle-jdbc.version>
<dameng-jdbc.version>8.1.2.79</dameng-jdbc.version>
@@ -954,6 +955,12 @@
<artifactId>brace-expansion</artifactId>
<version>${brace-expansion.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>com.dolphindb</groupId>
+ <artifactId>jdbc</artifactId>
+ <version>${dolphindb-jdbc.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
diff --git
a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/DataSourceConstants.java
b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/DataSourceConstants.java
index 11347942bd..138ed3dac6 100644
---
a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/DataSourceConstants.java
+++
b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/DataSourceConstants.java
@@ -43,6 +43,7 @@ public class DataSourceConstants {
public static final String NET_SNOWFLAKE_JDBC_DRIVER =
"net.snowflake.client.jdbc.SnowflakeDriver";
public static final String COM_VERTICA_JDBC_DRIVER =
"com.vertica.jdbc.Driver";
public static final String COM_HANA_DB_JDBC_DRIVER =
"com.sap.db.jdbc.Driver";
+ public static final String COM_DOLPHINDB_JDBC_DRIVER =
"com.dolphindb.jdbc.Driver";
/**
* validation Query
@@ -66,6 +67,7 @@ public class DataSourceConstants {
public static final String VERTICA_VALIDATION_QUERY = "select 1";
public static final String HANA_VALIDATION_QUERY = "select 1 from DUMMY";
+ public static final String DOLPHINDB_VALIDATION_QUERY = "select 1";
/**
* jdbc url
@@ -91,6 +93,7 @@ public class DataSourceConstants {
public static final String JDBC_SNOWFLAKE = "jdbc:snowflake://";
public static final String JDBC_VERTICA = "jdbc:vertica://";
public static final String JDBC_HANA = "jdbc:sap://";
+ public static final String JDBC_DOLPHINDB = "jdbc:dolphindb://";
/**
* database type
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-all/pom.xml
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-all/pom.xml
index b62a3ce414..7da30a85af 100644
--- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-all/pom.xml
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-all/pom.xml
@@ -163,5 +163,10 @@
<artifactId>dolphinscheduler-datasource-aliyunserverlessspark</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.dolphinscheduler</groupId>
+ <artifactId>dolphinscheduler-datasource-dolphindb</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
</project>
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/pom.xml
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/pom.xml
new file mode 100644
index 0000000000..37d7cb698f
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/pom.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dolphinscheduler</groupId>
+ <artifactId>dolphinscheduler-datasource-plugin</artifactId>
+ <version>dev-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dolphinscheduler-datasource-dolphindb</artifactId>
+ <packaging>jar</packaging>
+ <name>${project.artifactId}</name>
+
+ <properties>
+ <plugin.name>datasource.dolphindb</plugin.name>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dolphinscheduler</groupId>
+ <artifactId>dolphinscheduler-datasource-api</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dolphinscheduler</groupId>
+ <artifactId>dolphinscheduler-common</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.dolphindb</groupId>
+ <artifactId>jdbc</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBAdHocDataSourceClient.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBAdHocDataSourceClient.java
new file mode 100644
index 0000000000..c3b57936f6
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBAdHocDataSourceClient.java
@@ -0,0 +1,29 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb;
+
+import
org.apache.dolphinscheduler.plugin.datasource.api.client.BaseAdHocDataSourceClient;
+import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+public class DolphinDBAdHocDataSourceClient extends BaseAdHocDataSourceClient {
+
+ public DolphinDBAdHocDataSourceClient(BaseConnectionParam
baseConnectionParam, DbType dbType) {
+ super(baseConnectionParam, dbType);
+ }
+}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannel.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannel.java
new file mode 100644
index 0000000000..900ffdbc45
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannel.java
@@ -0,0 +1,37 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb;
+
+import org.apache.dolphinscheduler.spi.datasource.AdHocDataSourceClient;
+import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
+import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
+import org.apache.dolphinscheduler.spi.datasource.PooledDataSourceClient;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+public class DolphinDBDataSourceChannel implements DataSourceChannel {
+
+ @Override
+ public AdHocDataSourceClient
createAdHocDataSourceClient(BaseConnectionParam baseConnectionParam, DbType
dbType) {
+ return new DolphinDBAdHocDataSourceClient(baseConnectionParam, dbType);
+ }
+
+ @Override
+ public PooledDataSourceClient
createPooledDataSourceClient(BaseConnectionParam baseConnectionParam, DbType
dbType) {
+ return new DolphinDBPooledDataSourceClient(baseConnectionParam,
dbType);
+ }
+}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannelFactory.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannelFactory.java
new file mode 100644
index 0000000000..8c020890f7
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannelFactory.java
@@ -0,0 +1,38 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb;
+
+import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
+import org.apache.dolphinscheduler.spi.datasource.DataSourceChannelFactory;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+import com.google.auto.service.AutoService;
+
+@AutoService(DataSourceChannelFactory.class)
+public class DolphinDBDataSourceChannelFactory implements
DataSourceChannelFactory {
+
+ @Override
+ public String getName() {
+ return DbType.DOLPHINDB.getName();
+ }
+
+ @Override
+ public DataSourceChannel create() {
+ return new DolphinDBDataSourceChannel();
+ }
+}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBPooledDataSourceClient.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBPooledDataSourceClient.java
new file mode 100644
index 0000000000..10d0002972
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBPooledDataSourceClient.java
@@ -0,0 +1,29 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb;
+
+import
org.apache.dolphinscheduler.plugin.datasource.api.client.BasePooledDataSourceClient;
+import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+public class DolphinDBPooledDataSourceClient extends
BasePooledDataSourceClient {
+
+ public DolphinDBPooledDataSourceClient(BaseConnectionParam
baseConnectionParam, DbType dbType) {
+ super(baseConnectionParam, dbType);
+ }
+}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBConnectionParam.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBConnectionParam.java
new file mode 100644
index 0000000000..888f62e57a
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBConnectionParam.java
@@ -0,0 +1,37 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb.param;
+
+import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
+
+public class DolphinDBConnectionParam extends BaseConnectionParam {
+
+ @Override
+ public String toString() {
+ return "DolphinDBConnectionParam{"
+ + "user='" + user + '\''
+ + ", password='" + password + '\''
+ + ", address='" + address + '\''
+ + ", jdbcUrl='" + jdbcUrl + '\''
+ + ", driverLocation='" + driverLocation + '\''
+ + ", driverClassName='" + driverClassName + '\''
+ + ", validationQuery='" + validationQuery + '\''
+ + ", other='" + other + '\''
+ + '}';
+ }
+}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBDataSourceParamDTO.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBDataSourceParamDTO.java
new file mode 100644
index 0000000000..359e23fc25
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBDataSourceParamDTO.java
@@ -0,0 +1,42 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb.param;
+
+import
org.apache.dolphinscheduler.plugin.datasource.api.datasource.BaseDataSourceParamDTO;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+public class DolphinDBDataSourceParamDTO extends BaseDataSourceParamDTO {
+
+ @Override
+ public String toString() {
+ return "DolphinDBDataSourceParamDTO{"
+ + "name='" + name + '\''
+ + ", note='" + note + '\''
+ + ", host='" + host + '\''
+ + ", port=" + port
+ + ", userName='" + userName + '\''
+ + ", password='" + password + '\''
+ + ", other='" + other + '\''
+ + '}';
+ }
+
+ @Override
+ public DbType getType() {
+ return DbType.DOLPHINDB;
+ }
+}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBDataSourceProcessor.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBDataSourceProcessor.java
new file mode 100644
index 0000000000..ba6582f5c8
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/main/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBDataSourceProcessor.java
@@ -0,0 +1,148 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb.param;
+
+import org.apache.dolphinscheduler.common.constants.Constants;
+import org.apache.dolphinscheduler.common.constants.DataSourceConstants;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import
org.apache.dolphinscheduler.plugin.datasource.api.datasource.AbstractDataSourceProcessor;
+import
org.apache.dolphinscheduler.plugin.datasource.api.datasource.BaseDataSourceParamDTO;
+import
org.apache.dolphinscheduler.plugin.datasource.api.datasource.DataSourceProcessor;
+import org.apache.dolphinscheduler.plugin.datasource.api.utils.PasswordUtils;
+import org.apache.dolphinscheduler.spi.datasource.ConnectionParam;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+import org.apache.commons.collections4.MapUtils;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import com.google.auto.service.AutoService;
+
+@AutoService(DataSourceProcessor.class)
+public class DolphinDBDataSourceProcessor extends AbstractDataSourceProcessor {
+
+ @Override
+ public void checkDatasourceParam(BaseDataSourceParamDTO
baseDataSourceParamDTO) {
+ if (!baseDataSourceParamDTO.getType().equals(DbType.REDSHIFT)) {
+ // due to redshift use not regular hosts
+ checkHost(baseDataSourceParamDTO.getHost());
+ }
+ checkOther(baseDataSourceParamDTO.getOther());
+ }
+
+ @Override
+ public BaseDataSourceParamDTO castDatasourceParamDTO(String paramJson) {
+ return JSONUtils.parseObject(paramJson,
DolphinDBDataSourceParamDTO.class);
+ }
+
+ @Override
+ public BaseDataSourceParamDTO createDatasourceParamDTO(String
connectionJson) {
+ DolphinDBConnectionParam connectionParams = (DolphinDBConnectionParam)
createConnectionParams(connectionJson);
+ DolphinDBDataSourceParamDTO dataSourceParamDTO = new
DolphinDBDataSourceParamDTO();
+
+ dataSourceParamDTO.setUserName(connectionParams.getUser());
+ dataSourceParamDTO.setDatabase(connectionParams.getDatabase());
+ dataSourceParamDTO.setOther(connectionParams.getOther());
+
+ String[] hostSeperator =
connectionParams.getAddress().split(Constants.DOUBLE_SLASH);
+ String[] hostPortArray = hostSeperator[hostSeperator.length -
1].split(Constants.COMMA);
+
dataSourceParamDTO.setPort(Integer.parseInt(hostPortArray[0].split(Constants.COLON)[1]));
+ dataSourceParamDTO.setHost(hostPortArray[0].split(Constants.COLON)[0]);
+
+ return dataSourceParamDTO;
+ }
+
+ @Override
+ public ConnectionParam createConnectionParams(BaseDataSourceParamDTO
datasourceParam) {
+ DolphinDBDataSourceParamDTO dolphinDBParam =
(DolphinDBDataSourceParamDTO) datasourceParam;
+ String address = String.format("%s%s:%s",
DataSourceConstants.JDBC_DOLPHINDB, dolphinDBParam.getHost(),
+ dolphinDBParam.getPort());
+ String jdbcUrl = String.format("%s", address);
+
+ DolphinDBConnectionParam dolphinDBConnectionParam = new
DolphinDBConnectionParam();
+ dolphinDBConnectionParam.setJdbcUrl(jdbcUrl);
+ dolphinDBConnectionParam.setDatabase(dolphinDBParam.getDatabase());
+ dolphinDBConnectionParam.setAddress(address);
+ dolphinDBConnectionParam.setUser(dolphinDBParam.getUserName());
+
dolphinDBConnectionParam.setPassword(PasswordUtils.encodePassword(dolphinDBParam.getPassword()));
+ dolphinDBConnectionParam.setDriverClassName(getDatasourceDriver());
+ dolphinDBConnectionParam.setValidationQuery(getValidationQuery());
+ dolphinDBConnectionParam.setOther(dolphinDBParam.getOther());
+
+ return dolphinDBConnectionParam;
+ }
+
+ @Override
+ public ConnectionParam createConnectionParams(String connectionJson) {
+ return JSONUtils.parseObject(connectionJson,
DolphinDBConnectionParam.class);
+ }
+
+ @Override
+ public String getDatasourceDriver() {
+ return DataSourceConstants.COM_DOLPHINDB_JDBC_DRIVER;
+ }
+
+ @Override
+ public String getValidationQuery() {
+ return DataSourceConstants.DOLPHINDB_VALIDATION_QUERY;
+ }
+
+ @Override
+ public String getJdbcUrl(ConnectionParam connectionParam) {
+ DolphinDBConnectionParam dolphinDBConnectionParam =
(DolphinDBConnectionParam) connectionParam;
+ if (MapUtils.isNotEmpty(dolphinDBConnectionParam.getOther())) {
+ return String.format("%s?%s",
dolphinDBConnectionParam.getJdbcUrl(),
+ transformOther(dolphinDBConnectionParam.getOther()));
+ }
+ return dolphinDBConnectionParam.getJdbcUrl();
+ }
+
+ @Override
+ public Connection getConnection(ConnectionParam connectionParam) throws
ClassNotFoundException, SQLException {
+ DolphinDBConnectionParam dolphinDBConnectionParam =
(DolphinDBConnectionParam) connectionParam;
+ Class.forName(getDatasourceDriver());
+ return DriverManager.getConnection(getJdbcUrl(connectionParam),
+ dolphinDBConnectionParam.getUser(),
+
PasswordUtils.decodePassword(dolphinDBConnectionParam.getPassword()));
+ }
+
+ @Override
+ public DbType getDbType() {
+ return DbType.DOLPHINDB;
+ }
+
+ @Override
+ public DataSourceProcessor create() {
+ return new DolphinDBDataSourceProcessor();
+ }
+
+ private String transformOther(Map<String, String> otherMap) {
+ if (MapUtils.isEmpty(otherMap)) {
+ return null;
+ }
+
+ List<String> list = new ArrayList<>(otherMap.size());
+ otherMap.forEach((key, value) -> list.add(String.format("%s=%s", key,
value)));
+ return String.join("&", list);
+ }
+}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannelFactoryTest.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannelFactoryTest.java
new file mode 100644
index 0000000000..f1b012e070
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannelFactoryTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb;
+
+import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+class DolphinDBDataSourceChannelFactoryTest {
+
+ @Test
+ public void testCreate() {
+ DolphinDBDataSourceChannelFactory factory = new
DolphinDBDataSourceChannelFactory();
+ DataSourceChannel channel = factory.create();
+ Assertions.assertNotNull(channel);
+ }
+}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannelTest.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannelTest.java
new file mode 100644
index 0000000000..ce82485217
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/DolphinDBDataSourceChannelTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb;
+
+import
org.apache.dolphinscheduler.plugin.datasource.dolphindb.param.DolphinDBConnectionParam;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mockito;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+@ExtendWith(MockitoExtension.class)
+class DolphinDBDataSourceChannelTest {
+
+ @Test
+ public void testCreateDataSourceClient() {
+ DolphinDBDataSourceChannel sourceChannel =
Mockito.mock(DolphinDBDataSourceChannel.class);
+ DolphinDBPooledDataSourceClient dataSourceClient =
Mockito.mock(DolphinDBPooledDataSourceClient.class);
+ Mockito.when(sourceChannel.createPooledDataSourceClient(Mockito.any(),
Mockito.any()))
+ .thenReturn(dataSourceClient);
+ Assertions.assertNotNull(
+ sourceChannel.createPooledDataSourceClient(new
DolphinDBConnectionParam(), DbType.DOLPHINDB));
+ }
+}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBDataSourceProcessorTest.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBDataSourceProcessorTest.java
new file mode 100644
index 0000000000..b59cbaa5fe
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/param/DolphinDBDataSourceProcessorTest.java
@@ -0,0 +1,107 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb.param;
+
+import org.apache.dolphinscheduler.common.constants.DataSourceConstants;
+import org.apache.dolphinscheduler.plugin.datasource.api.utils.PasswordUtils;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.MockedStatic;
+import org.mockito.Mockito;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+@ExtendWith(MockitoExtension.class)
+class DolphinDBDataSourceProcessorTest {
+
+ private DolphinDBDataSourceProcessor processor = new
DolphinDBDataSourceProcessor();
+
+ @Test
+ public void testCreateConnectionParams() {
+ Map<String, String> props = new HashMap<>();
+ props.put("serverTimezone", "utc");
+ DolphinDBDataSourceParamDTO dolphinDBDataSourceParamDTO = new
DolphinDBDataSourceParamDTO();
+ dolphinDBDataSourceParamDTO.setUserName("admin");
+ dolphinDBDataSourceParamDTO.setPassword("123456");
+ dolphinDBDataSourceParamDTO.setHost("localhost");
+ dolphinDBDataSourceParamDTO.setPort(8848);
+ dolphinDBDataSourceParamDTO.setOther(props);
+ try (MockedStatic<PasswordUtils> mockedStaticPasswordUtils =
Mockito.mockStatic(PasswordUtils.class)) {
+ mockedStaticPasswordUtils.when(() ->
PasswordUtils.encodePassword(Mockito.anyString())).thenReturn("test");
+ DolphinDBConnectionParam connectionParams =
(DolphinDBConnectionParam) processor
+ .createConnectionParams(dolphinDBDataSourceParamDTO);
+ Assertions.assertEquals("jdbc:dolphindb://localhost:8848",
connectionParams.getAddress());
+ Assertions.assertEquals("jdbc:dolphindb://localhost:8848",
connectionParams.getJdbcUrl());
+ }
+ }
+
+ @Test
+ public void testCreateConnectionParams2() {
+ String connectionJson =
+
"{\"user\":\"admin\",\"password\":\"123456\",\"address\":\"jdbc:dolphindb://localhost:8848\""
+ +
",\"jdbcUrl\":\"jdbc:dolphindb://localhost:8848/default\"}";
+ DolphinDBConnectionParam connectionParams = (DolphinDBConnectionParam)
processor
+ .createConnectionParams(connectionJson);
+ Assertions.assertNotNull(connectionJson);
+ Assertions.assertEquals("admin", connectionParams.getUser());
+ }
+
+ @Test
+ public void testGetDatasourceDriver() {
+ Assertions.assertEquals(DataSourceConstants.COM_DOLPHINDB_JDBC_DRIVER,
+ processor.getDatasourceDriver());
+ }
+
+ @Test
+ public void testGetJdbcUrl() {
+ DolphinDBConnectionParam param = new DolphinDBConnectionParam();
+ param.setJdbcUrl("jdbc:dolphindb://localhost:8848");
+ Assertions.assertEquals(
+ "jdbc:dolphindb://localhost:8848",
+ processor.getJdbcUrl(param));
+ }
+
+ @Test
+ public void testGetDbType() {
+ Assertions.assertEquals(DbType.DOLPHINDB, processor.getDbType());
+ }
+
+ @Test
+ public void testGetValidationQuery() {
+ Assertions.assertEquals(DataSourceConstants.DOLPHINDB_VALIDATION_QUERY,
+ processor.getValidationQuery());
+ }
+
+ @Test
+ public void testGetDatasourceUniqueId() {
+ DolphinDBConnectionParam param = new DolphinDBConnectionParam();
+ param.setJdbcUrl("jdbc:dolphindb://localhost:8848/");
+ param.setUser("admin");
+ param.setPassword("123456");
+ try (MockedStatic<PasswordUtils> mockedPasswordUtils =
Mockito.mockStatic(PasswordUtils.class)) {
+ mockedPasswordUtils.when(() ->
PasswordUtils.encodePassword(Mockito.anyString())).thenReturn("123456");
+
Assertions.assertEquals("dolphindb@admin@123456@jdbc:dolphindb://localhost:8848/",
+ processor.getDatasourceUniqueId(param, DbType.DOLPHINDB));
+ }
+ }
+}
diff --git
a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/utils/DataSourceUtilsTest.java
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/utils/DataSourceUtilsTest.java
new file mode 100644
index 0000000000..02b78f279a
--- /dev/null
+++
b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-dolphindb/src/test/java/org/apache/dolphinscheduler/plugin/datasource/dolphindb/utils/DataSourceUtilsTest.java
@@ -0,0 +1,145 @@
+/*
+ * 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.dolphinscheduler.plugin.datasource.dolphindb.utils;
+
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.common.utils.PropertyUtils;
+import
org.apache.dolphinscheduler.plugin.datasource.api.plugin.DataSourceClientProvider;
+import org.apache.dolphinscheduler.plugin.datasource.api.utils.CommonUtils;
+import org.apache.dolphinscheduler.plugin.datasource.api.utils.DataSourceUtils;
+import org.apache.dolphinscheduler.plugin.datasource.api.utils.PasswordUtils;
+import
org.apache.dolphinscheduler.plugin.datasource.dolphindb.param.DolphinDBConnectionParam;
+import
org.apache.dolphinscheduler.plugin.datasource.dolphindb.param.DolphinDBDataSourceParamDTO;
+import org.apache.dolphinscheduler.spi.datasource.ConnectionParam;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.MockedStatic;
+import org.mockito.Mockito;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+@ExtendWith(MockitoExtension.class)
+public class DataSourceUtilsTest {
+
+ @Test
+ public void testCheckDatasourceParam() {
+ DolphinDBDataSourceParamDTO paramDTO = new
DolphinDBDataSourceParamDTO();
+ paramDTO.setHost("localhost");
+ Map<String, String> other = new HashMap<>();
+ other.put("serverTimezone", "Asia/Shanghai");
+ other.put("queryTimeout", "-1");
+ other.put("characterEncoding", "utf8");
+ paramDTO.setOther(other);
+ DataSourceUtils.checkDatasourceParam(paramDTO);
+ Assertions.assertTrue(true);
+ }
+
+ @Test
+ public void testBuildConnectionParams() {
+ DolphinDBDataSourceParamDTO paramDTO = new
DolphinDBDataSourceParamDTO();
+ paramDTO.setHost("localhost");
+ paramDTO.setUserName("admin");
+ paramDTO.setPort(8848);
+ paramDTO.setPassword("123456");
+
+ try (
+ MockedStatic<PasswordUtils> mockedStaticPasswordUtils =
Mockito.mockStatic(PasswordUtils.class);
+ MockedStatic<CommonUtils> mockedStaticCommonUtils =
Mockito.mockStatic(CommonUtils.class)) {
+ mockedStaticPasswordUtils.when(() ->
PasswordUtils.encodePassword(Mockito.anyString()))
+ .thenReturn("123456");
+
mockedStaticCommonUtils.when(CommonUtils::getKerberosStartupState).thenReturn(false);
+ ConnectionParam connectionParam =
DataSourceUtils.buildConnectionParams(paramDTO);
+ Assertions.assertNotNull(connectionParam);
+ }
+ }
+
+ @Test
+ public void testBuildConnectionParams2() {
+ DolphinDBDataSourceParamDTO paramDTO = new
DolphinDBDataSourceParamDTO();
+ paramDTO.setHost("localhost");
+ paramDTO.setUserName("root");
+ paramDTO.setPort(5433);
+ paramDTO.setPassword("123456");
+ ConnectionParam connectionParam =
DataSourceUtils.buildConnectionParams(DbType.DOLPHINDB,
+ JSONUtils.toJsonString(paramDTO));
+ Assertions.assertNotNull(connectionParam);
+ }
+
+ @Test
+ public void testGetConnection() throws ExecutionException, SQLException {
+ try (
+ MockedStatic<PropertyUtils> mockedStaticPropertyUtils =
Mockito.mockStatic(PropertyUtils.class);
+ MockedStatic<DataSourceClientProvider>
mockedStaticDataSourceClientProvider =
+ Mockito.mockStatic(DataSourceClientProvider.class)) {
+ mockedStaticPropertyUtils.when(() ->
PropertyUtils.getLong("kerberos.expire.time", 24L)).thenReturn(24L);
+
+ Connection connection = Mockito.mock(Connection.class);
+
Mockito.when(DataSourceClientProvider.getAdHocConnection(Mockito.any(),
Mockito.any()))
+ .thenReturn(connection);
+
+ DolphinDBConnectionParam connectionParam = new
DolphinDBConnectionParam();
+ connectionParam.setUser("admin");
+ connectionParam.setPassword("123456");
+ connection =
DataSourceClientProvider.getAdHocConnection(DbType.DOLPHINDB, connectionParam);
+
+ Assertions.assertNotNull(connection);
+ }
+
+ }
+
+ @Test
+ public void testGetJdbcUrl() {
+ DolphinDBConnectionParam connectionParam = new
DolphinDBConnectionParam();
+ connectionParam.setJdbcUrl("jdbc:dolphindb://localhost:8848");
+ String jdbcUrl = DataSourceUtils.getJdbcUrl(DbType.DOLPHINDB,
connectionParam);
+ Assertions.assertEquals("jdbc:dolphindb://localhost:8848", jdbcUrl);
+ }
+
+ @Test
+ public void testBuildDatasourceParamDTO() {
+ DolphinDBConnectionParam connectionParam = new
DolphinDBConnectionParam();
+ connectionParam.setJdbcUrl("jdbc:dolphindb://localhost:8848");
+ connectionParam.setAddress("jdbc:dolphindb://localhost:8848");
+ connectionParam.setUser("admin");
+ connectionParam.setPassword("123456");
+
+ Assertions.assertNotNull(
+ DataSourceUtils.buildDatasourceParamDTO(DbType.DOLPHINDB,
JSONUtils.toJsonString(connectionParam)));
+
+ }
+
+ @Test
+ public void testGetDatasourceProcessor() {
+
Assertions.assertNotNull(DataSourceUtils.getDatasourceProcessor(DbType.DOLPHINDB));
+ }
+
+ @Test
+ public void testGetDatasourceProcessorError() {
+ Assertions.assertThrows(Exception.class, () -> {
+ DataSourceUtils.getDatasourceProcessor(null);
+ });
+ }
+}
diff --git a/dolphinscheduler-datasource-plugin/pom.xml
b/dolphinscheduler-datasource-plugin/pom.xml
index 313b3cdea7..d9fd68db11 100644
--- a/dolphinscheduler-datasource-plugin/pom.xml
+++ b/dolphinscheduler-datasource-plugin/pom.xml
@@ -57,6 +57,7 @@
<module>dolphinscheduler-datasource-k8s</module>
<module>dolphinscheduler-datasource-hana</module>
<module>dolphinscheduler-datasource-aliyunserverlessspark</module>
+ <module>dolphinscheduler-datasource-dolphindb</module>
</modules>
<dependencyManagement>
diff --git a/dolphinscheduler-dist/release-docs/LICENSE
b/dolphinscheduler-dist/release-docs/LICENSE
index b1eeacb704..6a02830b91 100644
--- a/dolphinscheduler-dist/release-docs/LICENSE
+++ b/dolphinscheduler-dist/release-docs/LICENSE
@@ -514,8 +514,6 @@ The text of each license is also included at
licenses/LICENSE-[project].txt.
logging-interceptor 2.7.5
https://mvnrepository.com/artifact/com.squareup.okhttp/logging-interceptor/2.7.5,
Apache 2.0
-
-
jna-platform
========================================================================
diff --git
a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/DolphinDBDataSourceE2ETest.java
b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/DolphinDBDataSourceE2ETest.java
new file mode 100644
index 0000000000..c37b2ba830
--- /dev/null
+++
b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/DolphinDBDataSourceE2ETest.java
@@ -0,0 +1,107 @@
+/*
+ * 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.dolphinscheduler.e2e.cases;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
+import org.apache.dolphinscheduler.e2e.core.WebDriverWaitFactory;
+import org.apache.dolphinscheduler.e2e.pages.LoginPage;
+import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junitpioneer.jupiter.DisableIfTestFails;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.remote.RemoteWebDriver;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.testcontainers.shaded.org.awaitility.Awaitility;
+
+@DolphinScheduler(composeFiles =
"docker/datasource-dolphindb/docker-compose.yaml")
+@DisableIfTestFails
+public class DolphinDBDataSourceE2ETest {
+
+ private static RemoteWebDriver browser;
+
+ private static final String tenant = System.getProperty("user.name");
+
+ private static final String user = "admin";
+
+ private static final String password = "dolphinscheduler123";
+
+ private static final String dataSourceType = "DOLPHINDB";
+
+ private static final String dataSourceName = "dolphindb_test";
+
+ private static final String dataSourceDescription = "dolphindb_test";
+
+ private static final String ip = "dolphindb";
+
+ private static final String port = "8848";
+
+ private static final String userName = "admin";
+
+ private static final String dolphindbPassword = "123456";
+
+ private static final String database = "";
+
+ private static final String jdbcParams = "";
+
+ @BeforeAll
+ public static void setup() {
+ new LoginPage(browser)
+ .login(user, password)
+ .goToNav(DataSourcePage.class);
+ }
+
+ @Test
+ @Order(10)
+ void testCreateDolphinDBDataSource() {
+ final DataSourcePage page = new DataSourcePage(browser);
+
+ page.createDataSource(dataSourceType, dataSourceName,
dataSourceDescription, ip, port, userName,
+ dolphindbPassword,
+ database, jdbcParams);
+
+
WebDriverWaitFactory.createWebDriverWait(page.driver()).until(ExpectedConditions.invisibilityOfElementLocated(
+ new By.ByClassName("dialog-create-data-source")));
+
+ Awaitility.await().untilAsserted(() ->
assertThat(page.dataSourceItemsList())
+ .as("DataSource list should contain newly-created database")
+ .extracting(WebElement::getText)
+ .anyMatch(it -> it.contains(dataSourceName)));
+ }
+
+ @Test
+ @Order(20)
+ void testDeleteDolphinDBDataSource() {
+ final DataSourcePage page = new DataSourcePage(browser);
+
+ page.delete(dataSourceName);
+
+ Awaitility.await().untilAsserted(() -> {
+ browser.navigate().refresh();
+
+ assertThat(
+ page.dataSourceItemsList()).noneMatch(
+ it -> it.getText().contains(dataSourceName));
+ });
+ }
+}
diff --git
a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java
b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java
index 5f66b58757..63f0368f22 100644
---
a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java
+++
b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java
@@ -82,7 +82,9 @@ public class DataSourcePage extends NavBarPage implements
NavBarPage.NavBarItem
createDataSourceForm().inputPort().sendKeys(port);
createDataSourceForm().inputUserName().sendKeys(userName);
createDataSourceForm().inputPassword().sendKeys(password);
- createDataSourceForm().inputDataBase().sendKeys(database);
+ if (createDataSourceForm().inputDataBase().isDisplayed()) {
+ createDataSourceForm().inputDataBase().sendKeys(database);
+ }
if (!"".equals(jdbcParams)) {
createDataSourceForm().inputJdbcParams().sendKeys(jdbcParams);
diff --git
a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/resources/docker/datasource-dolphindb/docker-compose.yaml
b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/resources/docker/datasource-dolphindb/docker-compose.yaml
new file mode 100644
index 0000000000..b1831dabf6
--- /dev/null
+++
b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/resources/docker/datasource-dolphindb/docker-compose.yaml
@@ -0,0 +1,60 @@
+#
+# 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.
+#
+
+version: "3.8"
+
+services:
+ dolphinscheduler:
+ image: apache/dolphinscheduler-standalone-server:ci
+ environment:
+ MASTER_MAX_CPU_LOAD_AVG: 100
+ WORKER_TENANT_AUTO_CREATE: 'true'
+ ports:
+ - "12345:12345"
+ networks:
+ - e2e
+ healthcheck:
+ test: [ "CMD", "curl",
"http://localhost:12345/dolphinscheduler/actuator/health" ]
+ interval: 5s
+ timeout: 5s
+ retries: 120
+ depends_on:
+ dolphindb:
+ condition: service_healthy
+
+ dolphindb:
+ image: dolphindb/dolphindb:v3.00.2.6
+ restart: always
+ environment:
+ - DOLPHINDB_ADMIN=admin
+ - DOLPHINDB_PASSWORD=123456
+ networks:
+ - e2e
+ ports:
+ - "8848:8848"
+ healthcheck:
+ test: ["CMD-SHELL", "wget --quiet --tries=1 --spider
http://127.0.0.1:8848 || exit 1"]
+ interval: 30s
+ timeout: 20s
+ retries: 5
+ start_period: 60s
+
+volumes:
+ dolphindb_data:
+
+networks:
+ e2e:
diff --git
a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/enums/DbType.java
b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/enums/DbType.java
index 639f8d5739..6abe98db3c 100644
---
a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/enums/DbType.java
+++
b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/enums/DbType.java
@@ -60,7 +60,8 @@ public enum DbType {
K8S(26, "k8s", "k8s"),
- ALIYUN_SERVERLESS_SPARK(27, "aliyun_serverless_spark", "aliyun serverless
spark");
+ ALIYUN_SERVERLESS_SPARK(27, "aliyun_serverless_spark", "aliyun serverless
spark"),
+ DOLPHINDB(28, "dolphindb", "dolphindb");
private static final Map<Integer, DbType> DB_TYPE_MAP =
Arrays.stream(DbType.values()).collect(toMap(DbType::getCode,
Functions.identity()));
diff --git a/dolphinscheduler-ui/src/service/modules/data-source/types.ts
b/dolphinscheduler-ui/src/service/modules/data-source/types.ts
index 135a8cc553..336d7dc861 100644
--- a/dolphinscheduler-ui/src/service/modules/data-source/types.ts
+++ b/dolphinscheduler-ui/src/service/modules/data-source/types.ts
@@ -43,6 +43,7 @@ type IDataBase =
| 'SAGEMAKER'
| 'K8S'
| 'ALIYUN_SERVERLESS_SPARK'
+ | 'DOLPHINDB'
type IDataBaseLabel =
| 'MYSQL'
@@ -67,6 +68,7 @@ type IDataBaseLabel =
| 'SAGEMAKER'
| 'K8S'
| 'ALIYUN_SERVERLESS_SPARK'
+ | 'DOLPHINDB'
interface IDataSource {
id?: number
diff --git a/dolphinscheduler-ui/src/views/datasource/list/use-form.ts
b/dolphinscheduler-ui/src/views/datasource/list/use-form.ts
index 4b229868a6..e239098274 100644
--- a/dolphinscheduler-ui/src/views/datasource/list/use-form.ts
+++ b/dolphinscheduler-ui/src/views/datasource/list/use-form.ts
@@ -250,7 +250,8 @@ export function useForm(id?: number) {
state.detailForm.port = options.previousPort || options.defaultPort
state.detailForm.type = type
- state.requiredDataBase = type !== 'POSTGRESQL' && type !== 'ATHENA'
+ state.requiredDataBase =
+ type !== 'POSTGRESQL' && type !== 'ATHENA' && type !== 'DOLPHINDB'
state.showHost = type !== 'ATHENA'
state.showPort = type !== 'ATHENA'
@@ -275,12 +276,17 @@ export function useForm(id?: number) {
type === 'ZEPPELIN' ||
type === 'SAGEMAKER' ||
type === 'K8S' ||
- type === 'ALIYUN_SERVERLESS_SPARK'
+ type === 'ALIYUN_SERVERLESS_SPARK' ||
+ type === 'DOLPHINDB'
) {
state.showDataBaseName = false
state.requiredDataBase = false
state.showJDBCConnectParameters = false
state.showPublicKey = false
+ if (type === 'DOLPHINDB') {
+ state.showJDBCConnectParameters = true
+ state.showPublicKey = false
+ }
if (type === 'SSH') {
state.showPublicKey = true
}
@@ -497,6 +503,11 @@ export const datasourceType: IDataBaseOptionKeys = {
value: 'ALIYUN_SERVERLESS_SPARK',
label: 'ALIYUN_SERVERLESS_SPARK',
defaultPort: 0
+ },
+ DOLPHINDB: {
+ value: 'DOLPHINDB',
+ label: 'DOLPHINDB',
+ defaultPort: 8848
}
}
diff --git
a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datasource.ts
b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datasource.ts
index d44920cdee..950c7418ea 100644
---
a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datasource.ts
+++
b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datasource.ts
@@ -161,6 +161,11 @@ export function useDatasource(
id: 27,
code: 'ALIYUN_SERVERLESS_SPARK',
disabled: false
+ },
+ {
+ id: 28,
+ code: 'DOLPHINDB',
+ disabled: false
}
]