From 5afd94136ced8d273df2c4a9041cea182b004883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=BA=E9=98=B3?= Date: Mon, 13 Nov 2023 11:04:30 +0800 Subject: [PATCH] [Fix][Data Quality] Change t_ds_dq_rule_input_entry field name fix PostgreSQL not support value issue (#14992) * change data quality field name * fix-dao * fix-dao * fix-dao * fix-dao * update * test * update * update --- .../api/service/impl/DqRuleServiceImpl.java | 6 +- .../api/service/DqRuleServiceTest.java | 10 +- .../dao/entity/DqRuleInputEntry.java | 12 +- .../dao/utils/DqRuleUtils.java | 2 +- .../dao/mapper/DqRuleInputEntryMapper.xml | 4 +- .../resources/sql/dolphinscheduler_h2.sql | 66 +++---- .../resources/sql/dolphinscheduler_mysql.sql | 66 +++---- .../sql/dolphinscheduler_postgresql.sql | 66 +++---- .../mysql/dolphinscheduler_ddl.sql | 11 +- .../mysql/dolphinscheduler_ddl.sql | 40 +++++ .../postgresql/dolphinscheduler_ddl.sql | 38 ++++ .../execute/TaskExecutionContextFactory.java | 4 +- .../service/process/ProcessServiceTest.java | 10 +- .../dp/{ValueType.java => DataType.java} | 16 +- .../{ValueTypeTest.java => DataTypeTest.java} | 26 +-- .../task/dq/rule/entity/DqRuleInputEntry.java | 8 +- .../plugin/task/dq/utils/RuleParserUtils.java | 2 +- .../plugin/task/dq/DataQualityTaskTest.java | 170 +++++++++--------- 18 files changed, 319 insertions(+), 238 deletions(-) rename dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/{ValueType.java => DataType.java} (80%) rename dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/test/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/{ValueTypeTest.java => DataTypeTest.java} (58%) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DqRuleServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DqRuleServiceImpl.java index 1b5fc4fdb0..6aca9b88f8 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DqRuleServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DqRuleServiceImpl.java @@ -260,7 +260,7 @@ public class DqRuleServiceImpl extends BaseServiceImpl implements DqRuleService .setRequired(inputEntry.getIsValidate()) .build()) .setProps(paramProps) - .setValue(inputEntry.getValue()) + .setValue(inputEntry.getData()) .setPlaceholder(inputEntry.getPlaceholder()) .setEmit(Boolean.TRUE.equals(inputEntry.getIsEmit()) ? Collections.singletonList(CHANGE) : null) .build(); @@ -302,7 +302,7 @@ public class DqRuleServiceImpl extends BaseServiceImpl implements DqRuleService return SelectParam .newBuilder(inputEntry.getField(), inputEntry.getTitle()) .setOptions(options) - .setValue(inputEntry.getValue()) + .setValue(inputEntry.getData()) .setSize(SMALL) .setPlaceHolder(inputEntry.getPlaceholder()) .setEmit(Boolean.TRUE.equals(inputEntry.getIsEmit()) ? Collections.singletonList(CHANGE) : null) @@ -322,7 +322,7 @@ public class DqRuleServiceImpl extends BaseServiceImpl implements DqRuleService .setRequired(inputEntry.getIsValidate()) .build()) .setProps(paramProps) - .setValue(inputEntry.getValue()) + .setValue(inputEntry.getData()) .setPlaceholder(inputEntry.getPlaceholder()) .setEmit(Boolean.TRUE.equals(inputEntry.getIsEmit()) ? Collections.singletonList(CHANGE) : null) .build(); diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/DqRuleServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/DqRuleServiceTest.java index 703c5d3a6a..c87b74f05b 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/DqRuleServiceTest.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/DqRuleServiceTest.java @@ -40,11 +40,11 @@ import org.apache.dolphinscheduler.dao.mapper.DataSourceMapper; import org.apache.dolphinscheduler.dao.mapper.DqRuleExecuteSqlMapper; import org.apache.dolphinscheduler.dao.mapper.DqRuleInputEntryMapper; import org.apache.dolphinscheduler.dao.mapper.DqRuleMapper; +import org.apache.dolphinscheduler.plugin.task.api.enums.dp.DataType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.ExecuteSqlType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.InputType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.OptionSourceType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.RuleType; -import org.apache.dolphinscheduler.plugin.task.api.enums.dp.ValueType; import org.apache.dolphinscheduler.spi.enums.DbType; import org.apache.dolphinscheduler.spi.params.base.FormType; @@ -198,13 +198,13 @@ public class DqRuleServiceTest { srcConnectorType.setType(FormType.SELECT.getFormType()); srcConnectorType.setCanEdit(true); srcConnectorType.setIsShow(true); - srcConnectorType.setValue("JDBC"); + srcConnectorType.setData("JDBC"); srcConnectorType.setPlaceholder("Please select the source connector type"); srcConnectorType.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcConnectorType .setOptions("[{\"label\":\"HIVE\",\"value\":\"HIVE\"},{\"label\":\"JDBC\",\"value\":\"JDBC\"}]"); srcConnectorType.setInputType(InputType.DEFAULT.getCode()); - srcConnectorType.setValueType(ValueType.NUMBER.getCode()); + srcConnectorType.setDataType(DataType.NUMBER.getCode()); srcConnectorType.setIsEmit(true); srcConnectorType.setIsValidate(true); @@ -217,7 +217,7 @@ public class DqRuleServiceTest { statisticsName.setPlaceholder("Please enter statistics name, the alias in statistics execute sql"); statisticsName.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); statisticsName.setInputType(InputType.DEFAULT.getCode()); - statisticsName.setValueType(ValueType.STRING.getCode()); + statisticsName.setDataType(DataType.STRING.getCode()); statisticsName.setIsEmit(false); statisticsName.setIsValidate(true); @@ -229,7 +229,7 @@ public class DqRuleServiceTest { statisticsExecuteSql.setIsShow(true); statisticsExecuteSql.setPlaceholder("Please enter the statistics execute sql"); statisticsExecuteSql.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); - statisticsExecuteSql.setValueType(ValueType.LIKE_SQL.getCode()); + statisticsExecuteSql.setDataType(DataType.LIKE_SQL.getCode()); statisticsExecuteSql.setIsEmit(false); statisticsExecuteSql.setIsValidate(true); diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/DqRuleInputEntry.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/DqRuleInputEntry.java index f7b502fdf1..16bf490765 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/DqRuleInputEntry.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/DqRuleInputEntry.java @@ -17,9 +17,9 @@ package org.apache.dolphinscheduler.dao.entity; +import org.apache.dolphinscheduler.plugin.task.api.enums.dp.DataType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.InputType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.OptionSourceType; -import org.apache.dolphinscheduler.plugin.task.api.enums.dp.ValueType; import java.io.Serializable; import java.util.Date; @@ -56,10 +56,10 @@ public class DqRuleInputEntry implements Serializable { @TableField(value = "title") private String title; /** - * default value,can be null + * default data,can be null */ - @TableField(value = "value") - private String value; + @TableField(value = "data") + private String data; /** * default options,can be null * [{label:"",value:""}] @@ -79,8 +79,8 @@ public class DqRuleInputEntry implements Serializable { /** * input entry type: string,array,number .etc */ - @TableField(value = "value_type") - private int valueType = ValueType.NUMBER.getCode(); + @TableField(value = "data_type") + private int dataType = DataType.NUMBER.getCode(); /** * input entry type: default,statistics,comparison */ diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DqRuleUtils.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DqRuleUtils.java index a730c0a303..2e0e97eb8f 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DqRuleUtils.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DqRuleUtils.java @@ -40,7 +40,7 @@ public class DqRuleUtils { if (valuesMap.get(dqRuleInputEntry.getField()) != null) { String value = String.valueOf(valuesMap.get(dqRuleInputEntry.getField())); - dqRuleInputEntry.setValue(value); + dqRuleInputEntry.setData(value); } if (valuesMap.get("is_show") != null) { diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/DqRuleInputEntryMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/DqRuleInputEntryMapper.xml index 07db1d3e75..dbb29f694f 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/DqRuleInputEntryMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/DqRuleInputEntryMapper.xml @@ -24,11 +24,11 @@ a.field, a.type, a.title, - a.`value`, + a.data, a.options, a.placeholder, a.option_source_type, - a.value_type, + a.data_type, a.input_type, a.is_show, a.can_edit, diff --git a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql index a0e766c389..b26f57fcb1 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql @@ -1295,11 +1295,11 @@ CREATE TABLE `t_ds_dq_rule_input_entry` ( `field` varchar(255) DEFAULT NULL, `type` varchar(255) DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `value` varchar(255) DEFAULT NULL, + `data` varchar(255) DEFAULT NULL, `options` text DEFAULT NULL, `placeholder` varchar(255) DEFAULT NULL, `option_source_type` int(11) DEFAULT NULL, - `value_type` int(11) DEFAULT NULL, + `data_type` int(11) DEFAULT NULL, `input_type` int(11) DEFAULT NULL, `is_show` tinyint(1) DEFAULT '1', `can_edit` tinyint(1) DEFAULT '1', @@ -1311,97 +1311,97 @@ CREATE TABLE `t_ds_dq_rule_input_entry` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(1, 'src_connector_type', 'select', '$t(src_connector_type)', '', '[{"label":"HIVE","value":"HIVE"},{"label":"JDBC","value":"JDBC"}]', 'please select source connector type', 2, 2, 0, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(2, 'src_datasource_id', 'select', '$t(src_datasource_id)', '', NULL, 'please select source datasource id', 1, 2, 0, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(3, 'src_table', 'select', '$t(src_table)', NULL, NULL, 'Please enter source table name', 0, 0, 0, 1, 1, 1, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(4, 'src_filter', 'input', '$t(src_filter)', NULL, NULL, 'Please enter filter expression', 0, 3, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(5, 'src_field', 'select', '$t(src_field)', NULL, NULL, 'Please enter column, only single column is supported', 0, 0, 0, 1, 1, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(6, 'statistics_name', 'input', '$t(statistics_name)', NULL, NULL, 'Please enter statistics name, the alias in statistics execute sql', 0, 0, 1, 0, 0, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(7, 'check_type', 'select', '$t(check_type)', '0', '[{"label":"Expected - Actual","value":"0"},{"label":"Actual - Expected","value":"1"},{"label":"Actual / Expected","value":"2"},{"label":"(Expected - Actual) / Expected","value":"3"}]', 'please select check type', 0, 0, 3, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(8, 'operator', 'select', '$t(operator)', '0', '[{"label":"=","value":"0"},{"label":"<","value":"1"},{"label":"<=","value":"2"},{"label":">","value":"3"},{"label":">=","value":"4"},{"label":"!=","value":"5"}]', 'please select operator', 0, 0, 3, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(9, 'threshold', 'input', '$t(threshold)', NULL, NULL, 'Please enter threshold, number is needed', 0, 2, 3, 1, 1, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(10, 'failure_strategy', 'select', '$t(failure_strategy)', '0', '[{"label":"Alert","value":"0"},{"label":"Block","value":"1"}]', 'please select failure strategy', 0, 0, 3, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(11, 'target_connector_type', 'select', '$t(target_connector_type)', '', '[{"label":"HIVE","value":"HIVE"},{"label":"JDBC","value":"JDBC"}]', 'Please select target connector type', 2, 0, 0, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(12, 'target_datasource_id', 'select', '$t(target_datasource_id)', '', NULL, 'Please select target datasource', 1, 2, 0, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(13, 'target_table', 'select', '$t(target_table)', NULL, NULL, 'Please enter target table', 0, 0, 0, 1, 1, 1, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(14, 'target_filter', 'input', '$t(target_filter)', NULL, NULL, 'Please enter target filter expression', 0, 3, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(15, 'mapping_columns', 'group', '$t(mapping_columns)', NULL, '[{"field":"src_field","props":{"placeholder":"Please input src field","rows":0,"disabled":false,"size":"small"},"type":"input","title":"src_field"},{"field":"operator","props":{"placeholder":"Please input operator","rows":0,"disabled":false,"size":"small"},"type":"input","title":"operator"},{"field":"target_field","props":{"placeholder":"Please input target field","rows":0,"disabled":false,"size":"small"},"type":"input","title":"target_field"}]', 'please enter mapping columns', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(16, 'statistics_execute_sql', 'textarea', '$t(statistics_execute_sql)', NULL, NULL, 'Please enter statistics execute sql', 0, 3, 0, 1, 1, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(17, 'comparison_name', 'input', '$t(comparison_name)', NULL, NULL, 'Please enter comparison name, the alias in comparison execute sql', 0, 0, 0, 0, 0, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(18, 'comparison_execute_sql', 'textarea', '$t(comparison_execute_sql)', NULL, NULL, 'Please enter comparison execute sql', 0, 3, 0, 1, 1, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(19, 'comparison_type', 'select', '$t(comparison_type)', '', NULL, 'Please enter comparison title', 3, 0, 2, 1, 0, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(20, 'writer_connector_type', 'select', '$t(writer_connector_type)', '', '[{"label":"MYSQL","value":"0"},{"label":"POSTGRESQL","value":"1"}]', 'please select writer connector type', 0, 2, 0, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(21, 'writer_datasource_id', 'select', '$t(writer_datasource_id)', '', NULL, 'please select writer datasource id', 1, 2, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(22, 'target_field', 'select', '$t(target_field)', NULL, NULL, 'Please enter column, only single column is supported', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(23, 'field_length', 'input', '$t(field_length)', NULL, NULL, 'Please enter length limit', 0, 3, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(24, 'logic_operator', 'select', '$t(logic_operator)', '=', '[{"label":"=","value":"="},{"label":"<","value":"<"},{"label":"<=","value":"<="},{"label":">","value":">"},{"label":">=","value":">="},{"label":"<>","value":"<>"}]', 'please select logic operator', 0, 0, 3, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(25, 'regexp_pattern', 'input', '$t(regexp_pattern)', NULL, NULL, 'Please enter regexp pattern', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(26, 'deadline', 'input', '$t(deadline)', NULL, NULL, 'Please enter deadline', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(27, 'datetime_format', 'input', '$t(datetime_format)', NULL, NULL, 'Please enter datetime format', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(28, 'enum_list', 'input', '$t(enum_list)', NULL, NULL, 'Please enter enumeration', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(29, 'begin_time', 'input', '$t(begin_time)', NULL, NULL, 'Please enter begin time', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.0', '2021-03-03 11:31:24.0'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(30, 'src_database', 'select', '$t(src_database)', NULL, NULL, 'Please select source database', 0, 0, 0, 1, 1, 1, 1, '2021-03-03 11:31:24.0', '2021-03-03 11:31:24.0'); INSERT INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(31, 'target_database', 'select', '$t(target_database)', NULL, NULL, 'Please select target database', 0, 0, 0, 1, 1, 1, 1, '2021-03-03 11:31:24.0', '2021-03-03 11:31:24.0'); -- diff --git a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql index 5840d998a6..eb5b5625b4 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql @@ -1282,11 +1282,11 @@ CREATE TABLE `t_ds_dq_rule_input_entry` ( `field` varchar(255) DEFAULT NULL, `type` varchar(255) DEFAULT NULL, `title` varchar(255) DEFAULT NULL, - `value` varchar(255) DEFAULT NULL, + `data` varchar(255) DEFAULT NULL, `options` text DEFAULT NULL, `placeholder` varchar(255) DEFAULT NULL, `option_source_type` int(11) DEFAULT NULL, - `value_type` int(11) DEFAULT NULL, + `data_type` int(11) DEFAULT NULL, `input_type` int(11) DEFAULT NULL, `is_show` tinyint(1) DEFAULT '1', `can_edit` tinyint(1) DEFAULT '1', @@ -1298,97 +1298,97 @@ CREATE TABLE `t_ds_dq_rule_input_entry` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(1, 'src_connector_type', 'select', '$t(src_connector_type)', '', '[{"label":"HIVE","value":"HIVE"},{"label":"JDBC","value":"JDBC"}]', 'please select source connector type', 2, 2, 0, 1, 1, 1, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(2, 'src_datasource_id', 'select', '$t(src_datasource_id)', '', NULL, 'please select source datasource id', 1, 2, 0, 1, 1, 1, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(3, 'src_table', 'select', '$t(src_table)', NULL, NULL, 'Please enter source table name', 0, 0, 0, 1, 1, 1, 1, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(4, 'src_filter', 'input', '$t(src_filter)', NULL, NULL, 'Please enter filter expression', 0, 3, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(5, 'src_field', 'select', '$t(src_field)', NULL, NULL, 'Please enter column, only single column is supported', 0, 0, 0, 1, 1, 0, 1, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(6, 'statistics_name', 'input', '$t(statistics_name)', NULL, NULL, 'Please enter statistics name, the alias in statistics execute sql', 0, 0, 1, 0, 0, 0, 1, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(7, 'check_type', 'select', '$t(check_type)', '0', '[{"label":"Expected - Actual","value":"0"},{"label":"Actual - Expected","value":"1"},{"label":"Actual / Expected","value":"2"},{"label":"(Expected - Actual) / Expected","value":"3"}]', 'please select check type', 0, 0, 3, 1, 1, 1, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(8, 'operator', 'select', '$t(operator)', '0', '[{"label":"=","value":"0"},{"label":"<","value":"1"},{"label":"<=","value":"2"},{"label":">","value":"3"},{"label":">=","value":"4"},{"label":"!=","value":"5"}]', 'please select operator', 0, 0, 3, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(9, 'threshold', 'input', '$t(threshold)', NULL, NULL, 'Please enter threshold, number is needed', 0, 2, 3, 1, 1, 0, 1, current_timestamp, current_timestamp); INSERT Ignore INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(10, 'failure_strategy', 'select', '$t(failure_strategy)', '0', '[{"label":"Alert","value":"0"},{"label":"Block","value":"1"}]', 'please select failure strategy', 0, 0, 3, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(11, 'target_connector_type', 'select', '$t(target_connector_type)', '', '[{"label":"HIVE","value":"HIVE"},{"label":"JDBC","value":"JDBC"}]', 'Please select target connector type', 2, 0, 0, 1, 1, 1, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(12, 'target_datasource_id', 'select', '$t(target_datasource_id)', '', NULL, 'Please select target datasource', 1, 2, 0, 1, 1, 1, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(13, 'target_table', 'select', '$t(target_table)', NULL, NULL, 'Please enter target table', 0, 0, 0, 1, 1, 1, 1, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(14, 'target_filter', 'input', '$t(target_filter)', NULL, NULL, 'Please enter target filter expression', 0, 3, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(15, 'mapping_columns', 'group', '$t(mapping_columns)', NULL, '[{"field":"src_field","props":{"placeholder":"Please input src field","rows":0,"disabled":false,"size":"small"},"type":"input","title":"src_field"},{"field":"operator","props":{"placeholder":"Please input operator","rows":0,"disabled":false,"size":"small"},"type":"input","title":"operator"},{"field":"target_field","props":{"placeholder":"Please input target field","rows":0,"disabled":false,"size":"small"},"type":"input","title":"target_field"}]', 'please enter mapping columns', 0, 0, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(16, 'statistics_execute_sql', 'textarea', '$t(statistics_execute_sql)', NULL, NULL, 'Please enter statistics execute sql', 0, 3, 0, 1, 1, 0, 1, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(17, 'comparison_name', 'input', '$t(comparison_name)', NULL, NULL, 'Please enter comparison name, the alias in comparison execute sql', 0, 0, 0, 0, 0, 0, 1, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(18, 'comparison_execute_sql', 'textarea', '$t(comparison_execute_sql)', NULL, NULL, 'Please enter comparison execute sql', 0, 3, 0, 1, 1, 0, 1, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(19, 'comparison_type', 'select', '$t(comparison_type)', '', NULL, 'Please enter comparison title', 3, 0, 2, 1, 0, 1, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(20, 'writer_connector_type', 'select', '$t(writer_connector_type)', '', '[{"label":"MYSQL","value":"0"},{"label":"POSTGRESQL","value":"1"}]', 'please select writer connector type', 0, 2, 0, 1, 1, 1, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(21, 'writer_datasource_id', 'select', '$t(writer_datasource_id)', '', NULL, 'please select writer datasource id', 1, 2, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(22, 'target_field', 'select', '$t(target_field)', NULL, NULL, 'Please enter column, only single column is supported', 0, 0, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(23, 'field_length', 'input', '$t(field_length)', NULL, NULL, 'Please enter length limit', 0, 3, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(24, 'logic_operator', 'select', '$t(logic_operator)', '=', '[{"label":"=","value":"="},{"label":"<","value":"<"},{"label":"<=","value":"<="},{"label":">","value":">"},{"label":">=","value":">="},{"label":"<>","value":"<>"}]', 'please select logic operator', 0, 0, 3, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(25, 'regexp_pattern', 'input', '$t(regexp_pattern)', NULL, NULL, 'Please enter regexp pattern', 0, 0, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(26, 'deadline', 'input', '$t(deadline)', NULL, NULL, 'Please enter deadline', 0, 0, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(27, 'datetime_format', 'input', '$t(datetime_format)', NULL, NULL, 'Please enter datetime format', 0, 0, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(28, 'enum_list', 'input', '$t(enum_list)', NULL, NULL, 'Please enter enumeration', 0, 0, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(29, 'begin_time', 'input', '$t(begin_time)', NULL, NULL, 'Please enter begin time', 0, 0, 0, 1, 1, 0, 0, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(30, 'src_database', 'select', '$t(src_database)', NULL, NULL, 'Please select source database', 0, 0, 0, 1, 1, 1, 1, current_timestamp, current_timestamp); INSERT IGNORE INTO `t_ds_dq_rule_input_entry` -(`id`, `field`, `type`, `title`, `value`, `options`, `placeholder`, `option_source_type`, `value_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) +(`id`, `field`, `type`, `title`, `data`, `options`, `placeholder`, `option_source_type`, `data_type`, `input_type`, `is_show`, `can_edit`, `is_emit`, `is_validate`, `create_time`, `update_time`) VALUES(31, 'target_database', 'select', '$t(target_database)', NULL, NULL, 'Please select target database', 0, 0, 0, 1, 1, 1, 1, current_timestamp, current_timestamp); -- diff --git a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql index 3e5a8946bd..2257074874 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql @@ -1264,11 +1264,11 @@ CREATE TABLE t_ds_dq_rule_input_entry ( field varchar(255) DEFAULT NULL, "type" varchar(255) DEFAULT NULL, title varchar(255) DEFAULT NULL, - value varchar(255) DEFAULT NULL, + data varchar(255) DEFAULT NULL, "options" text DEFAULT NULL, placeholder varchar(255) DEFAULT NULL, option_source_type int4 NULL, - value_type int4 NULL, + data_type int4 NULL, input_type int4 NULL, is_show int2 NULL DEFAULT '1'::smallint, can_edit int2 NULL DEFAULT '1'::smallint, @@ -1279,97 +1279,97 @@ CREATE TABLE t_ds_dq_rule_input_entry ( CONSTRAINT t_ds_dq_rule_input_entry_pk PRIMARY KEY (id) ); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(1, 'src_connector_type', 'select', '$t(src_connector_type)', '', '[{"label":"HIVE","value":"HIVE"},{"label":"JDBC","value":"JDBC"}]', 'please select source connector type', 2, 2, 0, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(2, 'src_datasource_id', 'select', '$t(src_datasource_id)', '', NULL, 'please select source datasource id', 1, 2, 0, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(3, 'src_table', 'select', '$t(src_table)', NULL, NULL, 'Please enter source table name', 0, 0, 0, 1, 1, 1, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(4, 'src_filter', 'input', '$t(src_filter)', NULL, NULL, 'Please enter filter expression', 0, 3, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(5, 'src_field', 'select', '$t(src_field)', NULL, NULL, 'Please enter column, only single column is supported', 0, 0, 0, 1, 1, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(6, 'statistics_name', 'input', '$t(statistics_name)', NULL, NULL, 'Please enter statistics name, the alias in statistics execute sql', 0, 0, 1, 0, 0, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(7, 'check_type', 'select', '$t(check_type)', '0', '[{"label":"Expected - Actual","value":"0"},{"label":"Actual - Expected","value":"1"},{"label":"Actual / Expected","value":"2"},{"label":"(Expected - Actual) / Expected","value":"3"}]', 'please select check type', 0, 0, 3, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(8, 'operator', 'select', '$t(operator)', '0', '[{"label":"=","value":"0"},{"label":"<","value":"1"},{"label":"<=","value":"2"},{"label":">","value":"3"},{"label":">=","value":"4"},{"label":"!=","value":"5"}]', 'please select operator', 0, 0, 3, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(9, 'threshold', 'input', '$t(threshold)', NULL, NULL, 'Please enter threshold, number is needed', 0, 2, 3, 1, 1, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(10, 'failure_strategy', 'select', '$t(failure_strategy)', '0', '[{"label":"Alert","value":"0"},{"label":"Block","value":"1"}]', 'please select failure strategy', 0, 0, 3, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(11, 'target_connector_type', 'select', '$t(target_connector_type)', '', '[{"label":"HIVE","value":"HIVE"},{"label":"JDBC","value":"JDBC"}]', 'Please select target connector type', 2, 0, 0, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(12, 'target_datasource_id', 'select', '$t(target_datasource_id)', '', NULL, 'Please select target datasource', 1, 2, 0, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(13, 'target_table', 'select', '$t(target_table)', NULL, NULL, 'Please enter target table', 0, 0, 0, 1, 1, 1, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(14, 'target_filter', 'input', '$t(target_filter)', NULL, NULL, 'Please enter target filter expression', 0, 3, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(15, 'mapping_columns', 'group', '$t(mapping_columns)', NULL, '[{"field":"src_field","props":{"placeholder":"Please input src field","rows":0,"disabled":false,"size":"small"},"type":"input","title":"src_field"},{"field":"operator","props":{"placeholder":"Please input operator","rows":0,"disabled":false,"size":"small"},"type":"input","title":"operator"},{"field":"target_field","props":{"placeholder":"Please input target field","rows":0,"disabled":false,"size":"small"},"type":"input","title":"target_field"}]', 'please enter mapping columns', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(16, 'statistics_execute_sql', 'textarea', '$t(statistics_execute_sql)', NULL, NULL, 'Please enter statistics execute sql', 0, 3, 0, 1, 1, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(17, 'comparison_name', 'input', '$t(comparison_name)', NULL, NULL, 'Please enter comparison name, the alias in comparison execute sql', 0, 0, 0, 0, 0, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(18, 'comparison_execute_sql', 'textarea', '$t(comparison_execute_sql)', NULL, NULL, 'Please enter comparison execute sql', 0, 3, 0, 1, 1, 0, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(19, 'comparison_type', 'select', '$t(comparison_type)', '', NULL, 'Please enter comparison title', 3, 0, 2, 1, 0, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(20, 'writer_connector_type', 'select', '$t(writer_connector_type)', '', '[{"label":"MYSQL","value":"0"},{"label":"POSTGRESQL","value":"1"}]', 'please select writer connector type', 0, 2, 0, 1, 1, 1, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(21, 'writer_datasource_id', 'select', '$t(writer_datasource_id)', '', NULL, 'please select writer datasource id', 1, 2, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(22, 'target_field', 'select', '$t(target_field)', NULL, NULL, 'Please enter column, only single column is supported', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(23, 'field_length', 'input', '$t(field_length)', NULL, NULL, 'Please enter length limit', 0, 3, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(24, 'logic_operator', 'select', '$t(logic_operator)', '=', '[{"label":"=","value":"="},{"label":"<","value":"<"},{"label":"<=","value":"<="},{"label":">","value":">"},{"label":">=","value":">="},{"label":"<>","value":"<>"}]', 'please select logic operator', 0, 0, 3, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(25, 'regexp_pattern', 'input', '$t(regexp_pattern)', NULL, NULL, 'Please enter regexp pattern', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(26, 'deadline', 'input', '$t(deadline)', NULL, NULL, 'Please enter deadline', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(27, 'datetime_format', 'input', '$t(datetime_format)', NULL, NULL, 'Please enter datetime format', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(28, 'enum_list', 'input', '$t(enum_list)', NULL, NULL, 'Please enter enumeration', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(29, 'begin_time', 'input', '$t(begin_time)', NULL, NULL, 'Please enter begin time', 0, 0, 0, 1, 1, 0, 0, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(30, 'src_database', 'select', '$t(src_database)', NULL, NULL, 'Please select source database', 0, 0, 0, 1, 1, 1, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); INSERT INTO t_ds_dq_rule_input_entry -(id, field, "type", title, value, "options", placeholder, option_source_type, value_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) +(id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) VALUES(31, 'target_database', 'select', '$t(target_database)', NULL, NULL, 'Please select target database', 0, 0, 0, 1, 1, 1, 1, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); -- diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.2.0_schema/mysql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.2.0_schema/mysql/dolphinscheduler_ddl.sql index 3015f83e76..45374db231 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.2.0_schema/mysql/dolphinscheduler_ddl.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.2.0_schema/mysql/dolphinscheduler_ddl.sql @@ -53,8 +53,9 @@ BEGIN ALTER TABLE t_ds_process_definition ADD COLUMN `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 0:parallel,1:serial wait,2:serial discard,3:serial priority'; END IF; END; - d// - delimiter ; +d// + +delimiter ; CALL t_ds_process_definition_add_column; DROP PROCEDURE t_ds_process_definition_add_column; @@ -72,8 +73,9 @@ BEGIN ALTER TABLE t_ds_process_definition_log ADD COLUMN `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 0:parallel,1:serial wait,2:serial discard,3:serial priority'; END IF; END; - d// - delimiter ; +d// + +delimiter ; CALL t_ds_process_definition_log_add_column; DROP PROCEDURE t_ds_process_definition_log_add_column; @@ -92,6 +94,7 @@ ALTER TABLE t_ds_process_instance ADD COLUMN `next_process_instance_id` int(11) END IF; END; d// + delimiter ; CALL t_ds_process_instance_add_column; DROP PROCEDURE t_ds_process_instance_add_column; diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/mysql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/mysql/dolphinscheduler_ddl.sql index 0bbc6fbad2..1daf4c153e 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/mysql/dolphinscheduler_ddl.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/mysql/dolphinscheduler_ddl.sql @@ -34,3 +34,43 @@ CREATE TABLE `t_ds_listener_event` INDEX `idx_sign` (`sign`), INDEX `idx_status` (`post_status`) ) CHARSET utf8 COLLATE utf8_bin; + +-- modify_data_t_ds_dq_rule_input_entry behavior change +--DROP PROCEDURE if EXISTS modify_data_t_ds_dq_rule_input_entry; +DROP PROCEDURE if EXISTS modify_data_t_ds_dq_rule_input_entry; +delimiter d// +CREATE PROCEDURE modify_data_t_ds_dq_rule_input_entry() +BEGIN + IF EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_dq_rule_input_entry' + AND TABLE_SCHEMA=(SELECT DATABASE()) + AND COLUMN_NAME ='value') + THEN + ALTER TABLE `t_ds_dq_rule_input_entry` + CHANGE COLUMN `value` `data` varchar(255) DEFAULT NULL; + END IF; +END; +d// +delimiter ; +CALL modify_data_t_ds_dq_rule_input_entry; +DROP PROCEDURE modify_data_t_ds_dq_rule_input_entry; + +-- modify_data_value_t_ds_dq_rule_input_entry behavior change +--DROP PROCEDURE if EXISTS modify_data_value_t_ds_dq_rule_input_entry; +DROP PROCEDURE if EXISTS modify_data_value_t_ds_dq_rule_input_entry; +delimiter d// +CREATE PROCEDURE modify_data_value_t_ds_dq_rule_input_entry() +BEGIN + IF EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_dq_rule_input_entry' + AND TABLE_SCHEMA=(SELECT DATABASE()) + AND COLUMN_NAME ='value_type') + THEN + ALTER TABLE `t_ds_dq_rule_input_entry` + CHANGE COLUMN `value_type` `data_type` int(11) DEFAULT NULL; + END IF; +END; +d// +delimiter ; +CALL modify_data_value_t_ds_dq_rule_input_entry; +DROP PROCEDURE modify_data_value_t_ds_dq_rule_input_entry; \ No newline at end of file diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/postgresql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/postgresql/dolphinscheduler_ddl.sql index 7a2cef722f..809be532a3 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/postgresql/dolphinscheduler_ddl.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/3.3.0_schema/postgresql/dolphinscheduler_ddl.sql @@ -24,3 +24,41 @@ CREATE INDEX "idx_listener_event_post_status" ON "t_ds_listener_event" ("post_st CREATE INDEX "idx_listener_event_sign" ON "t_ds_listener_event" ("sign"); -- Set comment to column: "sign" on table: "t_ds_listener_event" COMMENT ON COLUMN "t_ds_listener_event" ."sign" IS 'sign=sha1(content)'; +-- modify_data_t_ds_dq_rule_input_entry + +delimiter d// +CREATE OR REPLACE FUNCTION modify_data_t_ds_dq_rule_input_entry() RETURNS void AS $$ +BEGIN + IF EXISTS (SELECT 1 + FROM information_schema.columns + WHERE table_name = 't_ds_dq_rule_input_entry' + AND column_name = 'value') + THEN + ALTER TABLE t_ds_dq_rule_input_entry + RENAME COLUMN "value" TO "data"; + END IF; +END; +$$ LANGUAGE plpgsql; +d// + +select modify_data_t_ds_dq_rule_input_entry(); +DROP FUNCTION IF EXISTS modify_data_t_ds_dq_rule_input_entry(); + +-- modify_data_type_t_ds_dq_rule_input_entry +delimiter d// +CREATE OR REPLACE FUNCTION modify_data_type_t_ds_dq_rule_input_entry() RETURNS void AS $$ +BEGIN + IF EXISTS (SELECT 1 + FROM information_schema.columns + WHERE table_name = 't_ds_dq_rule_input_entry' + AND column_name = 'value_type') + THEN + ALTER TABLE t_ds_dq_rule_input_entry + RENAME COLUMN "value_type" TO "data_type"; + END IF; +END; +$$ LANGUAGE plpgsql; +d// + +select modify_data_type_t_ds_dq_rule_input_entry(); +DROP FUNCTION IF EXISTS modify_data_type_t_ds_dq_rule_input_entry(); \ No newline at end of file diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/TaskExecutionContextFactory.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/TaskExecutionContextFactory.java index 0153c81364..d8f72564bd 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/TaskExecutionContextFactory.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/TaskExecutionContextFactory.java @@ -345,12 +345,12 @@ public class TaskExecutionContextFactory { if (type != null) { DqRuleInputEntry comparisonName = new DqRuleInputEntry(); comparisonName.setField(COMPARISON_NAME); - comparisonName.setValue(type.getName()); + comparisonName.setData(type.getName()); ruleInputEntryList.add(comparisonName); DqRuleInputEntry comparisonTable = new DqRuleInputEntry(); comparisonTable.setField(COMPARISON_TABLE); - comparisonTable.setValue(type.getOutputTable()); + comparisonTable.setData(type.getOutputTable()); ruleInputEntryList.add(comparisonTable); if (executeSqlList == null) { diff --git a/dolphinscheduler-service/src/test/java/org/apache/dolphinscheduler/service/process/ProcessServiceTest.java b/dolphinscheduler-service/src/test/java/org/apache/dolphinscheduler/service/process/ProcessServiceTest.java index f326a04a73..309331adab 100644 --- a/dolphinscheduler-service/src/test/java/org/apache/dolphinscheduler/service/process/ProcessServiceTest.java +++ b/dolphinscheduler-service/src/test/java/org/apache/dolphinscheduler/service/process/ProcessServiceTest.java @@ -71,11 +71,11 @@ import org.apache.dolphinscheduler.dao.repository.TaskDefinitionDao; import org.apache.dolphinscheduler.dao.repository.TaskDefinitionLogDao; import org.apache.dolphinscheduler.dao.repository.TaskInstanceDao; import org.apache.dolphinscheduler.plugin.task.api.TaskPluginManager; +import org.apache.dolphinscheduler.plugin.task.api.enums.dp.DataType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.DqTaskState; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.ExecuteSqlType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.InputType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.OptionSourceType; -import org.apache.dolphinscheduler.plugin.task.api.enums.dp.ValueType; import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo; import org.apache.dolphinscheduler.service.cron.CronUtilsTest; import org.apache.dolphinscheduler.service.exceptions.CronParseException; @@ -546,13 +546,13 @@ public class ProcessServiceTest { srcConnectorType.setType(FormType.SELECT.getFormType()); srcConnectorType.setCanEdit(true); srcConnectorType.setIsShow(true); - srcConnectorType.setValue("JDBC"); + srcConnectorType.setData("JDBC"); srcConnectorType.setPlaceholder("Please select the source connector type"); srcConnectorType.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcConnectorType .setOptions("[{\"label\":\"HIVE\",\"value\":\"HIVE\"},{\"label\":\"JDBC\",\"value\":\"JDBC\"}]"); srcConnectorType.setInputType(InputType.DEFAULT.getCode()); - srcConnectorType.setValueType(ValueType.NUMBER.getCode()); + srcConnectorType.setDataType(DataType.NUMBER.getCode()); srcConnectorType.setIsEmit(true); DqRuleInputEntry statisticsName = new DqRuleInputEntry(); @@ -564,7 +564,7 @@ public class ProcessServiceTest { statisticsName.setPlaceholder("Please enter statistics name, the alias in statistics execute sql"); statisticsName.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); statisticsName.setInputType(InputType.DEFAULT.getCode()); - statisticsName.setValueType(ValueType.STRING.getCode()); + statisticsName.setDataType(DataType.STRING.getCode()); statisticsName.setIsEmit(false); DqRuleInputEntry statisticsExecuteSql = new DqRuleInputEntry(); @@ -575,7 +575,7 @@ public class ProcessServiceTest { statisticsExecuteSql.setIsShow(true); statisticsExecuteSql.setPlaceholder("Please enter the statistics execute sql"); statisticsExecuteSql.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); - statisticsExecuteSql.setValueType(ValueType.LIKE_SQL.getCode()); + statisticsExecuteSql.setDataType(DataType.LIKE_SQL.getCode()); statisticsExecuteSql.setIsEmit(false); list.add(srcConnectorType); diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/ValueType.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/DataType.java similarity index 80% rename from dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/ValueType.java rename to dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/DataType.java index 0e1150af03..131144efe0 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/ValueType.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/DataType.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * rule input entry value type */ -public enum ValueType { +public enum DataType { /** * 0-string @@ -38,7 +38,7 @@ public enum ValueType { NUMBER(2, "number"), LIKE_SQL(3, "sql"); - ValueType(int code, String description) { + DataType(int code, String description) { this.code = code; this.description = description; } @@ -55,17 +55,17 @@ public enum ValueType { return description; } - private static final Map VALUES_MAP = new HashMap<>(); + private static final Map DATA_TYPE_MAP = new HashMap<>(); static { - for (ValueType type : ValueType.values()) { - VALUES_MAP.put(type.code, type); + for (DataType type : DataType.values()) { + DATA_TYPE_MAP.put(type.code, type); } } - public static ValueType of(Integer status) { - if (VALUES_MAP.containsKey(status)) { - return VALUES_MAP.get(status); + public static DataType of(Integer status) { + if (DATA_TYPE_MAP.containsKey(status)) { + return DATA_TYPE_MAP.get(status); } throw new IllegalArgumentException("invalid code : " + status); } diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/test/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/ValueTypeTest.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/test/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/DataTypeTest.java similarity index 58% rename from dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/test/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/ValueTypeTest.java rename to dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/test/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/DataTypeTest.java index 9cf622b723..73b6b4138e 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/test/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/ValueTypeTest.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/test/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/DataTypeTest.java @@ -20,7 +20,7 @@ package org.apache.dolphinscheduler.plugin.task.api.enums.dp; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -public class ValueTypeTest { +public class DataTypeTest { /** * 0-string @@ -30,25 +30,25 @@ public class ValueTypeTest { */ @Test public void testGetCode() { - Assertions.assertEquals(0, ValueType.STRING.getCode()); - Assertions.assertEquals(1, ValueType.LIST.getCode()); - Assertions.assertEquals(2, ValueType.NUMBER.getCode()); - Assertions.assertEquals(3, ValueType.LIKE_SQL.getCode()); + Assertions.assertEquals(0, DataType.STRING.getCode()); + Assertions.assertEquals(1, DataType.LIST.getCode()); + Assertions.assertEquals(2, DataType.NUMBER.getCode()); + Assertions.assertEquals(3, DataType.LIKE_SQL.getCode()); } @Test public void testGetDescription() { - Assertions.assertEquals("string", ValueType.STRING.getDescription()); - Assertions.assertEquals("list", ValueType.LIST.getDescription()); - Assertions.assertEquals("number", ValueType.NUMBER.getDescription()); - Assertions.assertEquals("sql", ValueType.LIKE_SQL.getDescription()); + Assertions.assertEquals("string", DataType.STRING.getDescription()); + Assertions.assertEquals("list", DataType.LIST.getDescription()); + Assertions.assertEquals("number", DataType.NUMBER.getDescription()); + Assertions.assertEquals("sql", DataType.LIKE_SQL.getDescription()); } @Test public void testOf() { - Assertions.assertEquals(ValueType.STRING, ValueType.of(0)); - Assertions.assertEquals(ValueType.LIST, ValueType.of(1)); - Assertions.assertEquals(ValueType.NUMBER, ValueType.of(2)); - Assertions.assertEquals(ValueType.LIKE_SQL, ValueType.of(3)); + Assertions.assertEquals(DataType.STRING, DataType.of(0)); + Assertions.assertEquals(DataType.LIST, DataType.of(1)); + Assertions.assertEquals(DataType.NUMBER, DataType.of(2)); + Assertions.assertEquals(DataType.LIKE_SQL, DataType.of(3)); } } diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/main/java/org/apache/dolphinscheduler/plugin/task/dq/rule/entity/DqRuleInputEntry.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/main/java/org/apache/dolphinscheduler/plugin/task/dq/rule/entity/DqRuleInputEntry.java index 5959753a20..bce5013373 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/main/java/org/apache/dolphinscheduler/plugin/task/dq/rule/entity/DqRuleInputEntry.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/main/java/org/apache/dolphinscheduler/plugin/task/dq/rule/entity/DqRuleInputEntry.java @@ -17,9 +17,9 @@ package org.apache.dolphinscheduler.plugin.task.dq.rule.entity; +import org.apache.dolphinscheduler.plugin.task.api.enums.dp.DataType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.InputType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.OptionSourceType; -import org.apache.dolphinscheduler.plugin.task.api.enums.dp.ValueType; import java.io.Serializable; import java.util.Date; @@ -46,9 +46,9 @@ public class DqRuleInputEntry implements Serializable { */ private String title; /** - * default value,can be null + * default data,can be null */ - private String value; + private String data; /** * default options,can be null * [{label:"",value:""}] @@ -65,7 +65,7 @@ public class DqRuleInputEntry implements Serializable { /** * input entry type: string,array,number .etc */ - private int valueType = ValueType.NUMBER.getCode(); + private int dataType = DataType.NUMBER.getCode(); /** * input entry type: default,statistics,comparison */ diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/main/java/org/apache/dolphinscheduler/plugin/task/dq/utils/RuleParserUtils.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/main/java/org/apache/dolphinscheduler/plugin/task/dq/utils/RuleParserUtils.java index c4e31a9aaf..e99bb3dfaf 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/main/java/org/apache/dolphinscheduler/plugin/task/dq/utils/RuleParserUtils.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/main/java/org/apache/dolphinscheduler/plugin/task/dq/utils/RuleParserUtils.java @@ -258,7 +258,7 @@ public class RuleParserUtils { Map defaultInputParameterValue = new HashMap<>(); for (DqRuleInputEntry inputEntry : defaultInputEntryList) { - defaultInputParameterValue.put(inputEntry.getField(), inputEntry.getValue()); + defaultInputParameterValue.put(inputEntry.getField(), inputEntry.getData()); } return defaultInputParameterValue; diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/test/java/org/apache/dolphinscheduler/plugin/task/dq/DataQualityTaskTest.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/test/java/org/apache/dolphinscheduler/plugin/task/dq/DataQualityTaskTest.java index 0fe89b1989..bdfcf722a5 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/test/java/org/apache/dolphinscheduler/plugin/task/dq/DataQualityTaskTest.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-dataquality/src/test/java/org/apache/dolphinscheduler/plugin/task/dq/DataQualityTaskTest.java @@ -22,11 +22,11 @@ import static org.apache.dolphinscheduler.plugin.task.api.utils.DataQualityConst import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.plugin.task.api.DataQualityTaskExecutionContext; +import org.apache.dolphinscheduler.plugin.task.api.enums.dp.DataType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.ExecuteSqlType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.InputType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.OptionSourceType; import org.apache.dolphinscheduler.plugin.task.api.enums.dp.RuleType; -import org.apache.dolphinscheduler.plugin.task.api.enums.dp.ValueType; import org.apache.dolphinscheduler.plugin.task.dq.rule.RuleManager; import org.apache.dolphinscheduler.plugin.task.dq.rule.entity.DqRuleExecuteSql; import org.apache.dolphinscheduler.plugin.task.dq.rule.entity.DqRuleInputEntry; @@ -114,12 +114,12 @@ public class DataQualityTaskTest { srcConnectorType.setType(FormType.SELECT.getFormType()); srcConnectorType.setCanEdit(true); srcConnectorType.setIsShow(true); - srcConnectorType.setValue(null); + srcConnectorType.setData(null); srcConnectorType.setPlaceholder("${src_connector_type}"); srcConnectorType.setOptionSourceType(OptionSourceType.DATASOURCE_TYPE.getCode()); srcConnectorType.setOptions(null); srcConnectorType.setInputType(InputType.DEFAULT.getCode()); - srcConnectorType.setValueType(ValueType.NUMBER.getCode()); + srcConnectorType.setDataType(DataType.NUMBER.getCode()); srcConnectorType.setCreateTime(new Date()); srcConnectorType.setUpdateTime(new Date()); @@ -129,10 +129,10 @@ public class DataQualityTaskTest { srcDatasourceId.setType(FormType.CASCADER.getFormType()); srcDatasourceId.setCanEdit(true); srcDatasourceId.setIsShow(true); - srcDatasourceId.setValue(null); + srcDatasourceId.setData(null); srcDatasourceId.setOptionSourceType(OptionSourceType.DATASOURCE_ID.getCode()); srcDatasourceId.setInputType(InputType.DEFAULT.getCode()); - srcDatasourceId.setValueType(ValueType.NUMBER.getCode()); + srcDatasourceId.setDataType(DataType.NUMBER.getCode()); srcDatasourceId.setCreateTime(new Date()); srcDatasourceId.setUpdateTime(new Date()); @@ -142,11 +142,11 @@ public class DataQualityTaskTest { srcDatabase.setType(FormType.CASCADER.getFormType()); srcDatabase.setCanEdit(true); srcDatabase.setIsShow(true); - srcDatabase.setValue(null); + srcDatabase.setData(null); srcDatabase.setPlaceholder("$t(src_database)"); srcDatabase.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcDatabase.setInputType(InputType.DEFAULT.getCode()); - srcDatabase.setValueType(ValueType.NUMBER.getCode()); + srcDatabase.setDataType(DataType.NUMBER.getCode()); srcDatabase.setCreateTime(new Date()); srcDatabase.setUpdateTime(new Date()); @@ -159,7 +159,7 @@ public class DataQualityTaskTest { srcTable.setPlaceholder("Please enter source table name"); srcTable.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcTable.setInputType(InputType.DEFAULT.getCode()); - srcTable.setValueType(ValueType.STRING.getCode()); + srcTable.setDataType(DataType.STRING.getCode()); srcTable.setCreateTime(new Date()); srcTable.setUpdateTime(new Date()); @@ -172,7 +172,7 @@ public class DataQualityTaskTest { srcFilter.setPlaceholder("Please enter filter expression"); srcFilter.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcFilter.setInputType(InputType.DEFAULT.getCode()); - srcFilter.setValueType(ValueType.LIKE_SQL.getCode()); + srcFilter.setDataType(DataType.LIKE_SQL.getCode()); srcFilter.setCreateTime(new Date()); srcFilter.setUpdateTime(new Date()); @@ -182,11 +182,11 @@ public class DataQualityTaskTest { srcField.setType(FormType.INPUT.getFormType()); srcField.setCanEdit(true); srcField.setIsShow(true); - srcField.setValue(""); + srcField.setData(""); srcField.setPlaceholder("Please enter column, only single column is supported"); srcField.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcField.setInputType(InputType.DEFAULT.getCode()); - srcField.setValueType(ValueType.STRING.getCode()); + srcField.setDataType(DataType.STRING.getCode()); srcField.setCreateTime(new Date()); srcField.setUpdateTime(new Date()); @@ -196,11 +196,11 @@ public class DataQualityTaskTest { statisticsName.setType(FormType.INPUT.getFormType()); statisticsName.setCanEdit(false); statisticsName.setIsShow(false); - statisticsName.setValue("table_count.total"); + statisticsName.setData("table_count.total"); statisticsName.setPlaceholder("${statistics_name}"); statisticsName.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); statisticsName.setInputType(InputType.STATISTICS.getCode()); - statisticsName.setValueType(ValueType.STRING.getCode()); + statisticsName.setDataType(DataType.STRING.getCode()); statisticsName.setCreateTime(new Date()); statisticsName.setUpdateTime(new Date()); @@ -214,9 +214,9 @@ public class DataQualityTaskTest { checkType.setOptions( "[{\"label\":\"比对值 - 统计值\",\"value\":\"0\"},{\"label\":\"统计值 - 比对值\",\"value\":\"1\"},{\"label\":\"统计值 / 比对值\"," + "\"value\":\"2\"},{\"label\":\"(比对值-统计值) / 比对值\",\"value\":\"3\"}]"); - checkType.setValue("0"); + checkType.setData("0"); checkType.setInputType(InputType.CHECK.getCode()); - checkType.setValueType(ValueType.STRING.getCode()); + checkType.setDataType(DataType.STRING.getCode()); checkType.setPlaceholder("检测类型"); checkType.setCreateTime(new Date()); checkType.setUpdateTime(new Date()); @@ -232,9 +232,9 @@ public class DataQualityTaskTest { + "{\"label\":\"<\",\"value\":\"1\"},{\"label\":\"<=\",\"value\":\"2\"}," + "{\"label\":\">\",\"value\":\"3\"},{\"label\":\">=\",\"value\":\"4\"}," + "{\"label\":\"!=\",\"value\":\"5\"}]"); - operator.setValue("0"); + operator.setData("0"); operator.setInputType(InputType.CHECK.getCode()); - operator.setValueType(ValueType.STRING.getCode()); + operator.setDataType(DataType.STRING.getCode()); operator.setPlaceholder("操作符"); operator.setCreateTime(new Date()); operator.setUpdateTime(new Date()); @@ -247,7 +247,7 @@ public class DataQualityTaskTest { threshold.setIsShow(true); threshold.setPlaceholder("Please enter threshold, number is needed"); threshold.setInputType(InputType.CHECK.getCode()); - threshold.setValueType(ValueType.NUMBER.getCode()); + threshold.setDataType(DataType.NUMBER.getCode()); threshold.setCreateTime(new Date()); threshold.setUpdateTime(new Date()); @@ -259,9 +259,9 @@ public class DataQualityTaskTest { afterFailure.setIsShow(true); afterFailure.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); afterFailure.setOptions("[{\"label\":\"告警\",\"value\":\"0\"},{\"label\":\"阻断\",\"value\":\"1\"}]"); - afterFailure.setValue("0"); + afterFailure.setData("0"); afterFailure.setInputType(InputType.CHECK.getCode()); - afterFailure.setValueType(ValueType.STRING.getCode()); + afterFailure.setDataType(DataType.STRING.getCode()); afterFailure.setPlaceholder("失败策略"); afterFailure.setCreateTime(new Date()); afterFailure.setUpdateTime(new Date()); @@ -337,12 +337,12 @@ public class DataQualityTaskTest { srcConnectorType.setType(FormType.SELECT.getFormType()); srcConnectorType.setCanEdit(true); srcConnectorType.setIsShow(true); - srcConnectorType.setValue(null); + srcConnectorType.setData(null); srcConnectorType.setPlaceholder("${src_connector_type}"); srcConnectorType.setOptionSourceType(OptionSourceType.DATASOURCE_TYPE.getCode()); srcConnectorType.setOptions(null); srcConnectorType.setInputType(InputType.DEFAULT.getCode()); - srcConnectorType.setValueType(ValueType.NUMBER.getCode()); + srcConnectorType.setDataType(DataType.NUMBER.getCode()); srcConnectorType.setCreateTime(new Date()); srcConnectorType.setUpdateTime(new Date()); @@ -352,11 +352,11 @@ public class DataQualityTaskTest { srcDatasourceId.setType(FormType.CASCADER.getFormType()); srcDatasourceId.setCanEdit(true); srcDatasourceId.setIsShow(true); - srcDatasourceId.setValue(null); + srcDatasourceId.setData(null); srcDatasourceId.setPlaceholder("${comparison_value}"); srcDatasourceId.setOptionSourceType(OptionSourceType.DATASOURCE_ID.getCode()); srcDatasourceId.setInputType(InputType.DEFAULT.getCode()); - srcDatasourceId.setValueType(ValueType.NUMBER.getCode()); + srcDatasourceId.setDataType(DataType.NUMBER.getCode()); srcConnectorType.setCreateTime(new Date()); srcConnectorType.setUpdateTime(new Date()); @@ -366,11 +366,11 @@ public class DataQualityTaskTest { srcDatabase.setType(FormType.CASCADER.getFormType()); srcDatabase.setCanEdit(true); srcDatabase.setIsShow(true); - srcDatabase.setValue(null); + srcDatabase.setData(null); srcDatabase.setPlaceholder("$t(src_database)"); srcDatabase.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcDatabase.setInputType(InputType.DEFAULT.getCode()); - srcDatabase.setValueType(ValueType.NUMBER.getCode()); + srcDatabase.setDataType(DataType.NUMBER.getCode()); srcDatabase.setCreateTime(new Date()); srcDatabase.setUpdateTime(new Date()); @@ -383,7 +383,7 @@ public class DataQualityTaskTest { srcTable.setPlaceholder("Please enter source table name"); srcTable.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcTable.setInputType(InputType.DEFAULT.getCode()); - srcTable.setValueType(ValueType.STRING.getCode()); + srcTable.setDataType(DataType.STRING.getCode()); srcConnectorType.setCreateTime(new Date()); srcConnectorType.setUpdateTime(new Date()); @@ -396,7 +396,7 @@ public class DataQualityTaskTest { srcFilter.setPlaceholder("Please enter source filter expression"); srcFilter.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcFilter.setInputType(InputType.DEFAULT.getCode()); - srcFilter.setValueType(ValueType.LIKE_SQL.getCode()); + srcFilter.setDataType(DataType.LIKE_SQL.getCode()); DqRuleInputEntry statisticsName = new DqRuleInputEntry(); statisticsName.setTitle("统计值名"); @@ -407,7 +407,7 @@ public class DataQualityTaskTest { statisticsName.setPlaceholder("Please enter statistics name, the alias in statistics execute sql"); statisticsName.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); statisticsName.setInputType(InputType.DEFAULT.getCode()); - statisticsName.setValueType(ValueType.STRING.getCode()); + statisticsName.setDataType(DataType.STRING.getCode()); DqRuleInputEntry statisticsExecuteSql = new DqRuleInputEntry(); statisticsExecuteSql.setTitle("统计值计算SQL"); @@ -417,7 +417,7 @@ public class DataQualityTaskTest { statisticsExecuteSql.setIsShow(true); statisticsExecuteSql.setPlaceholder("Please enter the statistics execute sql"); statisticsExecuteSql.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); - statisticsExecuteSql.setValueType(ValueType.LIKE_SQL.getCode()); + statisticsExecuteSql.setDataType(DataType.LIKE_SQL.getCode()); DqRuleInputEntry checkType = new DqRuleInputEntry(); checkType.setTitle("检测方式"); @@ -428,9 +428,9 @@ public class DataQualityTaskTest { checkType.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); checkType.setOptions("[{\"label\":\"比对值 - 统计值\",\"value\":\"0\"},{\"label\":\"统计值 - 比对值\",\"value\":\"1\"}," + "{\"label\":\"统计值 / 比对值\",\"value\":\"2\"},{\"label\":\"(比对值-统计值) / 比对值\",\"value\":\"3\"}]"); - checkType.setValue("0"); + checkType.setData("0"); checkType.setInputType(InputType.CHECK.getCode()); - checkType.setValueType(ValueType.STRING.getCode()); + checkType.setDataType(DataType.STRING.getCode()); checkType.setPlaceholder("检测类型"); DqRuleInputEntry operator = new DqRuleInputEntry(); @@ -444,9 +444,9 @@ public class DataQualityTaskTest { + "{\"label\":\"<\",\"value\":\"1\"},{\"label\":\"<=\",\"value\":\"2\"}," + "{\"label\":\">\",\"value\":\"3\"},{\"label\":\">=\",\"value\":\"4\"}," + "{\"label\":\"!=\",\"value\":\"5\"}]"); - operator.setValue("0"); + operator.setData("0"); operator.setInputType(InputType.CHECK.getCode()); - operator.setValueType(ValueType.STRING.getCode()); + operator.setDataType(DataType.STRING.getCode()); operator.setPlaceholder("操作符"); DqRuleInputEntry threshold = new DqRuleInputEntry(); @@ -457,7 +457,7 @@ public class DataQualityTaskTest { threshold.setIsShow(true); threshold.setPlaceholder("Please enter threshold value, number is needed"); threshold.setInputType(InputType.CHECK.getCode()); - threshold.setValueType(ValueType.NUMBER.getCode()); + threshold.setDataType(DataType.NUMBER.getCode()); DqRuleInputEntry afterFailure = new DqRuleInputEntry(); afterFailure.setTitle("失败策略"); @@ -467,9 +467,9 @@ public class DataQualityTaskTest { afterFailure.setIsShow(true); afterFailure.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); afterFailure.setOptions("[{\"label\":\"告警\",\"value\":\"0\"},{\"label\":\"阻断\",\"value\":\"1\"}]"); - afterFailure.setValue("0"); + afterFailure.setData("0"); afterFailure.setInputType(InputType.CHECK.getCode()); - afterFailure.setValueType(ValueType.STRING.getCode()); + afterFailure.setDataType(DataType.STRING.getCode()); afterFailure.setPlaceholder("失败策略"); defaultInputEntryList.add(checkType); @@ -589,12 +589,12 @@ public class DataQualityTaskTest { srcConnectorType.setType(FormType.SELECT.getFormType()); srcConnectorType.setCanEdit(true); srcConnectorType.setIsShow(true); - srcConnectorType.setValue(null); + srcConnectorType.setData(null); srcConnectorType.setPlaceholder("${src_connector_type}"); srcConnectorType.setOptionSourceType(OptionSourceType.DATASOURCE_TYPE.getCode()); srcConnectorType.setOptions(null); srcConnectorType.setInputType(InputType.DEFAULT.getCode()); - srcConnectorType.setValueType(ValueType.NUMBER.getCode()); + srcConnectorType.setDataType(DataType.NUMBER.getCode()); srcConnectorType.setCreateTime(new Date()); srcConnectorType.setUpdateTime(new Date()); @@ -604,11 +604,11 @@ public class DataQualityTaskTest { srcDatasourceId.setType(FormType.CASCADER.getFormType()); srcDatasourceId.setCanEdit(true); srcDatasourceId.setIsShow(true); - srcDatasourceId.setValue(null); + srcDatasourceId.setData(null); srcDatasourceId.setPlaceholder("${comparison_value}"); srcDatasourceId.setOptionSourceType(OptionSourceType.DATASOURCE_ID.getCode()); srcDatasourceId.setInputType(InputType.DEFAULT.getCode()); - srcDatasourceId.setValueType(ValueType.NUMBER.getCode()); + srcDatasourceId.setDataType(DataType.NUMBER.getCode()); srcConnectorType.setCreateTime(new Date()); srcConnectorType.setUpdateTime(new Date()); @@ -618,11 +618,11 @@ public class DataQualityTaskTest { srcDatabase.setType(FormType.CASCADER.getFormType()); srcDatabase.setCanEdit(true); srcDatabase.setIsShow(true); - srcDatabase.setValue(null); + srcDatabase.setData(null); srcDatasourceId.setPlaceholder("$t(src_database)"); srcDatabase.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcDatabase.setInputType(InputType.DEFAULT.getCode()); - srcDatabase.setValueType(ValueType.NUMBER.getCode()); + srcDatabase.setDataType(DataType.NUMBER.getCode()); srcDatabase.setCreateTime(new Date()); srcDatabase.setUpdateTime(new Date()); @@ -635,7 +635,7 @@ public class DataQualityTaskTest { srcTable.setPlaceholder("Please enter source table name"); srcTable.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcTable.setInputType(InputType.DEFAULT.getCode()); - srcTable.setValueType(ValueType.STRING.getCode()); + srcTable.setDataType(DataType.STRING.getCode()); srcConnectorType.setCreateTime(new Date()); srcConnectorType.setUpdateTime(new Date()); @@ -647,7 +647,7 @@ public class DataQualityTaskTest { statisticsName.setIsShow(true); statisticsName.setPlaceholder("Please enter statistics name, the alias in statistics execute sql"); statisticsName.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); - statisticsName.setValueType(ValueType.STRING.getCode()); + statisticsName.setDataType(DataType.STRING.getCode()); statisticsName.setInputType(InputType.DEFAULT.getCode()); DqRuleInputEntry statisticsExecuteSql = new DqRuleInputEntry(); @@ -658,7 +658,7 @@ public class DataQualityTaskTest { statisticsExecuteSql.setIsShow(true); statisticsExecuteSql.setPlaceholder("Please enter statistics execute sql"); statisticsExecuteSql.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); - statisticsExecuteSql.setValueType(ValueType.LIKE_SQL.getCode()); + statisticsExecuteSql.setDataType(DataType.LIKE_SQL.getCode()); statisticsExecuteSql.setInputType(InputType.DEFAULT.getCode()); DqRuleInputEntry targetConnectorType = new DqRuleInputEntry(); @@ -667,7 +667,7 @@ public class DataQualityTaskTest { targetConnectorType.setType(FormType.SELECT.getFormType()); targetConnectorType.setCanEdit(true); targetConnectorType.setIsShow(true); - targetConnectorType.setValue("JDBC"); + targetConnectorType.setData("JDBC"); targetConnectorType.setPlaceholder("Please select target connector type"); targetConnectorType.setOptionSourceType(OptionSourceType.DATASOURCE_TYPE.getCode()); targetConnectorType.setOptions(null); @@ -679,7 +679,7 @@ public class DataQualityTaskTest { targetDatasourceId.setType(FormType.SELECT.getFormType()); targetDatasourceId.setCanEdit(true); targetDatasourceId.setIsShow(true); - targetDatasourceId.setValue("1"); + targetDatasourceId.setData("1"); targetDatasourceId.setPlaceholder("Please select target datasource"); targetDatasourceId.setOptionSourceType(OptionSourceType.DATASOURCE_ID.getCode()); @@ -689,11 +689,11 @@ public class DataQualityTaskTest { targetDatabase.setType(FormType.CASCADER.getFormType()); targetDatabase.setCanEdit(true); targetDatabase.setIsShow(true); - targetDatabase.setValue(null); + targetDatabase.setData(null); targetDatabase.setPlaceholder("$t(src_database)"); targetDatabase.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); targetDatabase.setInputType(InputType.DEFAULT.getCode()); - targetDatabase.setValueType(ValueType.NUMBER.getCode()); + targetDatabase.setDataType(DataType.NUMBER.getCode()); targetDatabase.setCreateTime(new Date()); targetDatabase.setUpdateTime(new Date()); targetDatasourceId.setInputType(InputType.DEFAULT.getCode()); @@ -706,7 +706,7 @@ public class DataQualityTaskTest { targetTable.setIsShow(true); targetTable.setPlaceholder("Please enter target table"); targetTable.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); - targetTable.setValueType(ValueType.STRING.getCode()); + targetTable.setDataType(DataType.STRING.getCode()); targetTable.setInputType(InputType.DEFAULT.getCode()); DqRuleInputEntry comparisonName = new DqRuleInputEntry(); @@ -717,7 +717,7 @@ public class DataQualityTaskTest { comparisonName.setIsShow(true); comparisonName.setPlaceholder("Please enter comparison name, the alias in comparison execute sql"); comparisonName.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); - comparisonName.setValueType(ValueType.STRING.getCode()); + comparisonName.setDataType(DataType.STRING.getCode()); comparisonName.setInputType(InputType.DEFAULT.getCode()); DqRuleInputEntry comparisonExecuteSql = new DqRuleInputEntry(); @@ -728,7 +728,7 @@ public class DataQualityTaskTest { comparisonExecuteSql.setIsShow(true); comparisonExecuteSql.setPlaceholder("Please enter comparison execute sql"); comparisonExecuteSql.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); - comparisonExecuteSql.setValueType(ValueType.LIKE_SQL.getCode()); + comparisonExecuteSql.setDataType(DataType.LIKE_SQL.getCode()); comparisonExecuteSql.setInputType(InputType.DEFAULT.getCode()); DqRuleInputEntry checkType = new DqRuleInputEntry(); @@ -740,9 +740,9 @@ public class DataQualityTaskTest { checkType.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); checkType.setOptions("[{\"label\":\"比对值 - 统计值\",\"value\":\"0\"},{\"label\":\"统计值 - 比对值\",\"value\":\"1\"}," + "{\"label\":\"统计值 / 比对值\",\"value\":\"2\"},{\"label\":\"(比对值-统计值) / 比对值\",\"value\":\"3\"}]"); - checkType.setValue("0"); + checkType.setData("0"); checkType.setInputType(InputType.CHECK.getCode()); - checkType.setValueType(ValueType.STRING.getCode()); + checkType.setDataType(DataType.STRING.getCode()); checkType.setPlaceholder("检测类型"); DqRuleInputEntry operator = new DqRuleInputEntry(); @@ -756,9 +756,9 @@ public class DataQualityTaskTest { + "{\"label\":\"<\",\"value\":\"1\"},{\"label\":\"<=\",\"value\":\"2\"}," + "{\"label\":\">\",\"value\":\"3\"},{\"label\":\">=\",\"value\":\"4\"}," + "{\"label\":\"!=\",\"value\":\"5\"}]"); - operator.setValue("0"); + operator.setData("0"); operator.setInputType(InputType.CHECK.getCode()); - operator.setValueType(ValueType.STRING.getCode()); + operator.setDataType(DataType.STRING.getCode()); operator.setPlaceholder("操作符"); DqRuleInputEntry threshold = new DqRuleInputEntry(); @@ -768,7 +768,7 @@ public class DataQualityTaskTest { threshold.setCanEdit(true); threshold.setIsShow(true); threshold.setInputType(InputType.CHECK.getCode()); - threshold.setValueType(ValueType.NUMBER.getCode()); + threshold.setDataType(DataType.NUMBER.getCode()); threshold.setPlaceholder("Please enter threshold, number is needed"); DqRuleInputEntry afterFailure = new DqRuleInputEntry(); @@ -779,9 +779,9 @@ public class DataQualityTaskTest { afterFailure.setIsShow(true); afterFailure.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); afterFailure.setOptions("[{\"label\":\"告警\",\"value\":\"0\"},{\"label\":\"阻断\",\"value\":\"1\"}]"); - afterFailure.setValue("0"); + afterFailure.setData("0"); afterFailure.setInputType(InputType.CHECK.getCode()); - afterFailure.setValueType(ValueType.STRING.getCode()); + afterFailure.setDataType(DataType.STRING.getCode()); afterFailure.setPlaceholder("失败策略"); defaultInputEntryList.add(checkType); @@ -899,12 +899,12 @@ public class DataQualityTaskTest { srcConnectorType.setType(FormType.SELECT.getFormType()); srcConnectorType.setCanEdit(true); srcConnectorType.setIsShow(true); - srcConnectorType.setValue("JDBC"); + srcConnectorType.setData("JDBC"); srcConnectorType.setPlaceholder("Please select source connector type"); srcConnectorType.setOptionSourceType(OptionSourceType.DATASOURCE_TYPE.getCode()); srcConnectorType.setOptions(null); srcConnectorType.setInputType(InputType.DEFAULT.getCode()); - srcConnectorType.setValueType(ValueType.NUMBER.getCode()); + srcConnectorType.setDataType(DataType.NUMBER.getCode()); DqRuleInputEntry srcDatasourceId = new DqRuleInputEntry(); srcDatasourceId.setTitle("源数据源"); @@ -912,11 +912,11 @@ public class DataQualityTaskTest { srcDatasourceId.setType(FormType.SELECT.getFormType()); srcDatasourceId.setCanEdit(true); srcDatasourceId.setIsShow(true); - srcDatasourceId.setValue("1"); + srcDatasourceId.setData("1"); srcDatasourceId.setPlaceholder("Please select source datasource"); srcDatasourceId.setOptionSourceType(OptionSourceType.DATASOURCE_ID.getCode()); srcDatasourceId.setInputType(InputType.DEFAULT.getCode()); - srcDatasourceId.setValueType(ValueType.NUMBER.getCode()); + srcDatasourceId.setDataType(DataType.NUMBER.getCode()); DqRuleInputEntry srcTable = new DqRuleInputEntry(); srcTable.setTitle("源数据表"); @@ -927,7 +927,7 @@ public class DataQualityTaskTest { srcTable.setPlaceholder("Please enter source table"); srcTable.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcTable.setInputType(InputType.DEFAULT.getCode()); - srcTable.setValueType(ValueType.STRING.getCode()); + srcTable.setDataType(DataType.STRING.getCode()); DqRuleInputEntry srcFilter = new DqRuleInputEntry(); srcFilter.setTitle("源表过滤条件"); @@ -938,7 +938,7 @@ public class DataQualityTaskTest { srcFilter.setPlaceholder("Please enter source filter expression"); srcFilter.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); srcFilter.setInputType(InputType.DEFAULT.getCode()); - srcFilter.setValueType(ValueType.LIKE_SQL.getCode()); + srcFilter.setDataType(DataType.LIKE_SQL.getCode()); DqRuleInputEntry targetConnectorType = new DqRuleInputEntry(); targetConnectorType.setTitle("目标数据类型"); @@ -946,12 +946,12 @@ public class DataQualityTaskTest { targetConnectorType.setType(FormType.SELECT.getFormType()); targetConnectorType.setCanEdit(true); targetConnectorType.setIsShow(true); - targetConnectorType.setValue("JDBC"); + targetConnectorType.setData("JDBC"); targetConnectorType.setPlaceholder("Please select target connector type"); targetConnectorType.setOptionSourceType(OptionSourceType.DATASOURCE_TYPE.getCode()); targetConnectorType.setOptions(null); targetConnectorType.setInputType(InputType.DEFAULT.getCode()); - targetConnectorType.setValueType(ValueType.STRING.getCode()); + targetConnectorType.setDataType(DataType.STRING.getCode()); DqRuleInputEntry targetDatasourceId = new DqRuleInputEntry(); targetDatasourceId.setTitle("目标数据源"); @@ -959,11 +959,11 @@ public class DataQualityTaskTest { targetDatasourceId.setType(FormType.CASCADER.getFormType()); targetDatasourceId.setCanEdit(true); targetDatasourceId.setIsShow(true); - targetDatasourceId.setValue("1"); + targetDatasourceId.setData("1"); targetDatasourceId.setPlaceholder("Please select target datasource"); targetDatasourceId.setOptionSourceType(OptionSourceType.DATASOURCE_ID.getCode()); targetDatasourceId.setInputType(InputType.DEFAULT.getCode()); - targetDatasourceId.setValueType(ValueType.NUMBER.getCode()); + targetDatasourceId.setDataType(DataType.NUMBER.getCode()); DqRuleInputEntry targetTable = new DqRuleInputEntry(); targetTable.setTitle("目标数据表"); @@ -974,7 +974,7 @@ public class DataQualityTaskTest { targetTable.setPlaceholder("Please enter target table"); targetTable.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); targetTable.setInputType(InputType.DEFAULT.getCode()); - targetTable.setValueType(ValueType.STRING.getCode()); + targetTable.setDataType(DataType.STRING.getCode()); DqRuleInputEntry targetFilter = new DqRuleInputEntry(); targetFilter.setTitle("目标表过滤条件"); @@ -985,7 +985,7 @@ public class DataQualityTaskTest { targetFilter.setPlaceholder("Please enter target filter expression"); targetFilter.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); targetFilter.setInputType(InputType.DEFAULT.getCode()); - targetFilter.setValueType(ValueType.LIKE_SQL.getCode()); + targetFilter.setDataType(DataType.LIKE_SQL.getCode()); DqRuleInputEntry mappingColumns = new DqRuleInputEntry(); mappingColumns.setTitle("检查列"); @@ -996,7 +996,7 @@ public class DataQualityTaskTest { mappingColumns.setPlaceholder("${mapping_columns}"); mappingColumns.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); mappingColumns.setInputType(InputType.DEFAULT.getCode()); - mappingColumns.setValueType(ValueType.LIST.getCode()); + mappingColumns.setDataType(DataType.LIST.getCode()); DqRuleInputEntry statisticsName = new DqRuleInputEntry(); statisticsName.setTitle("统计值"); @@ -1004,11 +1004,11 @@ public class DataQualityTaskTest { statisticsName.setType(FormType.INPUT.getFormType()); statisticsName.setCanEdit(false); statisticsName.setIsShow(false); - statisticsName.setValue("miss_count.miss"); + statisticsName.setData("miss_count.miss"); statisticsName.setPlaceholder("${statistics_name}"); statisticsName.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); statisticsName.setInputType(InputType.DEFAULT.getCode()); - statisticsName.setValueType(ValueType.STRING.getCode()); + statisticsName.setDataType(DataType.STRING.getCode()); defaultInputEntryList.add(srcConnectorType); defaultInputEntryList.add(srcDatasourceId); @@ -1049,7 +1049,7 @@ public class DataQualityTaskTest { comparisonTitle.setCanEdit(false); comparisonTitle.setIsShow(true); comparisonTitle.setPlaceholder("${comparison_title}"); - comparisonTitle.setValue("目标表总行数"); + comparisonTitle.setData("目标表总行数"); DqRuleInputEntry comparisonName = new DqRuleInputEntry(); comparisonName.setTitle("比对值名"); @@ -1057,12 +1057,12 @@ public class DataQualityTaskTest { comparisonName.setType(FormType.INPUT.getFormType()); comparisonName.setCanEdit(false); comparisonName.setIsShow(false); - comparisonName.setValue("total_count.total"); + comparisonName.setData("total_count.total"); comparisonName.setPlaceholder("${comparison_name}"); DqRuleInputEntry comparisonTable = new DqRuleInputEntry(); comparisonTable.setField(COMPARISON_TABLE); - comparisonTable.setValue("total_count"); + comparisonTable.setData("total_count"); DqRuleInputEntry checkType = new DqRuleInputEntry(); checkType.setTitle("检测方式"); @@ -1074,9 +1074,9 @@ public class DataQualityTaskTest { checkType.setOptions( "[{\"label\":\"比对值 - 统计值\",\"value\":\"0\"},{\"label\":\"统计值 - 比对值\",\"value\":\"1\"},{\"label\":\"统计值 / 比对值\"," + "\"value\":\"2\"},{\"label\":\"(比对值-统计值) / 比对值\",\"value\":\"3\"}]"); - checkType.setValue("0"); + checkType.setData("0"); checkType.setInputType(InputType.CHECK.getCode()); - checkType.setValueType(ValueType.STRING.getCode()); + checkType.setDataType(DataType.STRING.getCode()); checkType.setPlaceholder("检测类型"); DqRuleInputEntry operator = new DqRuleInputEntry(); @@ -1089,9 +1089,9 @@ public class DataQualityTaskTest { operator.setOptions("[{\"label\":\"=\",\"value\":\"0\"}," + "{\"label\":\"<\",\"value\":\"1\"},{\"label\":\"<=\",\"value\":\"2\"}," + "{\"label\":\">\",\"value\":\"3\"},{\"label\":\">=\",\"value\":\"4\"},{\"label\":\"!=\",\"value\":\"5\"}]"); - operator.setValue("0"); + operator.setData("0"); operator.setInputType(InputType.CHECK.getCode()); - operator.setValueType(ValueType.STRING.getCode()); + operator.setDataType(DataType.STRING.getCode()); operator.setPlaceholder("操作符"); DqRuleInputEntry threshold = new DqRuleInputEntry(); @@ -1101,7 +1101,7 @@ public class DataQualityTaskTest { threshold.setCanEdit(true); threshold.setIsShow(true); threshold.setInputType(InputType.CHECK.getCode()); - threshold.setValueType(ValueType.NUMBER.getCode()); + threshold.setDataType(DataType.NUMBER.getCode()); threshold.setPlaceholder("Please enter threshold, number is needed"); DqRuleInputEntry afterFailure = new DqRuleInputEntry(); @@ -1112,9 +1112,9 @@ public class DataQualityTaskTest { afterFailure.setIsShow(true); afterFailure.setOptionSourceType(OptionSourceType.DEFAULT.getCode()); afterFailure.setOptions("[{\"label\":\"告警\",\"value\":\"0\"},{\"label\":\"阻断\",\"value\":\"1\"}]"); - afterFailure.setValue("0"); + afterFailure.setData("0"); afterFailure.setInputType(InputType.CHECK.getCode()); - afterFailure.setValueType(ValueType.STRING.getCode()); + afterFailure.setDataType(DataType.STRING.getCode()); afterFailure.setPlaceholder("失败策略"); defaultInputEntryList.add(checkType);