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 16d7e5e33 Support oceanbase dataSources (#4581)
16d7e5e33 is described below
commit 16d7e5e33fe4aa8cd5e536535949a0282356aa20
Author: ChengJie1053 <[email protected]>
AuthorDate: Sat May 27 20:21:19 2023 +0800
Support oceanbase dataSources (#4581)
---
linkis-dist/package/db/linkis_dml.sql | 13 +++++++++++++
linkis-dist/package/db/linkis_dml_pg.sql | 11 +++++++++++
.../package/db/upgrade/1.4.0_schema/mysql/linkis_dml.sql | 14 ++++++++++++++
.../metadata/query/common/cache/CacheConfiguration.java | 4 ++--
4 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/linkis-dist/package/db/linkis_dml.sql
b/linkis-dist/package/db/linkis_dml.sql
index d207beca0..cf7dba826 100644
--- a/linkis-dist/package/db/linkis_dml.sql
+++ b/linkis-dist/package/db/linkis_dml.sql
@@ -557,6 +557,7 @@ INSERT INTO `linkis_ps_dm_datasource_type` (`name`,
`description`, `option`, `cl
INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`,
`classifier`, `icon`, `layers`, `description_en`, `option_en`, `classifier_en`)
VALUES ('tidb', 'tidb数据库', 'tidb', '关系型数据库', '', 3, 'TiDB Database', 'TiDB',
'Relational Database');
INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`,
`classifier`, `icon`, `layers`, `description_en`, `option_en`, `classifier_en`)
VALUES ('starrocks', 'starrocks数据库', 'starrocks', 'olap', '', 4, 'StarRocks
Database', 'StarRocks', 'Olap');
INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`,
`classifier`, `icon`, `layers`, `description_en`, `option_en`, `classifier_en`)
VALUES ('gaussdb', 'gaussdb数据库', 'gaussdb', '关系型数据库', '', 3, 'GaussDB
Database', 'GaussDB', 'Relational Database');
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`,
`classifier`, `icon`, `layers`, `description_en`, `option_en`, `classifier_en`)
VALUES ('oceanbase', 'oceanbase数据库', 'oceanbase', 'olap', '', 4, 'oceanbase
Database', 'oceanbase', 'Olap');
select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where
`name` = 'mongodb';
@@ -761,3 +762,15 @@ VALUES (@data_source_type_id, 'address', '地址', 'Address',
NULL, 'TEXT', NULL
(@data_source_type_id, 'username', '用户名(Username)', 'Username', NULL,
'TEXT', NULL, 1, '用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL,
NULL, now(), now()),
(@data_source_type_id, 'password', '密码(Password)', 'Password', NULL,
'PASSWORD', NULL, 1, '密码(Password)', 'Password', '', NULL, NULL, NULL, now(),
now()),
(@data_source_type_id, 'instance', '实例名(instance)', 'Instance', NULL,
'TEXT', NULL, 1, '实例名(instance)', 'Instance', NULL, NULL, NULL, NULL, now(),
now());
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where
`name` = 'oceanbase';
+INSERT INTO `linkis_ps_dm_datasource_type_key`
+(`data_source_type_id`, `key`, `name`, `name_en`, `default_value`,
`value_type`, `scope`, `require`, `description`, `description_en`,
`value_regex`, `ref_id`, `ref_value`, `data_source`, `update_time`,
`create_time`)
+VALUES (@data_source_type_id, 'address', '地址', 'Address', NULL, 'TEXT', NULL,
0, '地址(host1:port1,host2:port2...)', 'Address(host1:port1,host2:port2...)',
NULL, NULL, NULL, NULL, now(), now()),
+ (@data_source_type_id, 'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL,
1, '主机名(Host)', 'Host', NULL, NULL, NULL, NULL, now(), now()),
+ (@data_source_type_id, 'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL,
1, '端口号(Port)', 'Port', NULL, NULL, NULL, NULL, now(), now()),
+ (@data_source_type_id, 'driverClassName', '驱动类名(Driver class name)',
'Driver class name', 'com.mysql.jdbc.Driver', 'TEXT', NULL, 1, '驱动类名(Driver
class name)', 'Driver class name', NULL, NULL, NULL, NULL, now(), now()),
+ (@data_source_type_id, 'params', '连接参数(Connection params)', 'Connection
params', NULL, 'TEXT', NULL, 0, '输入JSON格式(Input JSON format):
{"param":"value"}', 'Input JSON format: {"param":"value"}', NULL, NULL, NULL,
NULL, now(), now()),
+ (@data_source_type_id, 'username', '用户名(Username)', 'Username', NULL,
'TEXT', NULL, 1, '用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL,
NULL, now(), now()),
+ (@data_source_type_id, 'password', '密码(Password)', 'Password', NULL,
'PASSWORD', NULL, 1, '密码(Password)', 'Password', '', NULL, NULL, NULL, now(),
now()),
+ (@data_source_type_id, 'instance', '实例名(instance)', 'Instance', NULL,
'TEXT', NULL, 1, '实例名(instance)', 'Instance', NULL, NULL, NULL, NULL, now(),
now());
diff --git a/linkis-dist/package/db/linkis_dml_pg.sql
b/linkis-dist/package/db/linkis_dml_pg.sql
index 40af97e22..b796a78d7 100644
--- a/linkis-dist/package/db/linkis_dml_pg.sql
+++ b/linkis-dist/package/db/linkis_dml_pg.sql
@@ -513,6 +513,7 @@ INSERT INTO "linkis_ps_dm_datasource_type" ("name",
"description", "option", "cl
INSERT INTO "linkis_ps_dm_datasource_type" ("name", "description", "option",
"classifier", "icon", "layers", "description_en", "option_en", "classifier_en")
VALUES ('tidb', 'tidb数据库', 'tidb', '关系型数据库', '', 3, 'TiDB Database', 'TiDB',
'Relational Database');
INSERT INTO "linkis_ps_dm_datasource_type" ("name", "description", "option",
"classifier", "icon", "layers", "description_en", "option_en", "classifier_en")
VALUES ('starrocks', 'starrocks数据库', 'starrocks', 'olap', '', 4, 'StarRocks
Database', 'StarRocks', 'Olap');
INSERT INTO "linkis_ps_dm_datasource_type" ("name", "description", "option",
"classifier", "icon", "layers", "description_en", "option_en", "classifier_en")
VALUES ('gaussdb', 'gaussdb数据库', 'gaussdb', '关系型数据库', '', 3, 'GaussDB
Database', 'GaussDB', 'Relational Database');
+INSERT INTO "linkis_ps_dm_datasource_type" ("name", "description", "option",
"classifier", "icon", "layers", "description_en", "option_en", "classifier_en")
VALUES ('oceanbase', 'oceanbase数据库', 'oceanbase', 'olap', '', 4, 'oceanbase
Database', 'oceanbase', 'Olap');
delete from linkis_ps_dm_datasource_type_key;
@@ -702,3 +703,13 @@ VALUES ((select id from "linkis_ps_dm_datasource_type"
where "name" = 'gaussdb')
((select id from "linkis_ps_dm_datasource_type" where "name" =
'gaussdb'), 'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL,
'1', '密码(Password)', 'Password', '', NULL, NULL, NULL, now(), now()),
((select id from "linkis_ps_dm_datasource_type" where "name" =
'gaussdb'), 'instance', '实例名(instance)', 'Instance', NULL, 'TEXT', NULL, '1',
'实例名(instance)', 'Instance', NULL, NULL, NULL, NULL, now(), now());
+INSERT INTO "linkis_ps_dm_datasource_type_key"
+("data_source_type_id", "key", "name", "name_en", "default_value",
"value_type", "scope", "require", "description", "description_en",
"value_regex", "ref_id", "ref_value", "data_source", "update_time",
"create_time")
+VALUES ((select id from "linkis_ps_dm_datasource_type" where "name" =
'oceanbase'), 'address', '地址', 'Address', NULL, 'TEXT', NULL, '0',
'地址(host1:port1,host2:port2...)', 'Address(host1:port1,host2:port2...)', NULL,
NULL, NULL, NULL, now(), now()),
+ ((select id from "linkis_ps_dm_datasource_type" where "name" =
'oceanbase'), 'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL, '1',
'主机名(Host)', 'Host', NULL, NULL, NULL, NULL, now(), now()),
+ ((select id from "linkis_ps_dm_datasource_type" where "name" =
'oceanbase'), 'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL, '1',
'端口号(Port)', 'Port', NULL, NULL, NULL, NULL, now(), now()),
+ ((select id from "linkis_ps_dm_datasource_type" where "name" =
'oceanbase'), 'driverClassName', '驱动类名(Driver class name)', 'Driver class
name', 'com.mysql.jdbc.Driver', 'TEXT', NULL, '1', '驱动类名(Driver class name)',
'Driver class name', NULL, NULL, NULL, NULL, now(), now()),
+ ((select id from "linkis_ps_dm_datasource_type" where "name" =
'oceanbase'), 'params', '连接参数(Connection params)', 'Connection params', NULL,
'TEXT', NULL, '0', '输入JSON格式(Input JSON format): {"param":"value"}', 'Input
JSON format: {"param":"value"}', NULL, NULL, NULL, NULL, now(), now()),
+ ((select id from "linkis_ps_dm_datasource_type" where "name" =
'oceanbase'), 'username', '用户名(Username)', 'Username', NULL, 'TEXT', NULL, '1',
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL, NULL, now(),
now()),
+ ((select id from "linkis_ps_dm_datasource_type" where "name" =
'oceanbase'), 'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL,
'1', '密码(Password)', 'Password', '', NULL, NULL, NULL, now(), now()),
+ ((select id from "linkis_ps_dm_datasource_type" where "name" =
'oceanbase'), 'instance', '实例名(instance)', 'Instance', NULL, 'TEXT', NULL, '1',
'实例名(instance)', 'Instance', NULL, NULL, NULL, NULL, now(), now());
diff --git a/linkis-dist/package/db/upgrade/1.4.0_schema/mysql/linkis_dml.sql
b/linkis-dist/package/db/upgrade/1.4.0_schema/mysql/linkis_dml.sql
index f19bf7f69..b5692e000 100644
--- a/linkis-dist/package/db/upgrade/1.4.0_schema/mysql/linkis_dml.sql
+++ b/linkis-dist/package/db/upgrade/1.4.0_schema/mysql/linkis_dml.sql
@@ -56,3 +56,17 @@ VALUES (@data_source_type_id, 'address', '地址', 'Address',
NULL, 'TEXT', NULL
(@data_source_type_id, 'username', '用户名(Username)', 'Username', NULL,
'TEXT', NULL, 1, '用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL,
NULL, now(), now()),
(@data_source_type_id, 'password', '密码(Password)', 'Password', NULL,
'PASSWORD', NULL, 1, '密码(Password)', 'Password', '', NULL, NULL, NULL, now(),
now()),
(@data_source_type_id, 'instance', '实例名(instance)', 'Instance', NULL,
'TEXT', NULL, 1, '实例名(instance)', 'Instance', NULL, NULL, NULL, NULL, now(),
now());
+
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`,
`classifier`, `icon`, `layers`, `description_en`, `option_en`, `classifier_en`)
VALUES ('oceanbase', 'oceanbase数据库', 'oceanbase', 'olap', '', 4, 'oceanbase
Database', 'oceanbase', 'Olap');
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where
`name` = 'oceanbase';
+INSERT INTO `linkis_ps_dm_datasource_type_key`
+(`data_source_type_id`, `key`, `name`, `name_en`, `default_value`,
`value_type`, `scope`, `require`, `description`, `description_en`,
`value_regex`, `ref_id`, `ref_value`, `data_source`, `update_time`,
`create_time`)
+VALUES (@data_source_type_id, 'address', '地址', 'Address', NULL, 'TEXT', NULL,
0, '地址(host1:port1,host2:port2...)', 'Address(host1:port1,host2:port2...)',
NULL, NULL, NULL, NULL, now(), now()),
+ (@data_source_type_id, 'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL,
1, '主机名(Host)', 'Host', NULL, NULL, NULL, NULL, now(), now()),
+ (@data_source_type_id, 'port', '端口号(Port)', 'Port', NULL, 'TEXT', NULL,
1, '端口号(Port)', 'Port', NULL, NULL, NULL, NULL, now(), now()),
+ (@data_source_type_id, 'driverClassName', '驱动类名(Driver class name)',
'Driver class name', 'com.mysql.jdbc.Driver', 'TEXT', NULL, 1, '驱动类名(Driver
class name)', 'Driver class name', NULL, NULL, NULL, NULL, now(), now()),
+ (@data_source_type_id, 'params', '连接参数(Connection params)', 'Connection
params', NULL, 'TEXT', NULL, 0, '输入JSON格式(Input JSON format):
{"param":"value"}', 'Input JSON format: {"param":"value"}', NULL, NULL, NULL,
NULL, now(), now()),
+ (@data_source_type_id, 'username', '用户名(Username)', 'Username', NULL,
'TEXT', NULL, 1, '用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', NULL, NULL,
NULL, now(), now()),
+ (@data_source_type_id, 'password', '密码(Password)', 'Password', NULL,
'PASSWORD', NULL, 1, '密码(Password)', 'Password', '', NULL, NULL, NULL, now(),
now()),
+ (@data_source_type_id, 'instance', '实例名(instance)', 'Instance', NULL,
'TEXT', NULL, 1, '实例名(instance)', 'Instance', NULL, NULL, NULL, NULL, now(),
now());
diff --git
a/linkis-public-enhancements/linkis-datasource/linkis-metadata-query/common/src/main/java/org/apache/linkis/metadata/query/common/cache/CacheConfiguration.java
b/linkis-public-enhancements/linkis-datasource/linkis-metadata-query/common/src/main/java/org/apache/linkis/metadata/query/common/cache/CacheConfiguration.java
index a8f60097b..bfff0fe92 100644
---
a/linkis-public-enhancements/linkis-datasource/linkis-metadata-query/common/src/main/java/org/apache/linkis/metadata/query/common/cache/CacheConfiguration.java
+++
b/linkis-public-enhancements/linkis-datasource/linkis-metadata-query/common/src/main/java/org/apache/linkis/metadata/query/common/cache/CacheConfiguration.java
@@ -34,10 +34,10 @@ public class CacheConfiguration {
public static final CommonVars<String> MYSQL_RELATIONSHIP_LIST =
CommonVars.apply(
"wds.linkis.server.mdq.mysql.relationship",
-
"mysql,oracle,kingbase,postgresql,sqlserver,db2,greenplum,dm,doris,clickhouse,tidb,starrocks,gaussdb");
+
"mysql,oracle,kingbase,postgresql,sqlserver,db2,greenplum,dm,doris,clickhouse,tidb,starrocks,gaussdb,oceanbase");
public static final CommonVars<String> QUERY_DATABASE_RELATIONSHIP =
CommonVars.apply(
"linkis.server.mdq.query.database.relationship",
-
"{\"tidb\":\"mysql\",\"doris\":\"mysql\",\"starrocks\":\"mysql\",\"gaussdb\":\"postgresql\"}");
+
"{\"tidb\":\"mysql\",\"doris\":\"mysql\",\"starrocks\":\"mysql\",\"oceanbase\":\"mysql\",\"gaussdb\":\"postgresql\"}");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]