diff --git a/README.md b/README.md index e082677c..0d12beb3 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ English | [中文](docs/zh_CN/ch1) ## Overview -Qualitis is a one-stop data quality management platform that supports quality verification, notification, and management for various datasource. It is used to solve various data quality problems caused by data processing. +Qualitis is a data quality management platform that supports quality verification, notification, and management for various datasource. It is used to solve various data quality problems caused by data processing. Based on Spring Boot, Qualitis submits quality model task to [Linkis](https://github.com/WeBankFinTech/Linkis) platform. It provides functions such as data quality model construction, data quality model execution, data quality verification, reports of data quality generation and so on. diff --git a/core/analysis/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskResult.java b/core/analysis/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskResult.java index 52eaf8b5..8e45cd6b 100644 --- a/core/analysis/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskResult.java +++ b/core/analysis/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskResult.java @@ -22,7 +22,7 @@ * @author howeye */ @Entity -@Table(name = "application_task_result") +@Table(name = "qualitis_application_task_result") public class TaskResult { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/project/entity/Project.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/project/entity/Project.java index cac1b870..c878d57c 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/project/entity/Project.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/project/entity/Project.java @@ -25,7 +25,7 @@ * @author howeye */ @Entity -@Table(name = "project") +@Table(name = "qualitis_project") public class Project { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/project/entity/ProjectUser.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/project/entity/ProjectUser.java index cfacd6ad..f8d9a92a 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/project/entity/ProjectUser.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/project/entity/ProjectUser.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "project_user") +@Table(name = "qualitis_project_user") public class ProjectUser { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/AlarmConfig.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/AlarmConfig.java index db09b92e..d9d1345d 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/AlarmConfig.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/AlarmConfig.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "rule_alarm_config") +@Table(name = "qualitis_rule_alarm_config") public class AlarmConfig { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/Rule.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/Rule.java index f03e8b8d..cd6b1669 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/Rule.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/Rule.java @@ -27,7 +27,7 @@ * @author howeye */ @Entity -@Table(name = "rule", uniqueConstraints = @UniqueConstraint(columnNames = {"project_id", "name"})) +@Table(name = "qualitis_rule", uniqueConstraints = @UniqueConstraint(columnNames = {"project_id", "name"})) public class Rule { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleDataSource.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleDataSource.java index 82c01d09..babdbbb8 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleDataSource.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleDataSource.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "rule_datasource") +@Table(name = "qualitis_rule_datasource") public class RuleDataSource { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleDataSourceMapping.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleDataSourceMapping.java index eb553ab9..ac57019d 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleDataSourceMapping.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleDataSourceMapping.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "rule_datasource_mapping") +@Table(name = "qualitis_rule_datasource_mapping") public class RuleDataSourceMapping { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleGroup.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleGroup.java index d82f47ea..b8e420b6 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleGroup.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleGroup.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "rule_group") +@Table(name = "qualitis_rule_group") public class RuleGroup { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleVariable.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleVariable.java index 75eceacc..ca313627 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleVariable.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/RuleVariable.java @@ -24,7 +24,7 @@ * @author howeye */ @Entity -@Table(name = "rule_variable") +@Table(name = "qualitis_rule_variable") public class RuleVariable { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/Template.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/Template.java index a9af9483..fb666f7f 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/Template.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/Template.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "template") +@Table(name = "qualitis_template") public class Template { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateMidTableInputMeta.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateMidTableInputMeta.java index 34a16042..723d82bc 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateMidTableInputMeta.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateMidTableInputMeta.java @@ -24,7 +24,7 @@ * @author howeye */ @Table -@Entity(name = "template_mid_table_input_meta") +@Entity(name = "qualitis_template_mid_table_input_meta") public class TemplateMidTableInputMeta { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateOutputMeta.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateOutputMeta.java index 9b6f4471..401d5fab 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateOutputMeta.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateOutputMeta.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "template_output_meta") +@Table(name = "qualitis_template_output_meta") public class TemplateOutputMeta { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateRegexpExpr.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateRegexpExpr.java index 1a96d2a5..bb905c62 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateRegexpExpr.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateRegexpExpr.java @@ -22,7 +22,7 @@ * @author howeye */ @Entity -@Table(name = "template_regexp_expr") +@Table(name = "qualitis_template_regexp_expr") public class TemplateRegexpExpr { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateStatisticsInputMeta.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateStatisticsInputMeta.java index c80b9b24..043a1707 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateStatisticsInputMeta.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateStatisticsInputMeta.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "template_statistic_input_meta") +@Table(name = "qualitis_template_statistic_input_meta") public class TemplateStatisticsInputMeta { @Id diff --git a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateUser.java b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateUser.java index 47d3be43..bb70c1a0 100644 --- a/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateUser.java +++ b/core/project/src/main/java/com/webank/wedatasphere/qualitis/rule/entity/TemplateUser.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "template_user") +@Table(name = "qualitis_template_user") public class TemplateUser { @Id diff --git a/core/sys_config/src/main/java/com/webank/wedatasphere/qualitis/entity/ClusterInfo.java b/core/sys_config/src/main/java/com/webank/wedatasphere/qualitis/entity/ClusterInfo.java index 9215b7cd..bf3afc79 100644 --- a/core/sys_config/src/main/java/com/webank/wedatasphere/qualitis/entity/ClusterInfo.java +++ b/core/sys_config/src/main/java/com/webank/wedatasphere/qualitis/entity/ClusterInfo.java @@ -24,7 +24,7 @@ * @author howeye */ @Entity -@Table(name = "config_cluster_info") +@Table(name = "qualitis_config_cluster_info") public class ClusterInfo { @Id diff --git a/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/Application.java b/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/Application.java index 706122ec..2256099a 100644 --- a/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/Application.java +++ b/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/Application.java @@ -25,7 +25,7 @@ * @author howeye */ @Entity -@Table(name = "application") +@Table(name = "qualitis_application") public class Application { @Id diff --git a/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/Task.java b/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/Task.java index c8d9ccb7..39ce24c6 100644 --- a/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/Task.java +++ b/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/Task.java @@ -25,7 +25,7 @@ * @author howeye */ @Entity -@Table(name = "application_task") +@Table(name = "qualitis_application_task") public class Task { @Id diff --git a/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskDataSource.java b/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskDataSource.java index ae3699e3..45cdcd76 100644 --- a/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskDataSource.java +++ b/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskDataSource.java @@ -25,7 +25,7 @@ * @author howeye */ @Entity -@Table(name = "application_task_datasource") +@Table(name = "qualitis_application_task_datasource") public class TaskDataSource { @Id diff --git a/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskRuleAlarmConfig.java b/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskRuleAlarmConfig.java index 964df340..71e29675 100644 --- a/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskRuleAlarmConfig.java +++ b/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskRuleAlarmConfig.java @@ -27,7 +27,7 @@ * @author howeye */ @Entity -@Table(name = "application_task_rule_alarm_config") +@Table(name = "qualitis_application_task_rule_alarm_config") public class TaskRuleAlarmConfig { @Id diff --git a/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskRuleSimple.java b/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskRuleSimple.java index 48c18a5e..86bf49ab 100644 --- a/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskRuleSimple.java +++ b/core/task/src/main/java/com/webank/wedatasphere/qualitis/entity/TaskRuleSimple.java @@ -30,7 +30,7 @@ * @author howeye */ @Entity -@Table(name = "application_task_rule_simple") +@Table(name = "qualitis_application_task_rule_simple") public class TaskRuleSimple { @Id diff --git a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/Permission.java b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/Permission.java index c3649f72..6bc8814f 100644 --- a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/Permission.java +++ b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/Permission.java @@ -32,7 +32,7 @@ * @author howeye */ @Entity -@Table(name = "auth_permission") +@Table(name = "qualitis_auth_permission") public class Permission { @Id diff --git a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/ProxyUser.java b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/ProxyUser.java index 7bb664c6..6383a38c 100644 --- a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/ProxyUser.java +++ b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/ProxyUser.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "auth_proxy_user") +@Table(name = "qualitis_auth_proxy_user") public class ProxyUser { @Id diff --git a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/Role.java b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/Role.java index b1930110..d156e91e 100644 --- a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/Role.java +++ b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/Role.java @@ -24,7 +24,7 @@ * @author howeye */ @Entity -@Table(name = "auth_role") +@Table(name = "qualitis_auth_role") public class Role { @Id diff --git a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/RolePermission.java b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/RolePermission.java index 5ec5ab84..798b86db 100644 --- a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/RolePermission.java +++ b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/RolePermission.java @@ -22,7 +22,7 @@ * @author howeye */ @Entity -@Table(name = "auth_role_permission") +@Table(name = "qualitis_auth_role_permission") public class RolePermission { @Id diff --git a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/User.java b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/User.java index 1dde6746..5a35d475 100644 --- a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/User.java +++ b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/User.java @@ -36,7 +36,7 @@ * @author howeye */ @Entity -@Table(name = "auth_user") +@Table(name = "qualitis_auth_user") public class User { @Id diff --git a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserProxyUser.java b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserProxyUser.java index daeee8aa..52ffad08 100644 --- a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserProxyUser.java +++ b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserProxyUser.java @@ -23,7 +23,7 @@ * @author howeye */ @Entity -@Table(name = "auth_user_proxy_user") +@Table(name = "qualitis_auth_user_proxy_user") public class UserProxyUser { @Id diff --git a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserRole.java b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserRole.java index 3dddb292..697ae668 100644 --- a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserRole.java +++ b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserRole.java @@ -22,7 +22,7 @@ * @author howeye */ @Entity -@Table(name = "auth_user_role") +@Table(name = "qualitis_auth_user_role") public class UserRole { @Id diff --git a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserSpecPermission.java b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserSpecPermission.java index 613c94cc..5b0ec300 100644 --- a/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserSpecPermission.java +++ b/core/user/src/main/java/com/webank/wedatasphere/qualitis/entity/UserSpecPermission.java @@ -22,7 +22,7 @@ * @author howeye */ @Entity -@Table(name = "auth_user_permission") +@Table(name = "qualitis_auth_user_permission") public class UserSpecPermission { @Id diff --git a/docs/en_US/ch1/Linkis Access Guide.md b/docs/en_US/ch1/Linkis Access Guide.md new file mode 100644 index 00000000..00357331 --- /dev/null +++ b/docs/en_US/ch1/Linkis Access Guide.md @@ -0,0 +1,31 @@ +# How to get Linkis Token + +## Linkis Configuration +### Add Linkis Token +``` +cd $LINKIS_HOME/linkis-gateway/conf +vim token.properties +``` + +Add line as follow: +``` +QUALITIS-AUTH=* +``` + +### Modify Linkis Default Queue of User +1. Login in DataSphere Studio using the user same as qualitis. + +2. Enter 'Linkis Console' -> Settings -> wds.linkis.yarnqueue, and then set a queue in yarn. + +### Add Lib of MySQL +``` +cd $LINKIS_HOME/linkis-ujes-spark-enginemanager/lib +``` +Add MySQL Lib in it. + +At last, restart Linkis. + +## Qualitis Configuration +Type in 'QUALITIS-AUTH' in the blank of Linkis Token: +Here is an example: +![](../../../images/en_US/ch1/ClusterConfigurationDemo.png) \ No newline at end of file diff --git a/docs/en_US/ch1/QuickDeploy.md b/docs/en_US/ch1/QuickDeploy.md index 69100513..54c013b7 100644 --- a/docs/en_US/ch1/QuickDeploy.md +++ b/docs/en_US/ch1/QuickDeploy.md @@ -7,8 +7,8 @@ JDK (1.8.0_141) Hadoop (2.7.2) Hive (1.2.1) Zookeeper (3.4.9) -Linkis (0.9.0), Spark engine required.[How to install Linkis?](https://github.com/WeBankFinTech/Linkis) -DataSphereStudio (0.5.0) Optional. If you want to use workflow, it it required. [How to install DataSphereStudio?](https://github.com/WeBankFinTech/DataSphereStudio) +Linkis (0.9.1), Spark engine required.[How to install Linkis?](https://github.com/WeBankFinTech/Linkis) +DataSphereStudio (0.6.0) Optional. If you want to use workflow, it it required. [How to install DataSphereStudio?](https://github.com/WeBankFinTech/DataSphereStudio) ## 2. Download [Download](https://github.com/WeBankFinTech/Qualitis/releases) @@ -83,10 +83,7 @@ Cluster type HiveMetaStore address HiveServer2 address Linkis address -Linkis Token -Hive database address -Hive database username -Hive database password +Linkis Token(How to get Linkis Token:[Linkis Access Guide](Linkis Access Guide.md)) Here is an example: ![](../../../images/en_US/ch1/ClusterConfigurationDemo.png) diff --git a/docs/en_US/ch1/UpdateGuide.md b/docs/en_US/ch1/UpdateGuide.md new file mode 100644 index 00000000..123775a1 --- /dev/null +++ b/docs/en_US/ch1/UpdateGuide.md @@ -0,0 +1,10 @@ +# Update Guide + +## update from 0.5.0 to 0.6.0 +Download code of 0.6.0 version. + +Execute the following code below: +``` +mysql -u {USERNAME} -p {PASSWORD} -h {IP} --default-character-set=utf8 +source conf/database/update/update_0.5.0-0.6.0.sql +``` \ No newline at end of file diff --git "a/docs/zh_CN/ch1/\345\215\207\347\272\247\346\214\207\345\215\227.md" "b/docs/zh_CN/ch1/\345\215\207\347\272\247\346\214\207\345\215\227.md" new file mode 100644 index 00000000..7c1b8b4d --- /dev/null +++ "b/docs/zh_CN/ch1/\345\215\207\347\272\247\346\214\207\345\215\227.md" @@ -0,0 +1,10 @@ +# 升级指南 + +## 0.5.0 升级 0.6.0 +下载0.6.0版本代码,并解压。 + +执行以下数据库脚本: + ``` + mysql -u {USERNAME} -p {PASSWORD} -h {IP} --default-character-set=utf8 + source conf/database/update/update_0.5.0-0.6.0.sql + ``` \ No newline at end of file diff --git "a/docs/zh_CN/ch1/\345\277\253\351\200\237\346\220\255\345\273\272\346\211\213\345\206\214.md" "b/docs/zh_CN/ch1/\345\277\253\351\200\237\346\220\255\345\273\272\346\211\213\345\206\214.md" index 4f28dd20..c4c11243 100644 --- "a/docs/zh_CN/ch1/\345\277\253\351\200\237\346\220\255\345\273\272\346\211\213\345\206\214.md" +++ "b/docs/zh_CN/ch1/\345\277\253\351\200\237\346\220\255\345\273\272\346\211\213\345\206\214.md" @@ -7,8 +7,8 @@ JDK (1.8.0_141) Hadoop (2.7.2) Hive (1.2.1) Zookeeper (3.4.9) -Linkis(0.9.0), 必装Spark引擎。[如何安装Linkis](https://github.com/WeBankFinTech/Linkis) -DataSphereStudio (0.5.0) 可选. 如果你想使用工作流,必装DataSphereStudio [如何安装DataSphereStudio?](https://github.com/WeBankFinTech/DataSphereStudio) +Linkis(0.9.1), 必装Spark引擎。[如何安装Linkis](https://github.com/WeBankFinTech/Linkis) +DataSphereStudio (0.6.0) 可选. 如果你想使用工作流,必装DataSphereStudio [如何安装DataSphereStudio?](https://github.com/WeBankFinTech/DataSphereStudio) ## 二、安装包下载 [下载](https://github.com/WeBankFinTech/Qualitis/releases) @@ -83,10 +83,7 @@ sh bin/start.sh HiveMetaStore地址 HiveServer2地址 Linkis地址 -Linkis Token -Hive数据库地址(用于连接HiveMetaStore的MySQL数据库) -Hive数据库用户名(用于连接HiveMetaStore的MySQL数据库) -Hive数据库密码(用于连接HiveMetaStore的MySQL数据库) +Linkis Token(Linkis Token配置方式请查看文档:[接入Linkis文档](接入Linkis文档.md)) 可参考以下例子: ![](../../../images/zh_CN/ch1/规则配置样例.png) diff --git "a/docs/zh_CN/ch1/\346\216\245\345\205\245Linkis\346\226\207\346\241\243.md" "b/docs/zh_CN/ch1/\346\216\245\345\205\245Linkis\346\226\207\346\241\243.md" new file mode 100644 index 00000000..69582479 --- /dev/null +++ "b/docs/zh_CN/ch1/\346\216\245\345\205\245Linkis\346\226\207\346\241\243.md" @@ -0,0 +1,31 @@ +# 接入Linkis文档 + +## Linkis配置 +### 增加Linkis Token +``` +cd $LINKIS_HOME/linkis-gateway/conf +vim token.properties +``` + +增加以下行: +``` +QUALITIS-AUTH=* +``` + +### 修改用户默认提交队列 +1. 在DataSphere Studio中登录Qualitis同名的用户名 + +2. 进入Linkis管理台 -> 设置 -> yarn队列名中,并设置一个可用的yarn队列 + +### 加入MySQL依赖包 +``` +cd $LINKIS_HOME/linkis-ujes-spark-enginemanager/lib +``` +并加入mysql依赖包 + +最后,重启Linkis + +## Qualitis配置 +在Linkis Token中填入'QUALITIS-AUTH' +如下图所示: +![](../../../images/zh_CN/ch1/规则配置样例.png) \ No newline at end of file diff --git a/images/en_US/ch1/ClusterConfigurationDemo.png b/images/en_US/ch1/ClusterConfigurationDemo.png index e4f9f8b5..5e6bc0e9 100644 Binary files a/images/en_US/ch1/ClusterConfigurationDemo.png and b/images/en_US/ch1/ClusterConfigurationDemo.png differ diff --git "a/images/zh_CN/ch1/\350\247\204\345\210\231\351\205\215\347\275\256\346\240\267\344\276\213.png" "b/images/zh_CN/ch1/\350\247\204\345\210\231\351\205\215\347\275\256\346\240\267\344\276\213.png" index 0cd500b5..ede080ca 100644 Binary files "a/images/zh_CN/ch1/\350\247\204\345\210\231\351\205\215\347\275\256\346\240\267\344\276\213.png" and "b/images/zh_CN/ch1/\350\247\204\345\210\231\351\205\215\347\275\256\346\240\267\344\276\213.png" differ diff --git a/web/app/src/main/resources/database/init.sql b/web/app/src/main/resources/database/init.sql index 45c637f9..6e80b21c 100644 --- a/web/app/src/main/resources/database/init.sql +++ b/web/app/src/main/resources/database/init.sql @@ -2,10 +2,49 @@ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- --- Table structure for application +-- Table structure for auth_role_permission +-- ---------------------------- +DROP TABLE IF EXISTS `auth_role_permission`; +CREATE TABLE `auth_role_permission` ( + `role_id` bigint(20) NOT NULL, + `permission_id` bigint(20) NOT NULL, + KEY `FK5mgu2qwy6vgke5w8ds63it2ni` (`permission_id`), + KEY `FKmsro136xvh0q33x68slqluhdf` (`role_id`), + CONSTRAINT `FK5mgu2qwy6vgke5w8ds63it2ni` FOREIGN KEY (`permission_id`) REFERENCES `qualitis_auth_permission` (`id`), + CONSTRAINT `FKmsro136xvh0q33x68slqluhdf` FOREIGN KEY (`role_id`) REFERENCES `qualitis_auth_role` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for auth_user_permission +-- ---------------------------- +DROP TABLE IF EXISTS `auth_user_permission`; +CREATE TABLE `auth_user_permission` ( + `user_id` bigint(20) NOT NULL, + `permission_id` bigint(20) NOT NULL, + PRIMARY KEY (`user_id`,`permission_id`), + KEY `FK8d46965lnl53mk5qqxvdky89u` (`permission_id`), + CONSTRAINT `FK8d46965lnl53mk5qqxvdky89u` FOREIGN KEY (`permission_id`) REFERENCES `qualitis_auth_permission` (`id`), + CONSTRAINT `FKbctborxhgbh1e1cw2eq2rej18` FOREIGN KEY (`user_id`) REFERENCES `qualitis_auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for auth_user_role +-- ---------------------------- +DROP TABLE IF EXISTS `auth_user_role`; +CREATE TABLE `auth_user_role` ( + `user_id` bigint(20) NOT NULL, + `role_id` bigint(20) NOT NULL, + PRIMARY KEY (`user_id`,`role_id`), + KEY `FK2bte4mk8xumyi6mxhjpfqljhk` (`role_id`), + CONSTRAINT `FK2bte4mk8xumyi6mxhjpfqljhk` FOREIGN KEY (`role_id`) REFERENCES `qualitis_auth_role` (`id`), + CONSTRAINT `FKfxumv6vh4o8pewtsr7lsdn33y` FOREIGN KEY (`user_id`) REFERENCES `qualitis_auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Table structure for qualitis_application -- ---------------------------- -DROP TABLE IF EXISTS `application`; -CREATE TABLE `application` ( +DROP TABLE IF EXISTS `qualitis_application`; +CREATE TABLE `qualitis_application` ( `id` varchar(40) NOT NULL, `abnormal_task_num` int(11) DEFAULT NULL, `create_user` varchar(150) DEFAULT NULL, @@ -25,10 +64,10 @@ CREATE TABLE `application` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for application_task +-- Table structure for qualitis_application_task -- ---------------------------- -DROP TABLE IF EXISTS `application_task`; -CREATE TABLE `application_task` ( +DROP TABLE IF EXISTS `qualitis_application_task`; +CREATE TABLE `qualitis_application_task` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `begin_time` varchar(25) DEFAULT NULL, `cluster_id` varchar(100) DEFAULT NULL, @@ -38,15 +77,15 @@ CREATE TABLE `application_task` ( `task_remote_id` int(11) DEFAULT NULL, `application_id` varchar(40) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FK1mqrf3lwti2x4n2b4tbvrp3vh` (`application_id`), - CONSTRAINT `FK1mqrf3lwti2x4n2b4tbvrp3vh` FOREIGN KEY (`application_id`) REFERENCES `application` (`id`) + KEY `FK8vt8tfuq1jlqofdsl2bfx602d` (`application_id`), + CONSTRAINT `FK8vt8tfuq1jlqofdsl2bfx602d` FOREIGN KEY (`application_id`) REFERENCES `qualitis_application` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for application_task_datasource +-- Table structure for qualitis_application_task_datasource -- ---------------------------- -DROP TABLE IF EXISTS `application_task_datasource`; -CREATE TABLE `application_task_datasource` ( +DROP TABLE IF EXISTS `qualitis_application_task_datasource`; +CREATE TABLE `qualitis_application_task_datasource` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `cluster_name` varchar(100) DEFAULT NULL, `col_name` varchar(1000) DEFAULT NULL, @@ -58,15 +97,15 @@ CREATE TABLE `application_task_datasource` ( `table_name` varchar(100) DEFAULT NULL, `task_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FKwmp4c4apbq8ce65yn4rmiqto` (`task_id`), - CONSTRAINT `FKwmp4c4apbq8ce65yn4rmiqto` FOREIGN KEY (`task_id`) REFERENCES `application_task` (`id`) + KEY `FKeru6qjd5gwkkm1a58g290g18o` (`task_id`), + CONSTRAINT `FKeru6qjd5gwkkm1a58g290g18o` FOREIGN KEY (`task_id`) REFERENCES `qualitis_application_task` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for application_task_result +-- Table structure for qualitis_application_task_result -- ---------------------------- -DROP TABLE IF EXISTS `application_task_result`; -CREATE TABLE `application_task_result` ( +DROP TABLE IF EXISTS `qualitis_application_task_result`; +CREATE TABLE `qualitis_application_task_result` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `application_id` varchar(255) DEFAULT NULL, `create_time` varchar(255) DEFAULT NULL, @@ -77,10 +116,10 @@ CREATE TABLE `application_task_result` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for application_task_rule_alarm_config +-- Table structure for qualitis_application_task_rule_alarm_config -- ---------------------------- -DROP TABLE IF EXISTS `application_task_rule_alarm_config`; -CREATE TABLE `application_task_rule_alarm_config` ( +DROP TABLE IF EXISTS `qualitis_application_task_rule_alarm_config`; +CREATE TABLE `qualitis_application_task_rule_alarm_config` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `check_template` int(11) DEFAULT NULL, `compare_type` int(11) DEFAULT NULL, @@ -89,15 +128,15 @@ CREATE TABLE `application_task_rule_alarm_config` ( `threshold` double DEFAULT NULL, `task_rule_simple_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FK8pl4mc764sm6tigbltaxwy5ma` (`task_rule_simple_id`), - CONSTRAINT `FK8pl4mc764sm6tigbltaxwy5ma` FOREIGN KEY (`task_rule_simple_id`) REFERENCES `application_task_rule_simple` (`id`) + KEY `FKrhyx3i15dja1ipm81v3biges` (`task_rule_simple_id`), + CONSTRAINT `FKrhyx3i15dja1ipm81v3biges` FOREIGN KEY (`task_rule_simple_id`) REFERENCES `qualitis_application_task_rule_simple` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for application_task_rule_simple +-- Table structure for qualitis_application_task_rule_simple -- ---------------------------- -DROP TABLE IF EXISTS `application_task_rule_simple`; -CREATE TABLE `application_task_rule_simple` ( +DROP TABLE IF EXISTS `qualitis_application_task_rule_simple`; +CREATE TABLE `qualitis_application_task_rule_simple` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `application_id` varchar(40) DEFAULT NULL, `execute_user` varchar(20) DEFAULT NULL, @@ -112,138 +151,136 @@ CREATE TABLE `application_task_rule_simple` ( `parent_rule_simple_id` bigint(20) DEFAULT NULL, `task_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FK9c0ew72yjb06o649fe06lom9` (`parent_rule_simple_id`), - KEY `FK3cai6eubxbin3doev0qnsg591` (`task_id`), - CONSTRAINT `FK3cai6eubxbin3doev0qnsg591` FOREIGN KEY (`task_id`) REFERENCES `application_task` (`id`), - CONSTRAINT `FK9c0ew72yjb06o649fe06lom9` FOREIGN KEY (`parent_rule_simple_id`) REFERENCES `application_task_rule_simple` (`id`) + KEY `FKiciivreqw0dltknemgrqis9tv` (`parent_rule_simple_id`), + KEY `FK8nr2cvnqp4pg0q2ftp26v0wnw` (`task_id`), + CONSTRAINT `FK8nr2cvnqp4pg0q2ftp26v0wnw` FOREIGN KEY (`task_id`) REFERENCES `qualitis_application_task` (`id`), + CONSTRAINT `FKiciivreqw0dltknemgrqis9tv` FOREIGN KEY (`parent_rule_simple_id`) REFERENCES `qualitis_application_task_rule_simple` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for auth_list +-- Table structure for qualitis_auth_list -- ---------------------------- -DROP TABLE IF EXISTS `auth_list`; -CREATE TABLE `auth_list` ( +DROP TABLE IF EXISTS `qualitis_auth_list`; +CREATE TABLE `qualitis_auth_list` ( `app_id` varchar(255) NOT NULL, `app_token` varchar(255) DEFAULT NULL, PRIMARY KEY (`app_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for auth_permission +-- Table structure for qualitis_auth_permission -- ---------------------------- -DROP TABLE IF EXISTS `auth_permission`; -CREATE TABLE `auth_permission` ( +DROP TABLE IF EXISTS `qualitis_auth_permission`; +CREATE TABLE `qualitis_auth_permission` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `method` varchar(6) DEFAULT NULL, `url` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for auth_proxy_user +-- Table structure for qualitis_auth_proxy_user -- ---------------------------- -DROP TABLE IF EXISTS `auth_proxy_user`; -CREATE TABLE `auth_proxy_user` ( +DROP TABLE IF EXISTS `qualitis_auth_proxy_user`; +CREATE TABLE `qualitis_auth_proxy_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `proxy_user_name` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for auth_role +-- Table structure for qualitis_auth_role -- ---------------------------- -DROP TABLE IF EXISTS `auth_role`; -CREATE TABLE `auth_role` ( +DROP TABLE IF EXISTS `qualitis_auth_role`; +CREATE TABLE `qualitis_auth_role` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(15) DEFAULT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `UK_lc1sij60969nsgl5cy8bfgbsm` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + UNIQUE KEY `UK_d6h6ies9p214yj1lmwkegdcdc` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for auth_role_permission +-- Table structure for qualitis_auth_role_permission -- ---------------------------- -DROP TABLE IF EXISTS `auth_role_permission`; -CREATE TABLE `auth_role_permission` ( +DROP TABLE IF EXISTS `qualitis_auth_role_permission`; +CREATE TABLE `qualitis_auth_role_permission` ( `id` varchar(32) NOT NULL, `permission_id` bigint(20) DEFAULT NULL, `role_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FKj7ra5lry2xr46sggtvhn9xa6g` (`permission_id`), - KEY `FKjby3ropowpvay5qjs1ja7lni4` (`role_id`), - CONSTRAINT `FKj7ra5lry2xr46sggtvhn9xa6g` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`), - CONSTRAINT `FKjby3ropowpvay5qjs1ja7lni4` FOREIGN KEY (`role_id`) REFERENCES `auth_role` (`id`) + KEY `FKs9v745h3b0ekhibqipbj84scv` (`permission_id`), + KEY `FKjricuk1yv825s34s0cy10x3ns` (`role_id`), + CONSTRAINT `FKjricuk1yv825s34s0cy10x3ns` FOREIGN KEY (`role_id`) REFERENCES `qualitis_auth_role` (`id`), + CONSTRAINT `FKs9v745h3b0ekhibqipbj84scv` FOREIGN KEY (`permission_id`) REFERENCES `qualitis_auth_permission` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for auth_user +-- Table structure for qualitis_auth_user -- ---------------------------- -DROP TABLE IF EXISTS `auth_user`; -CREATE TABLE `auth_user` ( +DROP TABLE IF EXISTS `qualitis_auth_user`; +CREATE TABLE `qualitis_auth_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `chinese_name` varchar(255) DEFAULT NULL, `department` varchar(255) DEFAULT NULL, `password` varchar(64) DEFAULT NULL, `username` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `UK_t1iph3dfc25ukwcl9xemtnojn` (`username`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + UNIQUE KEY `UK_jsqqcjes14hjorfqihq8i10wr` (`username`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for auth_user_permission +-- Table structure for qualitis_auth_user_permission -- ---------------------------- -DROP TABLE IF EXISTS `auth_user_permission`; -CREATE TABLE `auth_user_permission` ( +DROP TABLE IF EXISTS `qualitis_auth_user_permission`; +CREATE TABLE `qualitis_auth_user_permission` ( `id` varchar(32) NOT NULL, - `permission_id` bigint(20) NOT NULL, - `user_id` bigint(20) NOT NULL, - PRIMARY KEY (`user_id`,`permission_id`), - KEY `FKishs22pergukrq4pb3f6fuq07` (`permission_id`), - CONSTRAINT `FKbretuphgkspacoe757g328q5m` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `FKishs22pergukrq4pb3f6fuq07` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`) + `permission_id` bigint(20) DEFAULT NULL, + `user_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FKfh74vev3awmabhwonewr5oogp` (`permission_id`), + KEY `FK6yvgd2emno63qw1ecnxl77ipa` (`user_id`), + CONSTRAINT `FK6yvgd2emno63qw1ecnxl77ipa` FOREIGN KEY (`user_id`) REFERENCES `qualitis_auth_user` (`id`), + CONSTRAINT `FKfh74vev3awmabhwonewr5oogp` FOREIGN KEY (`permission_id`) REFERENCES `qualitis_auth_permission` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for auth_user_proxy_user +-- Table structure for qualitis_auth_user_proxy_user -- ---------------------------- -DROP TABLE IF EXISTS `auth_user_proxy_user`; -CREATE TABLE `auth_user_proxy_user` ( +DROP TABLE IF EXISTS `qualitis_auth_user_proxy_user`; +CREATE TABLE `qualitis_auth_user_proxy_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `proxy_user_id` bigint(20) DEFAULT NULL, `user_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FK36mb4nt5p397hoyks58towu0v` (`proxy_user_id`), - KEY `FKlppwrpvg1lf8y8a5j58y69kfm` (`user_id`), - CONSTRAINT `FK36mb4nt5p397hoyks58towu0v` FOREIGN KEY (`proxy_user_id`) REFERENCES `auth_proxy_user` (`id`), - CONSTRAINT `FKlppwrpvg1lf8y8a5j58y69kfm` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) + KEY `FKpmln0snv5mkc203umorgcjf05` (`proxy_user_id`), + KEY `FKjrpgawp7y8srylpamisntf34y` (`user_id`), + CONSTRAINT `FKjrpgawp7y8srylpamisntf34y` FOREIGN KEY (`user_id`) REFERENCES `qualitis_auth_user` (`id`), + CONSTRAINT `FKpmln0snv5mkc203umorgcjf05` FOREIGN KEY (`proxy_user_id`) REFERENCES `qualitis_auth_proxy_user` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for auth_user_role +-- Table structure for qualitis_auth_user_role -- ---------------------------- -DROP TABLE IF EXISTS `auth_user_role`; -CREATE TABLE `auth_user_role` ( +DROP TABLE IF EXISTS `qualitis_auth_user_role`; +CREATE TABLE `qualitis_auth_user_role` ( `id` varchar(32) NOT NULL, - `role_id` bigint(20) NOT NULL, - `user_id` bigint(20) NOT NULL, - PRIMARY KEY (`user_id`,`role_id`), - KEY `FK3eldmba9luu9l0apl0791x8vd` (`role_id`), - CONSTRAINT `FK3eldmba9luu9l0apl0791x8vd` FOREIGN KEY (`role_id`) REFERENCES `auth_role` (`id`), - CONSTRAINT `FKebutsbqm58ehnlffb299ng0ap` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) + `role_id` bigint(20) DEFAULT NULL, + `user_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FKta8a7krobg79tw41od6tdsex0` (`role_id`), + KEY `FKeifs7mfg3qs5igw023vta8e7b` (`user_id`), + CONSTRAINT `FKeifs7mfg3qs5igw023vta8e7b` FOREIGN KEY (`user_id`) REFERENCES `qualitis_auth_user` (`id`), + CONSTRAINT `FKta8a7krobg79tw41od6tdsex0` FOREIGN KEY (`role_id`) REFERENCES `qualitis_auth_role` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for config_cluster_info +-- Table structure for qualitis_config_cluster_info -- ---------------------------- -DROP TABLE IF EXISTS `config_cluster_info`; -CREATE TABLE `config_cluster_info` ( +DROP TABLE IF EXISTS `qualitis_config_cluster_info`; +CREATE TABLE `qualitis_config_cluster_info` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, - `cluster_env` varchar(255) DEFAULT NULL, `cluster_name` varchar(100) DEFAULT NULL, `cluster_type` varchar(100) DEFAULT NULL, - `hive_database_address` varchar(255) DEFAULT NULL, - `hive_database_password` varchar(255) DEFAULT NULL, - `hive_database_username` varchar(255) DEFAULT NULL, `hive_server2_address` varchar(100) DEFAULT NULL, `linkis_address` varchar(100) DEFAULT NULL, `linkis_token` varchar(500) DEFAULT NULL, @@ -252,10 +289,10 @@ CREATE TABLE `config_cluster_info` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for project +-- Table structure for qualitis_project -- ---------------------------- -DROP TABLE IF EXISTS `project`; -CREATE TABLE `project` ( +DROP TABLE IF EXISTS `qualitis_project`; +CREATE TABLE `qualitis_project` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `create_user` varchar(50) DEFAULT NULL, `create_user_full_name` varchar(50) DEFAULT NULL, @@ -267,25 +304,25 @@ CREATE TABLE `project` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for project_user +-- Table structure for qualitis_project_user -- ---------------------------- -DROP TABLE IF EXISTS `project_user`; -CREATE TABLE `project_user` ( +DROP TABLE IF EXISTS `qualitis_project_user`; +CREATE TABLE `qualitis_project_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `permission` int(11) DEFAULT NULL, `user_full_name` varchar(30) DEFAULT NULL, `user_name` varchar(20) DEFAULT NULL, `project_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FK4ug72llnm0n7yafwntgdswl3y` (`project_id`), - CONSTRAINT `FK4ug72llnm0n7yafwntgdswl3y` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`) + KEY `FK383dxni31ohf4rl00v5l981ny` (`project_id`), + CONSTRAINT `FK383dxni31ohf4rl00v5l981ny` FOREIGN KEY (`project_id`) REFERENCES `qualitis_project` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for rule +-- Table structure for qualitis_rule -- ---------------------------- -DROP TABLE IF EXISTS `rule`; -CREATE TABLE `rule` ( +DROP TABLE IF EXISTS `qualitis_rule`; +CREATE TABLE `qualitis_rule` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `alarm` bit(1) DEFAULT NULL, `from_content` varchar(3010) DEFAULT NULL, @@ -301,21 +338,21 @@ CREATE TABLE `rule` ( `rule_group_id` bigint(20) DEFAULT NULL, `template_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `UKtjrt75tttfux1esrhmfsuwtax` (`project_id`,`name`), - KEY `FKi62skj2blskq1ynrnu2f37e4p` (`parent_rule_id`), - KEY `FKbskuw5qpbvi7dcuc3aqt8t556` (`rule_group_id`), - KEY `FKmx113051ieint865l7rs8g5ao` (`template_id`), - CONSTRAINT `FKbskuw5qpbvi7dcuc3aqt8t556` FOREIGN KEY (`rule_group_id`) REFERENCES `rule_group` (`id`), - CONSTRAINT `FKi62skj2blskq1ynrnu2f37e4p` FOREIGN KEY (`parent_rule_id`) REFERENCES `rule` (`id`), - CONSTRAINT `FKmx113051ieint865l7rs8g5ao` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`), - CONSTRAINT `FKrwqvmphnc0n6hqdsadd7fvv8k` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`) + UNIQUE KEY `UK29l9s1h04gntnqv4eje2f93n4` (`project_id`,`name`), + KEY `FKltabc4x1omja141lo9la6dg4k` (`parent_rule_id`), + KEY `FK7hv5yh1en46cfwxkqdmixyrn1` (`rule_group_id`), + KEY `FKf769w3wjl2ywbue7hft6aq8c4` (`template_id`), + CONSTRAINT `FK7hv5yh1en46cfwxkqdmixyrn1` FOREIGN KEY (`rule_group_id`) REFERENCES `qualitis_rule_group` (`id`), + CONSTRAINT `FK9tcl2mktybw44ue89mk47sejs` FOREIGN KEY (`project_id`) REFERENCES `qualitis_project` (`id`), + CONSTRAINT `FKf769w3wjl2ywbue7hft6aq8c4` FOREIGN KEY (`template_id`) REFERENCES `qualitis_template` (`id`), + CONSTRAINT `FKltabc4x1omja141lo9la6dg4k` FOREIGN KEY (`parent_rule_id`) REFERENCES `qualitis_rule` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for rule_alarm_config +-- Table structure for qualitis_rule_alarm_config -- ---------------------------- -DROP TABLE IF EXISTS `rule_alarm_config`; -CREATE TABLE `rule_alarm_config` ( +DROP TABLE IF EXISTS `qualitis_rule_alarm_config`; +CREATE TABLE `qualitis_rule_alarm_config` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `check_template` int(11) DEFAULT NULL, `compare_type` int(11) DEFAULT NULL, @@ -323,17 +360,17 @@ CREATE TABLE `rule_alarm_config` ( `rule_id` bigint(20) DEFAULT NULL, `template_output_meta_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FKrq5hh7g0iihdm06yhkoqfuw1o` (`rule_id`), - KEY `FKr4xt75g7t8qbq2p0py080cmow` (`template_output_meta_id`), - CONSTRAINT `FKr4xt75g7t8qbq2p0py080cmow` FOREIGN KEY (`template_output_meta_id`) REFERENCES `template_output_meta` (`id`), - CONSTRAINT `FKrq5hh7g0iihdm06yhkoqfuw1o` FOREIGN KEY (`rule_id`) REFERENCES `rule` (`id`) + KEY `FKh2hr5kere1f15udbtkk7cc97n` (`rule_id`), + KEY `FKjq2m5wga1kmck2haw1o867un6` (`template_output_meta_id`), + CONSTRAINT `FKh2hr5kere1f15udbtkk7cc97n` FOREIGN KEY (`rule_id`) REFERENCES `qualitis_rule` (`id`), + CONSTRAINT `FKjq2m5wga1kmck2haw1o867un6` FOREIGN KEY (`template_output_meta_id`) REFERENCES `qualitis_template_output_meta` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for rule_datasource +-- Table structure for qualitis_rule_datasource -- ---------------------------- -DROP TABLE IF EXISTS `rule_datasource`; -CREATE TABLE `rule_datasource` ( +DROP TABLE IF EXISTS `qualitis_rule_datasource`; +CREATE TABLE `qualitis_rule_datasource` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `cluster_name` varchar(100) DEFAULT NULL, `col_name` varchar(500) DEFAULT NULL, @@ -344,15 +381,15 @@ CREATE TABLE `rule_datasource` ( `table_name` varchar(100) DEFAULT NULL, `rule_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FKogwvuymonrxmhyuti8ms6l9im` (`rule_id`), - CONSTRAINT `FKogwvuymonrxmhyuti8ms6l9im` FOREIGN KEY (`rule_id`) REFERENCES `rule` (`id`) + KEY `FKcbr5lp3b6wuh669qglf3dnc6r` (`rule_id`), + CONSTRAINT `FKcbr5lp3b6wuh669qglf3dnc6r` FOREIGN KEY (`rule_id`) REFERENCES `qualitis_rule` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for rule_datasource_mapping +-- Table structure for qualitis_rule_datasource_mapping -- ---------------------------- -DROP TABLE IF EXISTS `rule_datasource_mapping`; -CREATE TABLE `rule_datasource_mapping` ( +DROP TABLE IF EXISTS `qualitis_rule_datasource_mapping`; +CREATE TABLE `qualitis_rule_datasource_mapping` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `left_column_names` varchar(2000) DEFAULT NULL, `left_statement` varchar(3000) DEFAULT NULL, @@ -361,15 +398,15 @@ CREATE TABLE `rule_datasource_mapping` ( `right_statement` varchar(3000) DEFAULT NULL, `rule_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FK95o4udqdcgwn1xarcolti8f6f` (`rule_id`), - CONSTRAINT `FK95o4udqdcgwn1xarcolti8f6f` FOREIGN KEY (`rule_id`) REFERENCES `rule` (`id`) + KEY `FKnooevousm8ai6i1b82407cq4x` (`rule_id`), + CONSTRAINT `FKnooevousm8ai6i1b82407cq4x` FOREIGN KEY (`rule_id`) REFERENCES `qualitis_rule` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for rule_group +-- Table structure for qualitis_rule_group -- ---------------------------- -DROP TABLE IF EXISTS `rule_group`; -CREATE TABLE `rule_group` ( +DROP TABLE IF EXISTS `qualitis_rule_group`; +CREATE TABLE `qualitis_rule_group` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `project_id` bigint(20) DEFAULT NULL, `rule_group_name` varchar(100) DEFAULT NULL, @@ -377,10 +414,10 @@ CREATE TABLE `rule_group` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for rule_variable +-- Table structure for qualitis_rule_variable -- ---------------------------- -DROP TABLE IF EXISTS `rule_variable`; -CREATE TABLE `rule_variable` ( +DROP TABLE IF EXISTS `qualitis_rule_variable`; +CREATE TABLE `qualitis_rule_variable` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `cluster_name` varchar(50) DEFAULT NULL, `db_name` varchar(50) DEFAULT NULL, @@ -392,19 +429,19 @@ CREATE TABLE `rule_variable` ( `template_mid_table_input_meta_id` bigint(20) DEFAULT NULL, `template_statistics_input_meta_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FKchynaoqvpq9bifa8nrjfvrcp1` (`rule_id`), - KEY `FKc5ij308cuxst7bjmf94wrsnp7` (`template_mid_table_input_meta_id`), - KEY `FKitdps70kr9qy0ikdklfybs34s` (`template_statistics_input_meta_id`), - CONSTRAINT `FKc5ij308cuxst7bjmf94wrsnp7` FOREIGN KEY (`template_mid_table_input_meta_id`) REFERENCES `template_mid_table_input_meta` (`id`), - CONSTRAINT `FKchynaoqvpq9bifa8nrjfvrcp1` FOREIGN KEY (`rule_id`) REFERENCES `rule` (`id`), - CONSTRAINT `FKitdps70kr9qy0ikdklfybs34s` FOREIGN KEY (`template_statistics_input_meta_id`) REFERENCES `template_statistic_input_meta` (`id`) + KEY `FKgvkh60999kiv1hfc5qtr2b7rt` (`rule_id`), + KEY `FK9cipdyq5a9xmwfdvybhcw2i8d` (`template_mid_table_input_meta_id`), + KEY `FKkl4loc3y5qpb618cwglvhyd5h` (`template_statistics_input_meta_id`), + CONSTRAINT `FK9cipdyq5a9xmwfdvybhcw2i8d` FOREIGN KEY (`template_mid_table_input_meta_id`) REFERENCES `qualitis_template_mid_table_input_meta` (`id`), + CONSTRAINT `FKgvkh60999kiv1hfc5qtr2b7rt` FOREIGN KEY (`rule_id`) REFERENCES `qualitis_rule` (`id`), + CONSTRAINT `FKkl4loc3y5qpb618cwglvhyd5h` FOREIGN KEY (`template_statistics_input_meta_id`) REFERENCES `qualitis_template_statistic_input_meta` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for template +-- Table structure for qualitis_template -- ---------------------------- -DROP TABLE IF EXISTS `template`; -CREATE TABLE `template` ( +DROP TABLE IF EXISTS `qualitis_template`; +CREATE TABLE `qualitis_template` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `action_type` int(11) DEFAULT NULL, `cluster_num` int(11) DEFAULT NULL, @@ -419,15 +456,15 @@ CREATE TABLE `template` ( `template_type` int(11) DEFAULT NULL, `parent_template_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FKkl9utpdhsk0yt39o8ocv859aj` (`parent_template_id`), - CONSTRAINT `FKkl9utpdhsk0yt39o8ocv859aj` FOREIGN KEY (`parent_template_id`) REFERENCES `template` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + KEY `FKpwhmy0wvpm0ycoifta3nh0fyc` (`parent_template_id`), + CONSTRAINT `FKpwhmy0wvpm0ycoifta3nh0fyc` FOREIGN KEY (`parent_template_id`) REFERENCES `qualitis_template` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for template_mid_table_input_meta +-- Table structure for qualitis_template_mid_table_input_meta -- ---------------------------- -DROP TABLE IF EXISTS `template_mid_table_input_meta`; -CREATE TABLE `template_mid_table_input_meta` ( +DROP TABLE IF EXISTS `qualitis_template_mid_table_input_meta`; +CREATE TABLE `qualitis_template_mid_table_input_meta` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `concat_template` varchar(3000) DEFAULT NULL, `field_type` int(11) DEFAULT NULL, @@ -440,44 +477,44 @@ CREATE TABLE `template_mid_table_input_meta` ( `parent_id` bigint(20) DEFAULT NULL, `template_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FKgv7116tkrbukouauu5m90jfry` (`parent_id`), - KEY `FK8h1p66kt3864rg15o28phl7yc` (`template_id`), - CONSTRAINT `FK8h1p66kt3864rg15o28phl7yc` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`), - CONSTRAINT `FKgv7116tkrbukouauu5m90jfry` FOREIGN KEY (`parent_id`) REFERENCES `template_mid_table_input_meta` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + KEY `FK15rlx42bkg7syh6apwnsss18r` (`parent_id`), + KEY `FK7antueilfq1itsq2cx29q3xlf` (`template_id`), + CONSTRAINT `FK15rlx42bkg7syh6apwnsss18r` FOREIGN KEY (`parent_id`) REFERENCES `qualitis_template_mid_table_input_meta` (`id`), + CONSTRAINT `FK7antueilfq1itsq2cx29q3xlf` FOREIGN KEY (`template_id`) REFERENCES `qualitis_template` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=30005 DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for template_output_meta +-- Table structure for qualitis_template_output_meta -- ---------------------------- -DROP TABLE IF EXISTS `template_output_meta`; -CREATE TABLE `template_output_meta` ( +DROP TABLE IF EXISTS `qualitis_template_output_meta`; +CREATE TABLE `qualitis_template_output_meta` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `field_name` varchar(50) DEFAULT NULL, `field_type` int(11) DEFAULT NULL, `output_name` varchar(150) DEFAULT NULL, `template_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FK2ywuaixo07hn3ihs5waovetsf` (`template_id`), - CONSTRAINT `FK2ywuaixo07hn3ihs5waovetsf` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + KEY `FKia38171mjfi5ix7esd968c0s5` (`template_id`), + CONSTRAINT `FKia38171mjfi5ix7esd968c0s5` FOREIGN KEY (`template_id`) REFERENCES `qualitis_template` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for template_regexp_expr +-- Table structure for qualitis_template_regexp_expr -- ---------------------------- -DROP TABLE IF EXISTS `template_regexp_expr`; -CREATE TABLE `template_regexp_expr` ( +DROP TABLE IF EXISTS `qualitis_template_regexp_expr`; +CREATE TABLE `qualitis_template_regexp_expr` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `key_name` varchar(255) DEFAULT NULL, `regexp_type` int(11) DEFAULT NULL, `regexp_value` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for template_statistic_input_meta +-- Table structure for qualitis_template_statistic_input_meta -- ---------------------------- -DROP TABLE IF EXISTS `template_statistic_input_meta`; -CREATE TABLE `template_statistic_input_meta` ( +DROP TABLE IF EXISTS `qualitis_template_statistic_input_meta`; +CREATE TABLE `qualitis_template_statistic_input_meta` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `func_name` varchar(5) DEFAULT NULL, `name` varchar(50) DEFAULT NULL, @@ -486,396 +523,396 @@ CREATE TABLE `template_statistic_input_meta` ( `value_type` int(11) DEFAULT NULL, `template_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FKq8eiiq2dbs0w7gmybsjc71oop` (`template_id`), - CONSTRAINT `FKq8eiiq2dbs0w7gmybsjc71oop` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + KEY `FKi1irb2fkjcu16pe7jdwsr7h11` (`template_id`), + CONSTRAINT `FKi1irb2fkjcu16pe7jdwsr7h11` FOREIGN KEY (`template_id`) REFERENCES `qualitis_template` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8; -- ---------------------------- --- Table structure for template_user +-- Table structure for qualitis_template_user -- ---------------------------- -DROP TABLE IF EXISTS `template_user`; -CREATE TABLE `template_user` ( +DROP TABLE IF EXISTS `qualitis_template_user`; +CREATE TABLE `qualitis_template_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` bigint(20) DEFAULT NULL, `template_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `FKmn68y8w3p2pehwsgd58km71rv` (`template_id`), - CONSTRAINT `FKmn68y8w3p2pehwsgd58km71rv` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`) + KEY `FKp4il6ga20u8v6yoyibplo971i` (`template_id`), + CONSTRAINT `FKp4il6ga20u8v6yoyibplo971i` FOREIGN KEY (`template_id`) REFERENCES `qualitis_template` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------- 插入数据库预先数据 ------------------------- -- 管理员账户 -insert into auth_user(id, username, password, chinese_name, department) values(1, "admin", "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918", "管理员", "管理员"); +insert into qualitis_auth_user(id, username, password, chinese_name, department) values(1, "admin", "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918", "管理员", "管理员"); -- 管理员角色 -insert into auth_role(id, name) values(1, "ADMIN"); -insert into auth_role(id, name) values(2, "PROJECTOR"); +insert into qualitis_auth_role(id, name) values(1, "ADMIN"); +insert into qualitis_auth_role(id, name) values(2, "PROJECTOR"); -- 管理员权限 -insert into auth_permission(id, url, method) values(1, "/qualitis/**", "GET"), (2, "/qualitis/**", "POST"), (3, "/qualitis/**", "DELETE"), (4, "/qualitis/**", "PUT"); -insert into auth_permission(id, url, method) values(5, "/qualitis/api/v1/projector/**", "GET"), (6, "/qualitis/api/v1/projector/**", "POST"), (7, "/qualitis/api/v1/projector/**", "DELETE"), (8, "/qualitis/api/v1/projector/**", "PUT"); -insert into auth_user_role(id, user_id, role_id) values("5932425efdfe49949587f51a54e0affa", 1, 1); -insert into auth_role_permission(id, role_id, permission_id) values("5932425efdfe49949587f51a54e0affb", 1, 1), ("5932425efdfe49949587f51a54e0affc", 1, 2), ("5932425efdfe49949587f51a54e0affd", 1, 3), ("5932425efdfe49949587f51a54e0affe", 1, 4); -insert into auth_role_permission(id, role_id, permission_id) values("5932425efdfe49949587f51a54e0afaa", 2, 5), ("5932425efdfe49949587f51a54e0afab", 2, 6), ("5932425efdfe49949587f51a54e0afac", 2, 7), ("5932425efdfe49949587f51a54e0afad", 2, 8); +insert into qualitis_auth_permission(id, url, method) values(1, "/qualitis/**", "GET"), (2, "/qualitis/**", "POST"), (3, "/qualitis/**", "DELETE"), (4, "/qualitis/**", "PUT"); +insert into qualitis_auth_permission(id, url, method) values(5, "/qualitis/api/v1/projector/**", "GET"), (6, "/qualitis/api/v1/projector/**", "POST"), (7, "/qualitis/api/v1/projector/**", "DELETE"), (8, "/qualitis/api/v1/projector/**", "PUT"); +insert into qualitis_auth_user_role(id, user_id, role_id) values("5932425efdfe49949587f51a54e0affa", 1, 1); +insert into qualitis_auth_role_permission(id, role_id, permission_id) values("5932425efdfe49949587f51a54e0affb", 1, 1), ("5932425efdfe49949587f51a54e0affc", 1, 2), ("5932425efdfe49949587f51a54e0affd", 1, 3), ("5932425efdfe49949587f51a54e0affe", 1, 4); +insert into qualitis_auth_role_permission(id, role_id, permission_id) values("5932425efdfe49949587f51a54e0afaa", 2, 5), ("5932425efdfe49949587f51a54e0afab", 2, 6), ("5932425efdfe49949587f51a54e0afac", 2, 7), ("5932425efdfe49949587f51a54e0afad", 2, 8); -- 规则模版 -- 字段非空检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(1, "{&NULL_VERIFICATION}", 1, 1, 1, 1, 1, "select * from ${db}.${table} where (${filter}) and (${field} is null)", 1, 1, true, "select count(*) from ${db}.${table} where (${filter}) and (${field} is null)"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 1, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 1, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 1, "field", 4, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_statistic_input_meta(template_id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, name, func_name, value, value_type, result_type) values(1, "{&RECORD_NUMBER_OF_NULL}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, id, output_name, field_name, field_type) values(1, 1, "{&RECORD_NUMBER_OF_NULL}", "count", 1); -- 主键检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(2, "{&PRIMARY_KEY_VERIFICATION}", 1, 1, 1, -1, 1, "select * from ${db}.${table} where ${filter} and (${field_concat}) in (select ${field_concat} from ${db}.${table} where ${filter} group by ${field_concat} having count(*) > 1)", 1, 1, true, "select count(*) from ${db}.${table} where ${filter} and (${field_concat}) in (select ${field_concat} from ${db}.${table} where ${filter} group by ${field_concat} having count(*) > 1)"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 2, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 2, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD_CONCAT}", 2, "field_concat", 6, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field_concat}"); -insert into template_statistic_input_meta(template_id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, name, func_name, value, value_type, result_type) values(2, "{&PRIMARY_KEY_MULTIPLE_NUMBER}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, id, output_name, field_name, field_type) values(2, 2, "{&PRIMARY_KEY_MULTIPLE_NUMBER}", "count", 1); -- 表行数检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(3, "{&TABLE_RECORD_NUMBER_VERIFICATION}", 1, 1, 1, 0, 1, "select count(*) as myCount from ${db}.${table} where ${filter}", 1, 1, false, "select count(*) from ${db}.${table} where ${filter}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 3, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 3, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_statistic_input_meta(template_id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, name, func_name, value, value_type, result_type) values(3, "{&TABLE_RECORD_NUMBER}", "max", "myCount", 1, "Long"); -insert into template_output_meta(template_id, id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, id, output_name, field_name, field_type) values(3, 3, "{&TABLE_RECORD_NUMBER}", "max", 1); -- 平均值检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(4, "{&AVERAGE_VALUE_VERIFICATION}", 1, 1, 1, 1, 1, "select avg(${field}) as myAvg from ${db}.${table} where ${filter}", 1, 1, false, "select avg(${field}) from ${db}.${table} where ${filter}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 4, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 4, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 4, "field", 4, 1, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(4, 4, "{&AVERAGE_VALUE}", "max", "myAvg", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(4, "{&AVERAGE_VALUE}", "max", 1); -- 总和检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(5, "{&SUM_VALUE_VERIFICATION}", 1, 1, 1, 1, 1, "select sum(${field}) as mySum from ${db}.${table} where ${filter}", 1, 1, false, "select sum(${field}) from ${db}.${table} where ${filter}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 5, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 5, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 5, "field", 4, 1, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(5, 5, "{&SUM_VALUE}", "max", "mySum", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(5, "{&SUM_VALUE}", "max", 1); -- 最大值检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(6, "{&MAX_VALUE_VERIFICATION}", 1, 1, 1, 1, 1, "select max(${field}) as myMax from ${db}.${table} where ${filter}", 1, 1, false, "select max(${field}) from ${db}.${table} where ${filter}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 6, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 6, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 6, "field", 4, 1, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(6, 6, "{&MAX_VALUE}", "max", "myMax", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(6, "{&MAX_VALUE}", "max", 1); -- 最小值检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(7, "{&MIN_VALUE_VERIFICATION}", 1, 1, 1, 1, 1, "select min(${field}) as myMin from ${db}.${table} where ${filter}", 1, 1, false, "select min(${field}) from ${db}.${table} where ${filter}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 7, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 7, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 7, "field", 4, 1, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(7, 7, "{&MIN_VALUE}", "max", "myMin", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(7, "{&MIN_VALUE}", "max", 1); -- 正则表达式检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(8, "{®EXP_EXPRESSION_VERIFICATION}", 1, 1, 1, 1, 1, "select * from ${db}.${table} where (${filter}) and (${field} not regexp '${regexp}')", 1, 1, true, "select count(*) from ${db}.${table} where (${filter}) and (${field} not regexp '${regexp}')"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 8, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 8, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 8, "field", 4, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{®EXP_EXPRESSION}", 8, "regexp", 7, null, true, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${regexp},{&PLEASE_TYPE_IN_REGEXP_EXPRESSION}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(8, 8, "{&MISMATCH_RECORD_NUMBER}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(8, "{&MISMATCH_RECORD_NUMBER}", "count", 1); -- 时间格式检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(9, "{&DATE_FORMAT_VERIFICATION}", 1, 1, 1, 1, 1, "select * from ${db}.${table} where (${filter}) and (${field} not regexp '${regexp}')", 1, 1, true, "select count(*) from ${db}.${table} where (${filter}) and (${field} not regexp '${regexp}')"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 9, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 9, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 9, "field", 4, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATE_FORMAT}", 9, "regexp", 7, null, false, 1, "{&REPLACE_PLACEHOLDER_IN_SQL}${regexp},{&CHOOSE_APPROPRIATE}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(9, 9, "{&MISMATCH_DATE_FORMAT_RECORD_NUMBER}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(9, "{&MISMATCH_DATE_FORMAT_RECORD_NUMBER}", "count", 1); -insert into template_regexp_expr(key_name, regexp_type, regexp_value) values("yyyyMMdd", 1, "^(?:(?!0000)[0-9]{4}(?:(?:0[1-9]|1[0-2])(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])(?:29|30)|(?:0[13578]|1[02])31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)0229)$"); -insert into template_regexp_expr(key_name, regexp_type, regexp_value) values("yyyy-MM-dd", 1, "^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"); -insert into template_regexp_expr(key_name, regexp_type, regexp_value) values("yyyyMMddHH", 1, "^(?:(?!0000)[0-9]{4}(?:(?:0[1-9]|1[0-2])(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])(?:29|30)|(?:0[13578]|1[02])31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)0229)([01][0-9]|2[0-3])$"); +insert into qualitis_template_regexp_expr(key_name, regexp_type, regexp_value) values("yyyyMMdd", 1, "^(?:(?!0000)[0-9]{4}(?:(?:0[1-9]|1[0-2])(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])(?:29|30)|(?:0[13578]|1[02])31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)0229)$"); +insert into qualitis_template_regexp_expr(key_name, regexp_type, regexp_value) values("yyyy-MM-dd", 1, "^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"); +insert into qualitis_template_regexp_expr(key_name, regexp_type, regexp_value) values("yyyyMMddHH", 1, "^(?:(?!0000)[0-9]{4}(?:(?:0[1-9]|1[0-2])(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])(?:29|30)|(?:0[13578]|1[02])31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)0229)([01][0-9]|2[0-3])$"); -- 数值格式检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(10, "{&NUMBER_FORMAT_VERIFICATION}", 1, 1, 1, 1, 1, "select * from ${db}.${table} where (${filter}) and (${field} not regexp '${regexp}')", 1, 1, true, "select count(*) from ${db}.${table} where (${filter}) and (${field} not regexp '${regexp}')"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 10, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 10, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 10, "field", 4, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&NUMBER_FORMAT_REGEXP_EXPRESSION}", 10, "regexp", 7, null, false, 2, "{&REPLACE_PLACEHOLDER_IN_SQL}${regexp}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(10, 10, "{&RECORD_NUMBER_OF_MISMATCH_NUMBER_FORMAT}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(10, "{&RECORD_NUMBER_OF_MISMATCH_NUMBER_FORMAT}", "count", 1); -insert into template_regexp_expr(regexp_type, regexp_value) values(2, "-?[0-9]+(\\\\.[0-9])?[0-9]*$"); +insert into qualitis_template_regexp_expr(regexp_type, regexp_value) values(2, "-?[0-9]+(\\\\.[0-9])?[0-9]*$"); -- 枚举值检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(11, "{&ENUM_VALUE_VERIFICATION}", 1, 1, 1, 1, 1, "select * from ${db}.${table} where (${filter}) and (${field} not in ( ${list} ) or ${field} is null)", 1, 1, true, "select count(*) from ${db}.${table} where (${filter}) and (${field} not in ( ${list} ) or ${field} is null)"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 11, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 11, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 11, "field", 4, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&ENUM_VALUE}", 11, "list", 8, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${list},示例:'1,2,3,4'"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(11, 11, "{&RECORD_NUMBER_OF_NOT_IN_ENUM_VALUE}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(11, "{&RECORD_NUMBER_OF_NOT_IN_ENUM_VALUE}", "count", 1); -- 数值范围检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(12, "{&NUMBER_RANGE_VERIFICATION}", 1, 1, 1, 0, 1, "select * from ${db}.${table} where (${filter}) and (not (${filter2}))", 1, 1, true, "select count(*) from ${db}.${table} where (${filter}) and (not (${filter2}))"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 12, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 12, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&NUMBER_RANGE}", 12, "filter2", 1, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${filter2},{&PLEASE_TYPE_IN_NUMBER_RANGE}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(12, 12, "{&RECORD_NUMBER_OF_NOT_NUMBER_RANGE}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(12, "{&RECORD_NUMBER_OF_NOT_NUMBER_RANGE}", "count", 1); -- 身份证检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(13, "{&IDENTITY_VERIFICATION}", 1, 1, 1, 1, 1, "select * from ${db}.${table} where (${filter}) and (${field} not regexp '${regexp}')", 1, 1, true, "select count(*) from ${db}.${table} where (${filter}) and (${field} not regexp '${regexp}')"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 13, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 13, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 13, "field", 4, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&IDENTITY_REGEXP_EXPRESSION}", 13, "regexp", 7, null, false, 3, "{&REPLACE_PLACEHOLDER_IN_SQL}${regexp}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(13, 13, "{&MISMATCH_IDENTITY_RECORD_NUMBER}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(13, "{&MISMATCH_IDENTITY_RECORD_NUMBER}", "count", 1); -insert into template_regexp_expr(regexp_type, regexp_value) values(3, "^[1-9][0-9]{5}(18|19|20)[0-9]{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)[0-9]{3}[0-9Xx]$"); +insert into qualitis_template_regexp_expr(regexp_type, regexp_value) values(3, "^[1-9][0-9]{5}(18|19|20)[0-9]{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)[0-9]{3}[0-9Xx]$"); -- 逻辑类检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(14, "{&LOGIC_VERIFICATION}", 1, 1, 1, 0, 1, "select * from ${db}.${table} where (${filter}) and ( (${condition1}) and not (${condition2}) )", 1, 1, true, "select count(*) from ${db}.${table} where (${filter}) and ( (${condition1}) and not (${condition2}) )"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 14, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 14, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&PRE_CONDITION}", 14, "condition1", 9, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${condition1},{&PLEASE_TYPE_IN_PRE_CONDITION}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&POST_CONDITION}", 14, "condition2", 9, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${condition2},{&PLEASE_TYPE_IN_POST_CONDITION}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(14, 14, "{&RECORD_NUMBER_OF_MISMATCH_LOGIC_VERIFICATION}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(14, "{&RECORD_NUMBER_OF_MISMATCH_LOGIC_VERIFICATION}", "count", 1); -- 空字符串检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(15, "{&EMPTY_VERIFICATION}", 1, 1, 1, 1, 1, "select * from ${db}.${table} where (${filter}) and (trim(${field}) = '' )", 1, 1, true, "select count(*) from ${db}.${table} where (${filter}) and (trim(${field}) = '' )"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 15, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 15, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 15, "field", 4, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(15, id, "{&NULL_AND_EMPTY_RECORD_NUMBER}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(15, "{&NULL_AND_EMPTY_RECORD_NUMBER}", "count", 1); -- 空值或空字符串检测 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(16, "{&NULL_AND_EMPTY_VERIFICATION}", 1, 1, 1, 1, 1, "select * from ${db}.${table} where (${filter}) and (${field} is null or trim(${field}) = '' )", 1, 1, true, "select count(*) from ${db}.${table} where (${filter}) and (${field} is null or trim(${field}) = '' )"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&DATABASE}", 16, "db", 5, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TABLE}", 16, "table", 3, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FIELD}", 16, "field", 4, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${field}"); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(16, 16, "{&NULL_AND_EMPTY_RECORD_NUMBER}", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(16, "{&NULL_AND_EMPTY_RECORD_NUMBER}", "count", 1); -- 跨表模版 -- 跨表准确性校验 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(17, "{&MULTI-TABLE_ACCURACY_VERIFICATION}", 1, 2, 2, 0, 1, "SELECT tmp1.* FROM (SELECT * FROM ${source_db}.${source_table} WHERE ${filter_left}) tmp1 LEFT JOIN (SELECT * FROM ${target_db}.${target_table} WHERE ${filter_right}) tmp2 ON ${mapping_argument} WHERE ( NOT (${source_column_is_null}) AND (${target_column_is_null}) )", 3, 1, true, "SELECT count(tmp1.*) FROM (SELECT * FROM ${source_db}.${source_table} WHERE ${filter_left}) tmp1 LEFT JOIN (SELECT * FROM ${target_db}.${target_table} WHERE ${filter_right}) tmp2 ON ${mapping_argument} WHERE ( NOT (${source_column_is_null}) AND (${target_column_is_null}) )"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&SOURCE_DATABASE}", 17, "source_db", 11, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${source_db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&SOURCE_TABLE}", 17, "source_table", 12, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${source_table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TARGET_DATABASE}", 17, "target_db", 13, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${target_db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TARGET_TABLE}", 17, "target_table", 14, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${target_table}"); -insert into template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) +insert into qualitis_template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) values(10000, "{&JOIN_CONDITION}", 17, "mapping_argument", 10, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${mapping_argument}", "(${left_statement} ${operation} ${right_statement})"); -insert into template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) +insert into qualitis_template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) values(10001, "{&SOURCE_TABLE_COLUMN_IS_NULL}", 17, "source_column_is_null", 10, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${source_column_is_null}", "${source_column} IS NULL"); -insert into template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) +insert into qualitis_template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) values(10002, "{&TARGET_TABLE_COLUMN_IS_NULL}", 17, "target_column_is_null", 10, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${target_column_is_null}", "${target_column} IS NULL"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_LEFT_EXPRESSION}", null, "left_statement", 15, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${left_statement}", 10000); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_OPERATION}", null, "operation", 16, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${operation}", 10000); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_RIGHT_EXPRESSION}", null, "right_statement", 17, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${right_statement}", 10000); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_LEFT_FILED}", null, "source_column", 18, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${source_column}", 10001); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_RIGHT_FILED}", null, "target_column", 19, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${target_column}", 10002); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(17, 17, "", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(17, "{&DIFFERENT_RECORD_BETWEEN_SOURCE_AND_TARGET_TABLE}", "count", 1); -- 附属模版 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql, parent_template_id) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql, parent_template_id) values(18, "{&MULTI-TABLE_ACCURACY_VERIFICATION_CHILD_TEMPLATE}", 1, 2, 2, 0, 1, "SELECT tmp1.* FROM (SELECT * FROM ${source_db}.${source_table} WHERE ${filter_left}) tmp1 LEFT JOIN (SELECT * FROM ${target_db}.${target_table} WHERE ${filter_right}) tmp2 ON ${mapping_argument} WHERE ( NOT (${source_column_is_null}) AND (${target_column_is_null}) )", 3, 1, true, "SELECT count(tmp1.*) FROM (SELECT * FROM ${source_db}.${source_table} WHERE ${filter_left}) tmp1 LEFT JOIN (SELECT * FROM ${target_db}.${target_table} WHERE ${filter_right}) tmp2 ON ${mapping_argument} WHERE ( NOT (${source_column_is_null}) AND (${target_column_is_null}) )", 17); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&SOURCE_DATABASE}", 18, "source_db", 11, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${source_db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&SOURCE_TABLE}", 18, "source_table", 12, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${source_table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TARGET_DATABASE}", 18, "target_db", 13, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${target_db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TARGET_TABLE}", 18, "target_table", 14, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${target_table}"); -insert into template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) +insert into qualitis_template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) values(20000, "{&JOIN_OPERATION}", 18, "mapping_argument", 10, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${mapping_argument}", "(${left_statement} ${operation} ${right_statement})"); -insert into template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) +insert into qualitis_template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) values(20001, "{&SOURCE_TABLE_COLUMN_IS_NULL}", 18, "source_column_is_null", 10, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${source_column_is_null}", "${source_column} IS NULL"); -insert into template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) +insert into qualitis_template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) values(20002, "{&TARGET_TABLE_COLUMN_IS_NULL}", 18, "target_column_is_null", 10, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${target_column_is_null}", "${target_column} IS NULL"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_LEFT_EXPRESSION}", null, "left_statement", 15, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${left_statement}", 20000); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_OPERATION}", null, "operation", 16, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${operation}", 20000); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_RIGHT_EXPRESSION}", null, "right_statement", 17, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${right_statement}", 20000); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_LEFT_FILED}", null, "source_column", 18, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${source_column}", 20001); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_RIGHT_FILED}", null, "target_column", 19, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${target_column}", 20002); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(18, 18, "", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(18, "{&DIFFERENT_RECORD_BETWEEN_TARGET_AND_SOURCE_TABLE}", "count", 1); -- 跨表通用校验 -insert into template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) +insert into qualitis_template(id, name, cluster_num, db_num, table_num, field_num, datasource_type, mid_table_action, template_type, action_type, save_mid_table, show_sql) values(19, "{&MULTI-TABLE_COMMON_VERIFICATION}", 1, 2, 2, 0, 1, "SELECT tmp1.* FROM (SELECT * FROM ${source_db}.${source_table} WHERE ${filter_left}) tmp1 LEFT JOIN (SELECT * FROM ${target_db}.${target_table} WHERE ${filter_right}) tmp2 ON ${mapping_argument} WHERE ${filter}", 3, 1, true, "SELECT count(tmp1.*) FROM (SELECT * FROM ${source_db}.${source_table} WHERE ${filter_left}) tmp1 LEFT JOIN (SELECT * FROM ${target_db}.${target_table} WHERE ${filter_right}) tmp2 ON ${mapping_argument} WHERE ${filter}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&SOURCE_DATABASE}", 19, "source_db", 11, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${source_db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&SOURCE_TABLE}", 19, "source_table", 12, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${source_table}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TARGET_DATABASE}", 19, "target_db", 13, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${target_db}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&TARGET_TABLE}", 19, "target_table", 14, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${target_table}"); -insert into template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) +insert into qualitis_template_mid_table_input_meta(id, name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, concat_template) values(30000, "{&JOIN_OPERATION}", 19, "mapping_argument", 10, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${mapping_argument}", "(${left_statement} ${operation} ${right_statement})"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description) values("{&FILTER_IN_RESULT}", 19, "filter", 9, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${filter}"); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_LEFT_EXPRESSION}", null, "left_statement", 15, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${left_statement}", 30000); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_OPERATION}", null, "operation", 16, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${operation}", 30000); -insert into template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) +insert into qualitis_template_mid_table_input_meta(name, template_id, placeholder, input_type, field_type, replace_by_request, regexp_type, placeholder_description, parent_id) values("{&JOIN_RIGHT_EXPRESSION}", null, "right_statement", 17, null, false, null, "{&REPLACE_PLACEHOLDER_IN_SQL}${right_statement}", 30000); -insert into template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) +insert into qualitis_template_statistic_input_meta(template_id, id, name, func_name, value, value_type, result_type) values(19, 19, "", "count", "*", 1, "Long"); -insert into template_output_meta(template_id, output_name, field_name, field_type) +insert into qualitis_template_output_meta(template_id, output_name, field_name, field_type) values(19, "{&NOT_PASS_VERIFICATION_RECORD_NUMBER}", "count", 1); -insert into auth_list(app_id, app_token) values("linkis_id", "***REMOVED***"); \ No newline at end of file +insert into qualitis_auth_list(app_id, app_token) values("linkis_id", "***REMOVED***"); \ No newline at end of file diff --git a/web/app/src/main/resources/database/update/update_0.5.0-0.6.0.sql b/web/app/src/main/resources/database/update/update_0.5.0-0.6.0.sql new file mode 100644 index 00000000..6236c010 --- /dev/null +++ b/web/app/src/main/resources/database/update/update_0.5.0-0.6.0.sql @@ -0,0 +1,41 @@ +/* + Using update from release-0.5.0 to release-0.6.0 +*/ + +ALTER TABLE application_task_result RENAME TO qualitis_application_task_result; +ALTER TABLE project RENAME TO qualitis_project; +ALTER TABLE project_user RENAME TO qualitis_project_user; +ALTER TABLE rule_alarm_config RENAME TO qualitis_rule_alarm_config; +ALTER TABLE rule RENAME TO qualitis_rule; +ALTER TABLE rule_datasource RENAME TO qualitis_rule_datasource; +ALTER TABLE rule_datasource_mapping RENAME TO qualitis_rule_datasource_mapping; +ALTER TABLE rule_group RENAME TO qualitis_rule_group; +ALTER TABLE rule_variable RENAME TO qualitis_rule_variable; +ALTER TABLE template RENAME TO qualitis_template; +ALTER TABLE template_mid_TABLE_input_meta RENAME TO qualitis_template_mid_TABLE_input_meta; +ALTER TABLE template_output_meta RENAME TO qualitis_template_output_meta; +ALTER TABLE template_regexp_expr RENAME TO qualitis_template_regexp_expr; +ALTER TABLE template_statistic_input_meta RENAME TO qualitis_template_statistic_input_meta; +ALTER TABLE template_user RENAME TO qualitis_template_user; +ALTER TABLE config_cluster_info RENAME TO qualitis_config_cluster_info; +ALTER TABLE application RENAME TO qualitis_application; +ALTER TABLE application_task RENAME TO qualitis_application_task; +ALTER TABLE application_task_datasource RENAME TO qualitis_application_task_datasource; +ALTER TABLE application_task_rule_alarm_config RENAME TO qualitis_application_task_rule_alarm_config; +ALTER TABLE application_task_rule_simple RENAME TO qualitis_application_task_rule_simple; +ALTER TABLE auth_permission RENAME TO qualitis_auth_permission; +ALTER TABLE auth_proxy_user RENAME TO qualitis_auth_proxy_user; +ALTER TABLE auth_role RENAME TO qualitis_auth_role; +ALTER TABLE auth_role_permission RENAME TO qualitis_auth_role_permission; +ALTER TABLE auth_user RENAME TO qualitis_auth_user; +ALTER TABLE auth_user_proxy_user RENAME TO qualitis_auth_user_proxy_user; +ALTER TABLE auth_user_role RENAME TO qualitis_auth_user_role; +ALTER TABLE auth_user_permission RENAME TO qualitis_auth_user_permission; +ALTER TABLE auth_list RENAME TO qualitis_auth_list; + +SET FOREIGN_KEY_CHECKS=0; +DROP TABLE IF EXISTS `auth_meta_data`; +DROP TABLE IF EXISTS `meta_data_cluster`; +DROP TABLE IF EXISTS `meta_data_column`; +DROP TABLE IF EXISTS `meta_data_db`; +DROP TABLE IF EXISTS `meta_data_table`; \ No newline at end of file diff --git a/web/scheduler/src/main/java/com/webank/wedatasphere/qualitis/entity/AuthList.java b/web/scheduler/src/main/java/com/webank/wedatasphere/qualitis/entity/AuthList.java index 1af9d113..9c1ca5d4 100644 --- a/web/scheduler/src/main/java/com/webank/wedatasphere/qualitis/entity/AuthList.java +++ b/web/scheduler/src/main/java/com/webank/wedatasphere/qualitis/entity/AuthList.java @@ -25,7 +25,7 @@ * @author howeye */ @Entity -@Table(name = "auth_list") +@Table(name = "qualitis_auth_list") public class AuthList { @Id