Browse Source

fix issue 13035 (#13065)

Co-authored-by: shenk-b <shenk-b@glodon.com>
3.2.0-release
Kevin.Shin 2 years ago committed by GitHub
parent
commit
12a6138d33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/DataQualityResultOperator.java

16
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/utils/DataQualityResultOperator.java

@ -94,7 +94,7 @@ public class DataQualityResultOperator {
private void checkDqExecuteResult(TaskEvent taskResponseEvent,
DqExecuteResult dqExecuteResult,
ProcessInstance processInstance) {
if (isFailure(dqExecuteResult)) {
if (isFailed(dqExecuteResult)) {
DqFailureStrategy dqFailureStrategy = DqFailureStrategy.of(dqExecuteResult.getFailureStrategy());
if (dqFailureStrategy != null) {
dqExecuteResult.setState(DqTaskState.FAILURE.getCode());
@ -123,7 +123,7 @@ public class DataQualityResultOperator {
* @param dqExecuteResult
* @return
*/
private boolean isFailure(DqExecuteResult dqExecuteResult) {
private boolean isFailed(DqExecuteResult dqExecuteResult) {
CheckType checkType = CheckType.of(dqExecuteResult.getCheckType());
double statisticsValue = dqExecuteResult.getStatisticsValue();
@ -132,36 +132,36 @@ public class DataQualityResultOperator {
OperatorType operatorType = OperatorType.of(dqExecuteResult.getOperator());
boolean isFailure = false;
boolean isFailed = false;
if (operatorType != null) {
double srcValue = 0;
switch (checkType) {
case COMPARISON_MINUS_STATISTICS:
srcValue = comparisonValue - statisticsValue;
isFailure = getCompareResult(operatorType, srcValue, threshold);
isFailed = !getCompareResult(operatorType, srcValue, threshold);
break;
case STATISTICS_MINUS_COMPARISON:
srcValue = statisticsValue - comparisonValue;
isFailure = getCompareResult(operatorType, srcValue, threshold);
isFailed = !getCompareResult(operatorType, srcValue, threshold);
break;
case STATISTICS_COMPARISON_PERCENTAGE:
if (comparisonValue > 0) {
srcValue = statisticsValue / comparisonValue * 100;
}
isFailure = getCompareResult(operatorType, srcValue, threshold);
isFailed = !getCompareResult(operatorType, srcValue, threshold);
break;
case STATISTICS_COMPARISON_DIFFERENCE_COMPARISON_PERCENTAGE:
if (comparisonValue > 0) {
srcValue = Math.abs(comparisonValue - statisticsValue) / comparisonValue * 100;
}
isFailure = getCompareResult(operatorType, srcValue, threshold);
isFailed = !getCompareResult(operatorType, srcValue, threshold);
break;
default:
break;
}
}
return isFailure;
return isFailed;
}
private void sendDqTaskResultAlert(DqExecuteResult dqExecuteResult, ProcessInstance processInstance) {

Loading…
Cancel
Save