You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by zh...@apache.org on 2022/12/28 06:21:47 UTC

[dolphinscheduler] 02/11: [Bug] wrong logic when master-server check data-quality result (#13065)

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

zhongjiajie pushed a commit to branch 3.0.4-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git

commit 82ea78aa83be958268b734e3f61ddf1c5db83d09
Author: Kevin.Shin <ma...@163.com>
AuthorDate: Thu Dec 1 13:58:50 2022 +0800

    [Bug] wrong logic when master-server check data-quality result (#13065)
    
    Co-authored-by: shenk-b <sh...@glodon.com>
    
    (cherry picked from commit 12a6138d3343a489069ddf98c48f61957801b167)
---
 .../server/utils/DataQualityResultOperator.java          | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/utils/DataQualityResultOperator.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/utils/DataQualityResultOperator.java
index d172228b36..e94d6f1422 100644
--- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/utils/DataQualityResultOperator.java
+++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/utils/DataQualityResultOperator.java
@@ -95,7 +95,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());
@@ -124,7 +124,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();
@@ -133,36 +133,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) {