You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/03/03 10:49:32 UTC

[GitHub] [dolphinscheduler] caishunfeng commented on a change in pull request #8684: [Fix-8616][WorkFlowLineage] work flow lineage search result missing data

caishunfeng commented on a change in pull request #8684:
URL: https://github.com/apache/dolphinscheduler/pull/8684#discussion_r818533278



##########
File path: dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/WorkFlowLineageMapper.xml
##########
@@ -89,6 +109,43 @@
                 and process_definition_code = #{processDefinitionCode}
     </select>
 
+    <select id="queryUpstreamDependentParamsByProcessDefinitionCode"
+            resultType="org.apache.dolphinscheduler.dao.entity.DependentProcessDefinition">
+        SELECT
+            DISTINCT c.task_params
+        FROM
+        t_ds_process_definition a
+        JOIN t_ds_process_task_relation b ON a.code = b.process_definition_code AND a.version = b.process_definition_version AND a.project_code = b.project_code
+        JOIN t_ds_task_definition c ON c.code = b.pre_task_code and c.version = b.pre_task_version
+        WHERE 1=1
+        AND a.code = #{code}
+        AND c.task_type = 'DEPENDENT'

Review comment:
       ```suggestion
           AND c.task_type = #{taskType}
   ```

##########
File path: dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/WorkFlowLineageMapper.xml
##########
@@ -42,6 +42,26 @@
         where tepd.project_code = #{projectCode} and tepd.code = #{workFlowCode}
     </select>
 
+    <select id="queryWorkFlowLineageByProcessDefinitionCodes" resultType="org.apache.dolphinscheduler.dao.entity.WorkFlowLineage">
+        select tepd.code as work_flow_code,
+               tepd.name as work_flow_name,
+               '' as source_work_flow_code,

Review comment:
       can it remove?

##########
File path: dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/WorkFlowLineageMapper.xml
##########
@@ -89,6 +109,43 @@
                 and process_definition_code = #{processDefinitionCode}
     </select>
 
+    <select id="queryUpstreamDependentParamsByProcessDefinitionCode"
+            resultType="org.apache.dolphinscheduler.dao.entity.DependentProcessDefinition">
+        SELECT
+            DISTINCT c.task_params
+        FROM
+        t_ds_process_definition a
+        JOIN t_ds_process_task_relation b ON a.code = b.process_definition_code AND a.version = b.process_definition_version AND a.project_code = b.project_code
+        JOIN t_ds_task_definition c ON c.code = b.pre_task_code and c.version = b.pre_task_version
+        WHERE 1=1
+        AND a.code = #{code}
+        AND c.task_type = 'DEPENDENT'
+        ;
+    </select>
+
+    <select id="queryDownstreamLineageByProcessDefinitionCode"
+            resultType="org.apache.dolphinscheduler.dao.entity.WorkFlowLineage">
+        SELECT
+            c.code AS work_flow_code
+            ,c.name AS work_flow_name
+            ,c.release_state AS work_flow_publish_status
+            ,d.start_time AS schedule_start_time
+            ,d.end_time AS schedule_end_time
+            ,d.crontab AS crontab
+            ,d.release_state AS schedule_publish_status
+            ,'' AS source_work_flow_code
+        FROM
+        t_ds_task_definition a
+        JOIN t_ds_process_task_relation b ON a.code	= b.pre_task_code and a.version = b.pre_task_version
+        JOIN t_ds_process_definition c ON c.code = b.process_definition_code AND c.version = b.process_definition_version AND c.project_code = b.project_code
+        LEFT JOIN t_ds_schedules d ON d.process_definition_code = c.code

Review comment:
       Can it be handled separately?

##########
File path: dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/WorkFlowLineageMapper.xml
##########
@@ -89,6 +109,43 @@
                 and process_definition_code = #{processDefinitionCode}
     </select>
 
+    <select id="queryUpstreamDependentParamsByProcessDefinitionCode"
+            resultType="org.apache.dolphinscheduler.dao.entity.DependentProcessDefinition">
+        SELECT
+            DISTINCT c.task_params
+        FROM
+        t_ds_process_definition a
+        JOIN t_ds_process_task_relation b ON a.code = b.process_definition_code AND a.version = b.process_definition_version AND a.project_code = b.project_code
+        JOIN t_ds_task_definition c ON c.code = b.pre_task_code and c.version = b.pre_task_version
+        WHERE 1=1
+        AND a.code = #{code}
+        AND c.task_type = 'DEPENDENT'
+        ;
+    </select>
+
+    <select id="queryDownstreamLineageByProcessDefinitionCode"
+            resultType="org.apache.dolphinscheduler.dao.entity.WorkFlowLineage">
+        SELECT
+            c.code AS work_flow_code
+            ,c.name AS work_flow_name
+            ,c.release_state AS work_flow_publish_status
+            ,d.start_time AS schedule_start_time
+            ,d.end_time AS schedule_end_time
+            ,d.crontab AS crontab
+            ,d.release_state AS schedule_publish_status
+            ,'' AS source_work_flow_code
+        FROM
+        t_ds_task_definition a
+        JOIN t_ds_process_task_relation b ON a.code	= b.pre_task_code and a.version = b.pre_task_version
+        JOIN t_ds_process_definition c ON c.code = b.process_definition_code AND c.version = b.process_definition_version AND c.project_code = b.project_code
+        LEFT JOIN t_ds_schedules d ON d.process_definition_code = c.code
+        WHERE 1=1
+        <if test="code != null and code != ''">
+            AND a.task_params LIKE concat('%', #{code}, '%')
+        </if>
+        AND a.task_type = 'DEPENDENT'

Review comment:
       ```suggestion
           AND a.task_type = #{taskType}
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org