You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by we...@apache.org on 2022/12/17 00:44:52 UTC

[dolphinscheduler] branch dev updated: Add StarRocks datasource (#13204)

This is an automated email from the ASF dual-hosted git repository.

wenjun 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 5c75d312fa Add StarRocks datasource (#13204)
5c75d312fa is described below

commit 5c75d312fac7f4e8c776737a0b4eec19b0099637
Author: Wenjun Ruan <we...@apache.org>
AuthorDate: Sat Dec 17 08:44:39 2022 +0800

    Add StarRocks datasource (#13204)
---
 docs/docs/en/guide/datasource/starrocks.md         |  22 +++
 docs/docs/zh/guide/datasource/starrocks.md         |  17 ++
 docs/img/new_ui/dev/datasource/starrocks.png       | Bin 0 -> 345355 bytes
 .../dolphinscheduler-datasource-all/pom.xml        |   5 +
 .../dolphinscheduler-datasource-api/pom.xml        |   1 -
 .../dolphinscheduler-datasource-spark/pom.xml      |   1 +
 .../pom.xml                                        |  25 +--
 .../starrocks/StarRocksDataSourceChannel.java      |  31 ++++
 .../StarRocksDataSourceChannelFactory.java         |  38 +++++
 .../starrocks/StarRocksDataSourceClient.java       |  30 ++++
 .../starrocks/param/StarRocksConnectionParam.java  |  37 +++++
 .../param/StarRocksDataSourceParamDTO.java         |  45 +++++
 .../param/StarRocksDataSourceProcessor.java        | 181 +++++++++++++++++++++
 dolphinscheduler-datasource-plugin/pom.xml         |   6 +-
 .../apache/dolphinscheduler/spi/enums/DbType.java  |   4 +-
 .../src/service/modules/data-source/types.ts       |   2 +
 .../src/views/datasource/list/use-form.ts          |   5 +
 .../task/components/node/fields/use-datasource.ts  |   5 +
 18 files changed, 429 insertions(+), 26 deletions(-)

diff --git a/docs/docs/en/guide/datasource/starrocks.md b/docs/docs/en/guide/datasource/starrocks.md
new file mode 100644
index 0000000000..d604e913e7
--- /dev/null
+++ b/docs/docs/en/guide/datasource/starrocks.md
@@ -0,0 +1,22 @@
+# StarRocks
+
+![starrocks](../../../../img/new_ui/dev/datasource/starrocks.png)
+
+## Datasource Parameters
+
+|       **Datasource**       |                       **Description**                        |
+|----------------------------|--------------------------------------------------------------|
+| Datasource                 | Select StarRocks.                                            |
+| Datasource name            | Enter the name of the DataSource.                            |
+| Description                | Enter a description of the DataSource.                       |
+| IP/Host Name               | Enter the StarRocks service IP.                              |
+| Port                       | Enter the StarRocks service port.                            |
+| Username                   | Set the username for StarRocks connection.                   |
+| Password                   | Set the password for StarRocks connection.                   |
+| Database name              | Enter the database name of the StarRocks connection.         |
+| Jdbc connection parameters | Parameter settings for StarRocks connection, in JSON format. |
+
+## Native Supported
+
+No, you need to import Mysql jdbc driver first, read section example in [datasource-setting](../howto/datasource-setting.md) `DataSource Center` section to import Mysql JDBC Driver.
+
diff --git a/docs/docs/zh/guide/datasource/starrocks.md b/docs/docs/zh/guide/datasource/starrocks.md
new file mode 100644
index 0000000000..c496bb9ff5
--- /dev/null
+++ b/docs/docs/zh/guide/datasource/starrocks.md
@@ -0,0 +1,17 @@
+# StarRocks数据源
+
+![starrocks](../../../../img/new_ui/dev/datasource/starrocks.png)
+
+- 数据源:选择 STARROCKS
+- 数据源名称:输入数据源的名称
+- 描述:输入数据源的描述
+- IP 主机名:输入连接 STARROCKS 的 IP
+- 端口:输入连接 STARROCKS 的端口
+- 用户名:设置连接 STARROCKS 的用户名
+- 密码:设置连接 STARROCKS 的密码
+- 数据库名:输入连接 STARROCKS 的数据库名称
+- Jdbc 连接参数:用于 STARROCKS 连接的参数设置,以 JSON 形式填写
+
+## 是否原生支持
+
+否,StarRocks使用Mysql JDBC Driver, 使用前需请参考 [数据源配置](../howto/datasource-setting.md) 中的 "数据源中心" 章节激活Mysql JDBC Driver。
diff --git a/docs/img/new_ui/dev/datasource/starrocks.png b/docs/img/new_ui/dev/datasource/starrocks.png
new file mode 100644
index 0000000000..766c26460a
Binary files /dev/null and b/docs/img/new_ui/dev/datasource/starrocks.png differ
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-all/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-all/pom.xml
index 427c31f02e..28563f5e68 100644
--- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-all/pom.xml
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-all/pom.xml
@@ -87,5 +87,10 @@
             <artifactId>dolphinscheduler-datasource-trino</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.dolphinscheduler</groupId>
+            <artifactId>dolphinscheduler-datasource-starrocks</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
 </project>
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/pom.xml
index 8a69dd557f..074c49eab6 100644
--- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/pom.xml
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/pom.xml
@@ -30,7 +30,6 @@
         <dependency>
             <groupId>org.apache.dolphinscheduler</groupId>
             <artifactId>dolphinscheduler-spi</artifactId>
-            <scope>provided</scope>
         </dependency>
 
         <dependency>
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml
index 7ff09b0edb..2f954cb77c 100644
--- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml
@@ -43,6 +43,7 @@
         <dependency>
             <groupId>org.apache.dolphinscheduler</groupId>
             <artifactId>dolphinscheduler-datasource-hive</artifactId>
+            <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
 
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/pom.xml
similarity index 69%
copy from dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml
copy to dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/pom.xml
index 7ff09b0edb..7f1410c99b 100644
--- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-spark/pom.xml
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/pom.xml
@@ -24,32 +24,19 @@
         <version>dev-SNAPSHOT</version>
     </parent>
 
-    <artifactId>dolphinscheduler-datasource-spark</artifactId>
-    <packaging>jar</packaging>
-    <name>${project.artifactId}</name>
+    <artifactId>dolphinscheduler-datasource-starrocks</artifactId>
 
     <dependencies>
         <dependency>
             <groupId>org.apache.dolphinscheduler</groupId>
-            <artifactId>dolphinscheduler-spi</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.dolphinscheduler</groupId>
-            <artifactId>dolphinscheduler-task-api</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.dolphinscheduler</groupId>
-            <artifactId>dolphinscheduler-datasource-hive</artifactId>
-            <scope>provided</scope>
+            <artifactId>dolphinscheduler-datasource-api</artifactId>
+            <version>${project.version}</version>
         </dependency>
 
         <dependency>
-            <groupId>org.apache.dolphinscheduler</groupId>
-            <artifactId>dolphinscheduler-datasource-api</artifactId>
-            <version>${project.version}</version>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
         </dependency>
     </dependencies>
+
 </project>
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/StarRocksDataSourceChannel.java b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/StarRocksDataSourceChannel.java
new file mode 100644
index 0000000000..7975ec752b
--- /dev/null
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/StarRocksDataSourceChannel.java
@@ -0,0 +1,31 @@
+/*
+ * 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.starrocks;
+
+import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
+import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
+import org.apache.dolphinscheduler.spi.datasource.DataSourceClient;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+public class StarRocksDataSourceChannel implements DataSourceChannel {
+
+    @Override
+    public DataSourceClient createDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
+        return new StarRocksDataSourceClient(baseConnectionParam, dbType);
+    }
+}
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/StarRocksDataSourceChannelFactory.java b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/StarRocksDataSourceChannelFactory.java
new file mode 100644
index 0000000000..50e2483952
--- /dev/null
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/StarRocksDataSourceChannelFactory.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.starrocks;
+
+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 StarRocksDataSourceChannelFactory implements DataSourceChannelFactory {
+
+    @Override
+    public DataSourceChannel create() {
+        return new StarRocksDataSourceChannel();
+    }
+
+    @Override
+    public String getName() {
+        return DbType.STARROCKS.getDescp();
+    }
+}
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/StarRocksDataSourceClient.java b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/StarRocksDataSourceClient.java
new file mode 100644
index 0000000000..f4786efdf8
--- /dev/null
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/StarRocksDataSourceClient.java
@@ -0,0 +1,30 @@
+/*
+ * 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.starrocks;
+
+import org.apache.dolphinscheduler.plugin.datasource.api.client.CommonDataSourceClient;
+import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+public class StarRocksDataSourceClient extends CommonDataSourceClient {
+
+    public StarRocksDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
+        super(baseConnectionParam, dbType);
+    }
+
+}
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/param/StarRocksConnectionParam.java b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/param/StarRocksConnectionParam.java
new file mode 100644
index 0000000000..bdd5b91b3c
--- /dev/null
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/param/StarRocksConnectionParam.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.starrocks.param;
+
+import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
+
+public class StarRocksConnectionParam extends BaseConnectionParam {
+
+    @Override
+    public String toString() {
+        return "StarRocksConnectionParam{" +
+                "user='" + user + '\'' +
+                ", address='" + address + '\'' +
+                ", database='" + database + '\'' +
+                ", jdbcUrl='" + jdbcUrl + '\'' +
+                ", driverLocation='" + driverLocation + '\'' +
+                ", driverClassName='" + driverClassName + '\'' +
+                ", validationQuery='" + validationQuery + '\'' +
+                ", other=" + other +
+                '}';
+    }
+}
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/param/StarRocksDataSourceParamDTO.java b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/param/StarRocksDataSourceParamDTO.java
new file mode 100644
index 0000000000..5941ca429f
--- /dev/null
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/param/StarRocksDataSourceParamDTO.java
@@ -0,0 +1,45 @@
+/*
+ * 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.starrocks.param;
+
+import org.apache.dolphinscheduler.plugin.datasource.api.datasource.BaseDataSourceParamDTO;
+import org.apache.dolphinscheduler.spi.enums.DbType;
+
+public class StarRocksDataSourceParamDTO extends BaseDataSourceParamDTO {
+
+    @Override
+    public String toString() {
+        return "StarRocksDataSourceParamDTO{" +
+                "id=" + id +
+                ", name='" + name + '\'' +
+                ", note='" + note + '\'' +
+                ", host='" + host + '\'' +
+                ", port=" + port +
+                ", database='" + database + '\'' +
+                ", userName='" + userName + '\'' +
+                ", testFlag=" + testFlag +
+                ", bindTestId=" + bindTestId +
+                ", other=" + other +
+                '}';
+    }
+
+    @Override
+    public DbType getType() {
+        return DbType.STARROCKS;
+    }
+}
diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/param/StarRocksDataSourceProcessor.java b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/param/StarRocksDataSourceProcessor.java
new file mode 100644
index 0000000000..ec76899d59
--- /dev/null
+++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-starrocks/src/main/java/org/apache/dolphinscheduler/plugin/datasource/starrocks/param/StarRocksDataSourceProcessor.java
@@ -0,0 +1,181 @@
+/*
+ * 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.starrocks.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.BaseConnectionParam;
+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.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import lombok.extern.slf4j.Slf4j;
+
+import com.google.auto.service.AutoService;
+
+@Slf4j
+@AutoService(DataSourceProcessor.class)
+public class StarRocksDataSourceProcessor extends AbstractDataSourceProcessor {
+
+    private static final String ALLOW_LOAD_LOCAL_IN_FILE_NAME = "allowLoadLocalInfile";
+
+    private static final String AUTO_DESERIALIZE = "autoDeserialize";
+
+    private static final String ALLOW_LOCAL_IN_FILE_NAME = "allowLocalInfile";
+
+    private static final String ALLOW_URL_IN_LOCAL_IN_FILE_NAME = "allowUrlInLocalInfile";
+
+    private static final String APPEND_PARAMS =
+            "allowLoadLocalInfile=false&autoDeserialize=false&allowLocalInfile=false&allowUrlInLocalInfile=false";
+
+    @Override
+    public BaseDataSourceParamDTO castDatasourceParamDTO(String paramJson) {
+        return JSONUtils.parseObject(paramJson, StarRocksDataSourceParamDTO.class);
+    }
+
+    @Override
+    public BaseDataSourceParamDTO createDatasourceParamDTO(String connectionJson) {
+        StarRocksConnectionParam connectionParams = (StarRocksConnectionParam) createConnectionParams(connectionJson);
+        StarRocksDataSourceParamDTO starRocksDataSourceParamDTO = new StarRocksDataSourceParamDTO();
+
+        starRocksDataSourceParamDTO.setUserName(connectionParams.getUser());
+        starRocksDataSourceParamDTO.setDatabase(connectionParams.getDatabase());
+        starRocksDataSourceParamDTO.setOther(connectionParams.getOther());
+
+        String address = connectionParams.getAddress();
+        String[] hostSeperator = address.split(Constants.DOUBLE_SLASH);
+        String[] hostPortArray = hostSeperator[hostSeperator.length - 1].split(Constants.COMMA);
+        starRocksDataSourceParamDTO.setPort(Integer.parseInt(hostPortArray[0].split(Constants.COLON)[1]));
+        starRocksDataSourceParamDTO.setHost(hostPortArray[0].split(Constants.COLON)[0]);
+
+        return starRocksDataSourceParamDTO;
+    }
+
+    @Override
+    public BaseConnectionParam createConnectionParams(BaseDataSourceParamDTO dataSourceParam) {
+        StarRocksDataSourceParamDTO starRocksDataSourceParamDTO = (StarRocksDataSourceParamDTO) dataSourceParam;
+        String address = String.format("%s%s:%s", DataSourceConstants.JDBC_MYSQL, starRocksDataSourceParamDTO.getHost(),
+                starRocksDataSourceParamDTO.getPort());
+        String jdbcUrl = String.format("%s/%s", address, starRocksDataSourceParamDTO.getDatabase());
+
+        StarRocksConnectionParam starRocksConnectionParam = new StarRocksConnectionParam();
+        starRocksConnectionParam.setJdbcUrl(jdbcUrl);
+        starRocksConnectionParam.setDatabase(starRocksDataSourceParamDTO.getDatabase());
+        starRocksConnectionParam.setAddress(address);
+        starRocksConnectionParam.setUser(starRocksDataSourceParamDTO.getUserName());
+        starRocksConnectionParam.setPassword(PasswordUtils.encodePassword(starRocksDataSourceParamDTO.getPassword()));
+        starRocksConnectionParam.setDriverClassName(getDatasourceDriver());
+        starRocksConnectionParam.setValidationQuery(getValidationQuery());
+        starRocksConnectionParam.setOther(starRocksDataSourceParamDTO.getOther());
+
+        return starRocksConnectionParam;
+    }
+
+    @Override
+    public ConnectionParam createConnectionParams(String connectionJson) {
+        return JSONUtils.parseObject(connectionJson, StarRocksConnectionParam.class);
+    }
+
+    @Override
+    public String getDatasourceDriver() {
+        return DataSourceConstants.COM_MYSQL_CJ_JDBC_DRIVER;
+    }
+
+    @Override
+    public String getValidationQuery() {
+        return DataSourceConstants.MYSQL_VALIDATION_QUERY;
+    }
+
+    @Override
+    public String getJdbcUrl(ConnectionParam connectionParam) {
+        StarRocksConnectionParam starRocksConnectionParam = (StarRocksConnectionParam) connectionParam;
+        String jdbcUrl = starRocksConnectionParam.getJdbcUrl();
+        if (MapUtils.isNotEmpty(starRocksConnectionParam.getOther())) {
+            return String.format("%s?%s&%s", jdbcUrl, transformOther(starRocksConnectionParam.getOther()),
+                    APPEND_PARAMS);
+        }
+        return String.format("%s?%s", jdbcUrl, APPEND_PARAMS);
+    }
+
+    @Override
+    public Connection getConnection(ConnectionParam connectionParam) throws ClassNotFoundException, SQLException {
+        StarRocksConnectionParam starRocksConnectionParam = (StarRocksConnectionParam) connectionParam;
+        Class.forName(getDatasourceDriver());
+        String user = starRocksConnectionParam.getUser();
+        if (user.contains(AUTO_DESERIALIZE)) {
+            log.warn("sensitive param : {} in username field is filtered", AUTO_DESERIALIZE);
+            user = user.replace(AUTO_DESERIALIZE, "");
+        }
+        String password = PasswordUtils.decodePassword(starRocksConnectionParam.getPassword());
+        if (password.contains(AUTO_DESERIALIZE)) {
+            log.warn("sensitive param : {} in password field is filtered", AUTO_DESERIALIZE);
+            password = password.replace(AUTO_DESERIALIZE, "");
+        }
+        return DriverManager.getConnection(getJdbcUrl(connectionParam), user, password);
+    }
+
+    @Override
+    public DbType getDbType() {
+        return DbType.STARROCKS;
+    }
+
+    @Override
+    public DataSourceProcessor create() {
+        return new StarRocksDataSourceProcessor();
+    }
+
+    private String transformOther(Map<String, String> paramMap) {
+        if (MapUtils.isEmpty(paramMap)) {
+            return null;
+        }
+        Map<String, String> otherMap = new HashMap<>();
+        paramMap.forEach((k, v) -> {
+            if (!checkKeyIsLegitimate(k)) {
+                return;
+            }
+            otherMap.put(k, v);
+        });
+        if (MapUtils.isEmpty(otherMap)) {
+            return null;
+        }
+        List<String> otherList = new ArrayList<>();
+        otherMap.forEach((key, value) -> otherList.add(String.format("%s=%s", key, value)));
+        return String.join("&", otherList);
+    }
+
+    private static boolean checkKeyIsLegitimate(String key) {
+        return !key.contains(ALLOW_LOAD_LOCAL_IN_FILE_NAME)
+                && !key.contains(AUTO_DESERIALIZE)
+                && !key.contains(ALLOW_LOCAL_IN_FILE_NAME)
+                && !key.contains(ALLOW_URL_IN_LOCAL_IN_FILE_NAME);
+    }
+}
diff --git a/dolphinscheduler-datasource-plugin/pom.xml b/dolphinscheduler-datasource-plugin/pom.xml
index 78979924bb..457a1e5db6 100644
--- a/dolphinscheduler-datasource-plugin/pom.xml
+++ b/dolphinscheduler-datasource-plugin/pom.xml
@@ -42,15 +42,11 @@
         <module>dolphinscheduler-datasource-redshift</module>
         <module>dolphinscheduler-datasource-athena</module>
         <module>dolphinscheduler-datasource-trino</module>
+        <module>dolphinscheduler-datasource-starrocks</module>
     </modules>
 
     <dependencyManagement>
         <dependencies>
-            <dependency>
-                <groupId>org.apache.dolphinscheduler</groupId>
-                <artifactId>dolphinscheduler-datasource-hive</artifactId>
-                <version>${project.version}</version>
-            </dependency>
             <dependency>
                 <groupId>org.apache.dolphinscheduler</groupId>
                 <artifactId>dolphinscheduler-bom</artifactId>
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 50aeeffbcd..0544342c49 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
@@ -40,7 +40,9 @@ public enum DbType {
     H2(9, "h2"),
     REDSHIFT(10, "redshift"),
     ATHENA(11, "athena"),
-    TRINO(12, "trino");
+    TRINO(12, "trino"),
+    STARROCKS(13, "starrocks"),
+    ;
 
     @EnumValue
     private final int code;
diff --git a/dolphinscheduler-ui/src/service/modules/data-source/types.ts b/dolphinscheduler-ui/src/service/modules/data-source/types.ts
index 3e5f06dc52..e61ba64ab3 100644
--- a/dolphinscheduler-ui/src/service/modules/data-source/types.ts
+++ b/dolphinscheduler-ui/src/service/modules/data-source/types.ts
@@ -28,6 +28,7 @@ type IDataBase =
   | 'REDSHIFT'
   | 'ATHENA'
   | 'TRINO'
+  | 'STARROCKS'
 
 type IDataBaseLabel =
 | 'MYSQL'
@@ -42,6 +43,7 @@ type IDataBaseLabel =
 | 'REDSHIFT'
 | 'ATHENA'
 | 'TRINO'
+| 'STARROCKS'
 
 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 d2e67d0096..2542fee7cc 100644
--- a/dolphinscheduler-ui/src/views/datasource/list/use-form.ts
+++ b/dolphinscheduler-ui/src/views/datasource/list/use-form.ts
@@ -298,6 +298,11 @@ export const datasourceType: IDataBaseOptionKeys = {
     value: 'TRINO',
     label: 'TRINO',
     defaultPort: 8080
+  },
+  STARROCKS: {
+      value: 'STARROCKS',
+      label: 'STARROCKS',
+      defaultPort: 9030
   }
 }
 
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 f47803e21c..e927e3629e 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
@@ -97,6 +97,11 @@ export function useDatasource(
       id: 12,
       code: 'TRINO',
       disabled: false
+    },
+    {
+      id: 13,
+      code: 'STARROCKS',
+      disabled: false
     }
   ]