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

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


The following commit(s) were added to refs/heads/dev-1.3.1 by this push:
     new ee40ca1d6 [feat:3885]Datasource env add unique index (#3886)
ee40ca1d6 is described below

commit ee40ca1d65dcde5626d663f357ffeb4f4e39bdb6
Author: aiceflower <[email protected]>
AuthorDate: Fri Nov 25 09:50:06 2022 +0800

    [feat:3885]Datasource env add unique index (#3886)
    
    * add unique index for datasource env
    
    * upgrade sql
    
    * add engine default sql script
    
    * add unique index for linkis_pserror_code
    
    Co-authored-by: casionone <[email protected]>
---
 linkis-dist/package/db/linkis_ddl.sql              |   9 +-
 linkis-dist/package/db/linkis_dml.sql              | 113 +++++++++++++++++++--
 .../db/upgrade/1.3.1_schema/mysql/linkis_dml.sql   |  13 ++-
 3 files changed, 120 insertions(+), 15 deletions(-)

diff --git a/linkis-dist/package/db/linkis_ddl.sql 
b/linkis-dist/package/db/linkis_ddl.sql
index 9e10d0040..99babaed3 100644
--- a/linkis-dist/package/db/linkis_ddl.sql
+++ b/linkis-dist/package/db/linkis_ddl.sql
@@ -856,7 +856,8 @@ CREATE TABLE `linkis_ps_dm_datasource`
     `version_id`           int(11)                            DEFAULT NULL 
COMMENT 'current version id',
     `expire`               tinyint(1)                         DEFAULT 0,
     `published_version_id` int(11)                            DEFAULT NULL,
-    PRIMARY KEY (`id`)
+    PRIMARY KEY (`id`),
+    UNIQUE INDEX `datasource_name_un` (`datasource_name`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 
 -- ----------------------------
@@ -875,7 +876,8 @@ CREATE TABLE `linkis_ps_dm_datasource_env`
     `modify_time`        datetime                      NOT NULL DEFAULT 
CURRENT_TIMESTAMP,
     `modify_user`        varchar(255) COLLATE utf8_bin NULL     DEFAULT NULL,
     PRIMARY KEY (`id`),
-    UNIQUE KEY `env_name` (`env_name`)
+    UNIQUE KEY `env_name` (`env_name`),
+    UNIQUE INDEX `env_name_datasource_type_id` (`env_name`, 
`datasource_type_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 
 
@@ -892,7 +894,8 @@ CREATE TABLE `linkis_ps_dm_datasource_type`
     `classifier`  varchar(32) COLLATE utf8_bin NOT NULL,
     `icon`        varchar(255) COLLATE utf8_bin DEFAULT NULL,
     `layers`      int(3)                       NOT NULL,
-    PRIMARY KEY (`id`)
+    PRIMARY KEY (`id`),
+    UNIQUE INDEX `name_un` (`name`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 
 -- ----------------------------
diff --git a/linkis-dist/package/db/linkis_dml.sql 
b/linkis-dist/package/db/linkis_dml.sql
index d89dbfd94..c2b1f3550 100644
--- a/linkis-dist/package/db/linkis_dml.sql
+++ b/linkis-dist/package/db/linkis_dml.sql
@@ -55,6 +55,12 @@ SET @IO_FILE_IDE=CONCAT('*-IDE,',@IO_FILE_LABEL);
 SET @OPENLOOKENG_ALL=CONCAT('*-*,',@OPENLOOKENG_LABEL);
 SET @OPENLOOKENG_IDE=CONCAT('*-IDE,',@OPENLOOKENG_LABEL);
 
+SET @TRINO_ALL=CONCAT('*-*,',@TRINO_LABEL);
+SET @TRINO_IDE=CONCAT('*-IDE,',@TRINO_LABEL);
+
+SET @IO_FILE_ALL=CONCAT('*-*,',@IO_FILE_LABEL);
+SET @IO_FILE_IDE=CONCAT('*-IDE,',@IO_FILE_LABEL);
+
 -- Global Settings
 INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `is_hidden`, 
`is_advanced`, `level`, `treeName`) VALUES ('wds.linkis.rm.yarnqueue', 
'yarn队列名', 'yarn队列名', 'default', 'None', NULL, '0', '0', '1', '队列资源');
 INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `is_hidden`, 
`is_advanced`, `level`, `treeName`) VALUES 
('wds.linkis.rm.yarnqueue.instance.max', '取值范围:1-128,单位:个', '队列实例最大个数', '30', 
'Regex', '^(?:[1-9]\\d?|[1234]\\d{2}|128)$', '0', '0', '1', '队列资源');
@@ -118,6 +124,45 @@ INSERT INTO `linkis_ps_configuration_config_key` (`key`, 
`description`, `name`,
 INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.openlookeng.catalog', 'catalog', 'catalog', 'system', 'None', '', 
'openlookeng', 0, 0, 1, '数据源配置');
 INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.openlookeng.source', 'source', 'source', 'global', 'None', '', 
'openlookeng', 0, 0, 1, '数据源配置');
 
+-- elasticsearch
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES ('linkis.es.cluster', 
'例如:http://127.0.0.1:9200', '连接地址', 'http://127.0.0.1:9200', 'None', '', 
'elasticsearch', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.es.datasource', '连接别名', '连接别名', 'hadoop', 'None', '', 'elasticsearch', 
0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES ('linkis.es.username', 
'username', 'ES集群用户名', '无', 'None', '', 'elasticsearch', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES ('linkis.es.password', 
'password', 'ES集群密码', '无', 'None', '','elasticsearch', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.es.auth.cache', '客户端是否缓存认证', '客户端是否缓存认证', 'false', 'None', '', 
'elasticsearch', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.es.sniffer.enable', '客户端是否开启 sniffer', '客户端是否开启 sniffer', 'false', 
'None', '', 'elasticsearch', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.es.http.method', '调用方式', 'HTTP请求方式', 'GET', 'None', '', 
'elasticsearch', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.es.http.endpoint', '/_search', 'JSON 脚本调用的 Endpoint', '/_search', 
'None', '', 'elasticsearch', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.es.sql.endpoint', '/_sql', 'SQL 脚本调用的 Endpoint', '/_sql', 'None', '', 
'elasticsearch', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.es.sql.format', 'SQL 脚本调用的模板,%s 替换成 SQL 作为请求体请求Es 集群', '请求体', 
'{"query":"%s"}', 'None', '', 'elasticsearch', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES ('linkis.es.headers.*', 
'客户端 Headers 配置', '客户端 Headers 配置', '无', 'None', '', 'elasticsearch', 0, 0, 1, 
'数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.engineconn.concurrent.limit', '引擎最大并发', '引擎最大并发', '100', 'None', '', 
'elasticsearch', 0, 0, 1, '数据源配置');
+
+-- presto
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('wds.linkis.presto.url', 'Presto 集群连接', 'presto连接地址', 'http://127.0.0.1:8080', 
'None', NULL, 'presto', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('wds.linkis.presto.catalog', '查询的 Catalog ', 'presto连接的catalog', 'hive', 
'None', NULL, 'presto', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('wds.linkis.presto.schema', '查询的 Schema ', '数据库连接schema', '', 'None', NULL, 
'presto', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('wds.linkis.presto.source', '查询使用的 source ', '数据库连接source', '', 'None', NULL, 
'presto', 0, 0, 1, '数据源配置');
+
+-- trino
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.default.limit', '查询的结果集返回条数限制', '结果集条数限制', '5000', 'None', '', 
'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.http.connectTimeout', '连接Trino服务器的超时时间', '连接超时时间(秒)', '60', 
'None', '', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.http.readTimeout', '等待Trino服务器返回数据的超时时间', '传输超时时间(秒)', '60', 
'None', '', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.resultSet.cache.max', 'Trino结果集缓冲区大小', '结果集缓冲区', '512k', 'None', 
'', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES ('linkis.trino.url', 
'Trino服务器URL', 'Trino服务器URL', 'http://127.0.0.1:9401', 'None', '', 'trino', 0, 
0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES ('linkis.trino.user', 
'用于连接Trino查询服务的用户名', '用户名', 'null', 'None', '', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.password', '用于连接Trino查询服务的密码', '密码', 'null', 'None', '', 
'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.passwordCmd', '用于连接Trino查询服务的密码回调命令', '密码回调命令', 'null', 'None', 
'', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.catalog', '连接Trino查询时使用的catalog', 'Catalog', 'system', 'None', 
'', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES ('linkis.trino.schema', 
'连接Trino查询服务的默认schema', 'Schema', '', 'None', '', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.ssl.insecured', '是否忽略服务器的SSL证书', '验证SSL证书', 'false', 'None', '', 
'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.engineconn.concurrent.limit', '引擎最大并发', '引擎最大并发', '100', 'None', '', 
'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.ssl.keystore', 'Trino服务器SSL keystore路径', 'keystore路径', 'null', 
'None', '', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.ssl.keystore.type', 'Trino服务器SSL keystore类型', 'keystore类型', 
'null', 'None', '', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.ssl.keystore.password', 'Trino服务器SSL keystore密码', 'keystore密码', 
'null', 'None', '', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.ssl.truststore', 'Trino服务器SSL truststore路径', 'truststore路径', 
'null', 'None', '', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.ssl.truststore.type', 'Trino服务器SSL truststore类型', 
'truststore类型', 'null', 'None', '', 'trino', 0, 0, 1, '数据源配置');
+INSERT INTO `linkis_ps_configuration_config_key` (`key`, `description`, 
`name`, `default_value`, `validate_type`, `validate_range`, `engine_conn_type`, 
`is_hidden`, `is_advanced`, `level`, `treeName`) VALUES 
('linkis.trino.ssl.truststore.password', 'Trino服务器SSL truststore密码', 
'truststore密码', 'null', 'None', '', 'trino', 0, 0, 1, '数据源配置');
 
 -- Configuration first level directory
 insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType','*-全局设置,*-*', 'OPTIONAL', 2, now(), now());
@@ -134,6 +179,9 @@ insert into `linkis_cg_manager_label` (`label_key`, 
`label_value`, `label_featur
 insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType',@PIPELINE_ALL, 'OPTIONAL', 2, now(), now());
 insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType',@JDBC_ALL, 'OPTIONAL', 2, now(), now());
 insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType',@OPENLOOKENG_ALL, 'OPTIONAL', 2, now(), 
now());
+insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType', @ELASTICSEARCH_ALL, 'OPTIONAL', 2, now(), 
now());
+insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType', @PRESTO_ALL, 'OPTIONAL', 2, now(), now());
+insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType', @TRINO_ALL, 'OPTIONAL', 2, now(), now());
 
 -- Custom correlation engine (e.g. spark-2.4.3) and configKey value
 -- Global Settings
@@ -176,6 +224,22 @@ insert into `linkis_ps_configuration_key_engine_relation` 
(`config_key_id`, `eng
 (select config.id as `config_key_id`, label.id AS `engine_type_label_id` FROM 
linkis_ps_configuration_config_key config
 INNER JOIN linkis_cg_manager_label label ON config.engine_conn_type = 
'openlookeng' and label_value = @OPENLOOKENG_ALL);
 
+-- elasticsearch-7.6.2
+insert into `linkis_ps_configuration_key_engine_relation` (`config_key_id`, 
`engine_type_label_id`)
+(select config.id as `config_key_id`, label.id AS `engine_type_label_id` FROM 
linkis_ps_configuration_config_key config
+INNER JOIN linkis_cg_manager_label label ON config.engine_conn_type = 
'elasticsearch' and label_value = @ELASTICSEARCH_ALL);
+
+-- presto-0.234
+insert into `linkis_ps_configuration_key_engine_relation` (`config_key_id`, 
`engine_type_label_id`)
+(select config.id as `config_key_id`, label.id AS `engine_type_label_id` FROM 
linkis_ps_configuration_config_key config
+INNER JOIN linkis_cg_manager_label label ON config.engine_conn_type = 'presto' 
and label_value = @PRESTO_ALL);
+
+
+-- trino-371
+insert into `linkis_ps_configuration_key_engine_relation` (`config_key_id`, 
`engine_type_label_id`)
+(select config.id as config_key_id, label.id AS engine_type_label_id FROM 
linkis_ps_configuration_config_key config
+INNER JOIN linkis_cg_manager_label label ON config.engine_conn_type = 'trino' 
and label_value = @TRINO_ALL);
+
 -- If you need to customize the parameters of the new engine, the following 
configuration does not need to write SQL initialization
 -- Just write the SQL above, and then add applications and engines to the 
management console to automatically initialize the configuration
 
@@ -188,6 +252,9 @@ insert into `linkis_cg_manager_label` (`label_key`, 
`label_value`, `label_featur
 insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType',@PIPELINE_IDE, 'OPTIONAL', 2, now(), now());
 insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType',@JDBC_IDE, 'OPTIONAL', 2, now(), now());
 insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType',@OPENLOOKENG_IDE, 'OPTIONAL', 2, now(), 
now());
+insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType', @ELASTICSEARCH_IDE, 'OPTIONAL', 2, now(), 
now());
+insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType', @PRESTO_IDE, 'OPTIONAL', 2, now(), now());
+insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType', @TRINO_IDE, 'OPTIONAL', 2, now(), now());
 
 -- Visualis
 insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType',@SPARK_VISUALIS, 'OPTIONAL', 2, now(), 
now());
@@ -228,6 +295,10 @@ insert into linkis_ps_configuration_category (`label_id`, 
`level`) VALUES (@labe
 select @label_id := id from linkis_cg_manager_label where `label_value` = 
@OPENLOOKENG_IDE;
 insert into linkis_ps_configuration_category (`label_id`, `level`) VALUES 
(@label_id, 2);
 
+insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType', @ELASTICSEARCH_IDE, 'OPTIONAL', 2, now(), 
now());
+insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType', @PRESTO_IDE, 'OPTIONAL', 2, now(), now());
+insert into `linkis_cg_manager_label` (`label_key`, `label_value`, 
`label_feature`, `label_value_size`, `update_time`, `create_time`) VALUES 
('combined_userCreator_engineType', @TRINO_IDE, 'OPTIONAL', 2, now(), now());
+
 select @label_id := id from linkis_cg_manager_label where `label_value` =  
@SPARK_VISUALIS;
 insert into linkis_ps_configuration_category (`label_id`, `level`) VALUES 
(@label_id, 2);
 
@@ -275,8 +346,24 @@ insert into `linkis_ps_configuration_config_value` 
(`config_key_id`, `config_val
 (select `relation`.`config_key_id` AS `config_key_id`, '' AS `config_value`, 
`relation`.`engine_type_label_id` AS `config_label_id` FROM 
linkis_ps_configuration_key_engine_relation relation
 INNER JOIN linkis_cg_manager_label label ON relation.engine_type_label_id = 
label.id AND label.label_value = @OPENLOOKENG_ALL);
 
+-- elasticsearch default configuration
+insert into `linkis_ps_configuration_config_value` (`config_key_id`, 
`config_value`, `config_label_id`)
+(select `relation`.`config_key_id` AS `config_key_id`, '' AS `config_value`, 
`relation`.`engine_type_label_id` AS `config_label_id` FROM 
linkis_ps_configuration_key_engine_relation relation
+INNER JOIN linkis_cg_manager_label label ON relation.engine_type_label_id = 
label.id AND label.label_value = @ELASTICSEARCH_ALL);
+
+-- presto default configuration
+insert into `linkis_ps_configuration_config_value` (`config_key_id`, 
`config_value`, `config_label_id`)
+(select `relation`.`config_key_id` AS `config_key_id`, '' AS `config_value`, 
`relation`.`engine_type_label_id` AS `config_label_id` FROM 
linkis_ps_configuration_key_engine_relation relation
+INNER JOIN linkis_cg_manager_label label ON relation.engine_type_label_id = 
label.id AND label.label_value = @PRESTO_ALL);
+
+-- trino default configuration
+insert into `linkis_ps_configuration_config_value` (`config_key_id`, 
`config_value`, `config_label_id`)
+(select relation.config_key_id AS config_key_id, '' AS config_value, 
relation.engine_type_label_id AS config_label_id FROM 
`linkis_ps_configuration_key_engine_relation` relation
+INNER JOIN linkis_cg_manager_label label ON relation.engine_type_label_id = 
label.id AND label.label_value = @TRINO_ALL);
+
+
 insert  into 
`linkis_cg_rm_external_resource_provider`(`id`,`resource_type`,`name`,`labels`,`config`)
 values
-(1,'Yarn','default',NULL,'{\r\n\"rmWebAddress\": 
\"@YARN_RESTFUL_URL\",\r\n\"hadoopVersion\": 
\"@HADOOP_VERSION\",\r\n\"authorEnable\":@YARN_AUTH_ENABLE,\r\n\"user\":\"@YARN_AUTH_USER\",\r\n\"pwd\":\"@YARN_AUTH_PWD\",\r\n\"kerberosEnable\":@YARN_KERBEROS_ENABLE,\r\n\"principalName\":\"@YARN_PRINCIPAL_NAME\",\r\n\"keytabPath\":\"@YARN_KEYTAB_PATH\",\r\n\"krb5Path\":\"@YARN_KRB5_PATH\"\r\n}');
+(1,'Yarn','default',NULL,'{"rmWebAddress":"@YARN_RESTFUL_URL","hadoopVersion":"@HADOOP_VERSION","authorEnable":@YARN_AUTH_ENABLE,"user":"@YARN_AUTH_USER","pwd":"@YARN_AUTH_PWD","kerberosEnable":@YARN_KERBEROS_ENABLE,"principalName":"@YARN_PRINCIPAL_NAME","keytabPath":"@YARN_KEYTAB_PATH","krb5Path":"@YARN_KRB5_PATH"}');
 
 -- errorcode
 -- 01 linkis server
@@ -411,7 +498,6 @@ INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type)
 INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES ('43005','python udf %s 
未定义','Undefined function:s+''(S+)''',0);
 INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43006','python执行不能将%s和%s两种类型进行连接','cannot concatenate ''(S+)'' and 
''(S+)''',0);
 INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43007','pyspark执行失败,可能是语法错误或stage失败','Py4JJavaError: An error occurred',0);
-INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43008','python代码缩进对齐有误','unexpected indent',0);
 INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43009','python代码缩进有误','unexpected indent',0);
 INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43010','python代码反斜杠后面必须换行','unexpected character after line',0);
 INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('43011','导出Excel表超过最大限制1048575','Invalid row number',0);
@@ -448,11 +534,13 @@ INSERT INTO 
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hos
 INSERT INTO 
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
 VALUES ('DSM-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
 INSERT INTO 
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
 VALUES ('LINKIS_CLI_TEST','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
 
-INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('mysql', 'mysql数据库', 'mysql数据库', 
'关系型数据库', '', 3);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('kafka', 'kafka', 'kafka', '消息队列', '', 
2);
-INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('presto', 'presto SQL', 'presto', 
'大数据存储', '', 3);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('hive', 'hive数据库', 'hive', '大数据存储', '', 
3);
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('elasticsearch','elasticsearch数据源','es无结构化存储','分布式全文索引','',3);
+
 
+--jdbc
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('mysql', 'mysql数据库', 'mysql数据库', 
'关系型数据库', '', 3);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('oracle','oracle数据库','oracle','关系型数据库','',3);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('dm','达梦数据库','dm','关系型数据库','',3);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('kingbase','人大金仓数据库','kingbase','关系型数据库','',3);
@@ -462,7 +550,16 @@ INSERT INTO `linkis_ps_dm_datasource_type` (`name`, 
`description`, `option`, `cl
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('greenplum','greenplum数据库','greenplum','关系型数据库','',3);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('doris','doris数据库','doris','olap','',4);
 INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('clickhouse','clickhouse数据库','clickhouse','olap','',4);
-INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('elasticsearch','elasticsearch数据源','es无结构化存储','分布式全文索引','',3);
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'hive';
+SET 
@data_source=CONCAT('/data-source-manager/env-list/all/type/',@data_source_type_id);
+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, 
'envId', '集群环境(Cluster env)', 'Cluster env', NULL, 'SELECT', NULL, 1, 
'集群环境(Cluster env)', 'Cluster env', NULL, NULL, NULL, @data_source, now(), 
now());
+
+
+select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'elasticsearch';
+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, 
'username', '用户名(Username)' , 'Username', NULL, 'TEXT', NULL, 1, 
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', 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 (@data_source_type_id, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', 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 (@data_source_type_id, 
'elasticUrls', 'ES连接URL(Elastic Url)', 'Elastic Url', NULL, 'TEXT', NULL, 1, 
'ES连接URL(Elastic Url)', 'Elastic Url', '', NULL, '', NULL, now(), now());
 
 
 select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'mysql';
@@ -474,8 +571,6 @@ INSERT INTO `linkis_ps_dm_datasource_type_key` 
(`data_source_type_id`, `key`, `n
 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, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 0, 
'密码(Password)', 'Password', '', 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 (@data_source_type_id, 
'databaseName', '数据库名(Database name)', 'Database name', NULL, 'TEXT', NULL, 0, 
'数据库名(Database name)', 'Database name', NULL, NULL, NULL, NULL,  now(), now());
 
-select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'hive';
-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, 
'envId', '集群环境(Cluster env)', 'Cluster env', NULL, 'SELECT', NULL, 1, 
'集群环境(Cluster env)', 'Cluster env', NULL, NULL, NULL, 
'/data-source-manager/env-list/all/type/4', now(), now());
 
 select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'oracle';
 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, 
'host', '主机名(Host)', 'Host', NULL, 'TEXT', NULL, 1, '主机名(Host)', 'Host', NULL, 
NULL, NULL, NULL,  now(), now());
@@ -558,10 +653,6 @@ INSERT INTO `linkis_ps_dm_datasource_type_key` 
(`data_source_type_id`, `key`, `n
 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, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', 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 (@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` = 'elasticsearch';
-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, 
'username', '用户名(Username)' , 'Username', NULL, 'TEXT', NULL, 1, 
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', 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 (@data_source_type_id, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', 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 (@data_source_type_id, 
'elasticUrls', 'ES连接URL(Elastic Url)', 'Elastic Url', NULL, 'TEXT', NULL, 1, 
'ES连接URL(Elastic Url)', 'Elastic Url', '', NULL, '', NULL, now(), now());
 
 select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'hive';
 INSERT INTO `linkis_ps_dm_datasource_env` (`env_name`, `env_desc`, 
`datasource_type_id`, `parameter`, `create_time`, `create_user`, `modify_time`, 
`modify_user`) VALUES ('测试环境SIT', '测试环境SIT', @data_source_type_id, 
'{"uris":"thrift://localhost:9083", 
"hadoopConf":{"hive.metastore.execute.setugi":"true"}}',  now(), NULL,  now(), 
NULL);
diff --git a/linkis-dist/package/db/upgrade/1.3.1_schema/mysql/linkis_dml.sql 
b/linkis-dist/package/db/upgrade/1.3.1_schema/mysql/linkis_dml.sql
index 302d3494a..95f311ebf 100644
--- a/linkis-dist/package/db/upgrade/1.3.1_schema/mysql/linkis_dml.sql
+++ b/linkis-dist/package/db/upgrade/1.3.1_schema/mysql/linkis_dml.sql
@@ -126,4 +126,15 @@ INSERT INTO `linkis_ps_dm_datasource_type_key` 
(`data_source_type_id`, `key`, `n
 select @data_source_type_id := id from `linkis_ps_dm_datasource_type` where 
`name` = 'elasticsearch';
 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, 
'username', '用户名(Username)' , 'Username', NULL, 'TEXT', NULL, 1, 
'用户名(Username)', 'Username', '^[0-9A-Za-z_-]+$', 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 (@data_source_type_id, 
'password', '密码(Password)', 'Password', NULL, 'PASSWORD', NULL, 1, 
'密码(Password)', 'Password', '', 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 (@data_source_type_id, 
'elasticUrls', 'ES连接URL(Elastic Url)', 'Elastic Url', NULL, 'TEXT', NULL, 1, 
'ES连接URL(Elastic Url)', 'Elastic Url', '', NULL, '', NULL, now(), now());
\ No newline at end of file
+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, 
'elasticUrls', 'ES连接URL(Elastic Url)', 'Elastic Url', NULL, 'TEXT', NULL, 1, 
'ES连接URL(Elastic Url)', 'Elastic Url', '', NULL, '', NULL, now(), now());
+
+-- delete error_code 43008, should be done before the index idx_error_regex is 
added
+DELETE FROM `linkis_ps_error_code` WHERE error_code = 43008;
+
+-- add unique index
+ALTER TABLE `linkis_ps_dm_datasource_env` ADD UNIQUE INDEX 
`env_name_datasource_type_id` (`env_name`, `datasource_type_id`);
+ALTER TABLE `linkis_ps_dm_datasource` ADD UNIQUE INDEX `datasource_name_un` 
(`datasource_name`);
+ALTER TABLE `linkis_ps_dm_datasource_type` ADD UNIQUE INDEX `name_un` (`name`);
+ALTER TABLE `linkis_ps_error_code` ADD UNIQUE INDEX `idx_error_regex` 
(error_regex(100));
+
+


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to