You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2023/05/22 04:05:00 UTC

[linkis] branch dev-1.4.0 updated: spark jdbc etl support dm and kingbase (#4568)

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

peacewong pushed a commit to branch dev-1.4.0
in repository https://gitbox.apache.org/repos/asf/linkis.git


The following commit(s) were added to refs/heads/dev-1.4.0 by this push:
     new 3544d3958 spark jdbc etl support dm and kingbase (#4568)
3544d3958 is described below

commit 3544d39589dc256d5d0fb3c7cf678a73162e3cca
Author: ChengJie1053 <18...@163.com>
AuthorDate: Mon May 22 12:04:53 2023 +0800

    spark jdbc etl support dm and kingbase (#4568)
---
 .../datacalc/service/LinkisDataSourceContext.java  |  4 +++
 .../datacalc/service/strategy/DmStrategy.java      | 36 ++++++++++++++++++++++
 .../service/strategy/KingbaseStrategy.java         | 36 ++++++++++++++++++++++
 3 files changed, 76 insertions(+)

diff --git a/linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/datacalc/service/LinkisDataSourceContext.java b/linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/datacalc/service/LinkisDataSourceContext.java
index 3fa423748..974c0bbf0 100644
--- a/linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/datacalc/service/LinkisDataSourceContext.java
+++ b/linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/datacalc/service/LinkisDataSourceContext.java
@@ -39,8 +39,12 @@ public class LinkisDataSourceContext {
     // https://docs.pingcap.com/tidb/dev/dev-guide-connect-to-tidb
     dsStrategyMap.put("tidb", new TiDBStrategy());
     dsStrategyMap.put("doris", new DorisStrategy());
+    dsStrategyMap.put("starrocks", new DorisStrategy());
+    dsStrategyMap.put("dm", new DmStrategy());
+    dsStrategyMap.put("kingbase", new KingbaseStrategy());
     // https://jdbc.postgresql.org/documentation/use/
     dsStrategyMap.put("postgresql", new PostgreSqlStrategy());
+    dsStrategyMap.put("gaussdb", new PostgreSqlStrategy());
     // https://github.com/ClickHouse/clickhouse-jdbc/tree/master/clickhouse-jdbc
     dsStrategyMap.put("clickhouse", new ClickHouseStrategy());
     // https://docs.oracle.com/en/database/oracle/oracle-database/21/jajdb/oracle/jdbc/OracleDriver.html
diff --git a/linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/datacalc/service/strategy/DmStrategy.java b/linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/datacalc/service/strategy/DmStrategy.java
new file mode 100644
index 000000000..1f7905fb2
--- /dev/null
+++ b/linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/datacalc/service/strategy/DmStrategy.java
@@ -0,0 +1,36 @@
+/*
+ * 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.linkis.engineplugin.spark.datacalc.service.strategy;
+
+public class DmStrategy extends NormalStrategy {
+
+  @Override
+  public String defaultDriver() {
+    return "dm.jdbc.driver.DmDriver";
+  }
+
+  @Override
+  public String defaultPort() {
+    return "5236";
+  }
+
+  @Override
+  public String getDatabaseType() {
+    return "dm";
+  }
+}
diff --git a/linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/datacalc/service/strategy/KingbaseStrategy.java b/linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/datacalc/service/strategy/KingbaseStrategy.java
new file mode 100644
index 000000000..c72b37c72
--- /dev/null
+++ b/linkis-engineconn-plugins/spark/src/main/java/org/apache/linkis/engineplugin/spark/datacalc/service/strategy/KingbaseStrategy.java
@@ -0,0 +1,36 @@
+/*
+ * 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.linkis.engineplugin.spark.datacalc.service.strategy;
+
+public class KingbaseStrategy extends NormalStrategy {
+
+  @Override
+  public String defaultDriver() {
+    return "com.kingbase8.Driver";
+  }
+
+  @Override
+  public String defaultPort() {
+    return "54321";
+  }
+
+  @Override
+  public String getDatabaseType() {
+    return "kingbase8";
+  }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org