이 페이지에서는 작업 종속 방향성 비순환 그래프(DAG)가 여러 DAG에서 cron 예약을 사용하는 대신 단일 DAG 내의 SQL 테이블 노드 간에 작업 종속 항목을 지정하도록 하는 단계를 간략히 설명합니다. 맞춤설정 가능한 설정은 서로 종속되는 여러 테이블 새로고침 노드가 있는 Cloud Composer DAG를 생성하는 데 사용됩니다.
Cortex Framework는 작업 종속 SAP DAG (ECC 및 S/4HANA)에 권장 설정을 제공합니다. 하지만 이를 추가로 맞춤설정하거나 데이터 소스에 대해 작업 종속 DAG를 정의할 수 있습니다.
작업 종속 DAG 사용 설정
enableTaskDependencies 필드를 True로 설정하여 config.json 파일을 수정합니다. 이 설정은 접미사가 _task_dep.yaml인 작업 종속 보고 설정 파일에 대한 Cortex Framework의 검색을 활성화합니다.
작업 종속 항목이 필요한 각 데이터 소스에 접미사 _task_dep.yaml가 있는 전용 보고 설정 파일을 만듭니다. 자세한 내용은 작업 종속 보고 설정 정의를 참고하세요.
table 유형 노드에 table_setting.dag_setting를 새 섹션으로 추가하여 작업 종속 항목을 맞춤설정합니다.
자세한 내용은 작업 종속 항목 지정 및 맞춤설정을 참고하세요.
타겟 버킷의 dags/data_source/reporting/task_dep_dags/dag_name에 있는 생성된 파일을 검사합니다. 이 폴더에는 Cloud Composer DAG를 정의하는 Python 파일과 DAG 내 각 테이블 노드의 새로고침 쿼리가 포함된 SQL 파일이 포함됩니다.
파일을 Cloud Composer DAG 버킷에 복사하여 표준 빌드 프로세스를 사용하여 Cortex Framework를 배포합니다.
태스크 종속 보고 설정 정의
태스크 종속 항목이 필요한 각 데이터 소스의 경우 Cortex Framework는 접미사가 _task_dep.yaml인 태스크 종속 보고 설정 파일을 예상합니다.
이러한 파일을 만들고 업데이트할 때는 다음 사항을 고려하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Task dependent DAGs\n===================\n\nThis page outlines the steps to enable task dependent Directed Acyclic Graphs\n(DAGs) to specify task dependencies\nbetween SQL table nodes within a single DAG, rather than relying on cron\nscheduling across multiple DAGs. Customizable settings are used to generate\nCloud Composer DAGs with multiple table refresh nodes that depend on each other.\nCortex Framework provides recommended settings for task dependent\n[SAP DAGs (ECC and S/4HANA)](/cortex/docs/operational-sap). However, you can\ncustomize them further or define task dependent DAGs for any\n[data sources](/cortex/docs/data-sources-and-workloads).\n\nEnable task dependent DAGs\n--------------------------\n\n1. Modify the [*config.json*](https://github.com/GoogleCloudPlatform/cortex-data-foundation/blob/main/config/config.json) file by setting the `enableTaskDependencies` field to `True`. This setting activates the Cortex Framework's search for task-dependent reporting settings files with the suffix `_task_dep.yaml`.\n2. Create a dedicated reporting settings file with the suffix `_task_dep.yaml` for each data source requiring task dependencies. For more details, see [Define task-dependent reporting settings](/cortex/docs/optional-step-task-dependent-dags#define_task-dependent_reporting_settings).\n3. Customize the task dependencies by adding `table_setting.dag_setting` as a new section to `table` type nodes. For more details, see [Specify and customize task dependencies](/cortex/docs/optional-step-task-dependent-dags#specify_and_customize_task_dependencies).\n4. Build Cortex Framework using the [standard build process](/cortex/docs/deployment-step-six#Cloud%20Composer).\n5. Examine the generated files that are located in the target bucket under `dags/`\u003cvar translate=\"no\"\u003edata_source\u003c/var\u003e`/reporting/task_dep_dags/`\u003cvar translate=\"no\"\u003edag_name\u003c/var\u003e. This folder will contain a Python file defining the Cloud Composer DAG and a SQL file with the refresh query for each table node within the DAG.\n6. Copy the files to the Cloud Composer DAG bucket to deploy Cortex Framework using the [standard build process](/cortex/docs/deployment-step-six#Cloud%20Composer).\n\nDefine task-dependent reporting settings\n----------------------------------------\n\nFor each data source requiring task dependencies, Cortex Framework\nexpects task-dependent reporting settings files with the suffix `_task_dep.yaml`.\nWhen creating and updating these files, consider the following:\n\n- For SAP you may customize and use the provided setting files [`reporting_settings_ecc_task_dep.yaml`](https://github.com/GoogleCloudPlatform/cortex-data-foundation/blob/main/src/SAP/SAP_REPORTING/reporting_settings_ecc_task_dep.yaml) and [`reporting_settings_s4_task_dep.yaml`](https://github.com/GoogleCloudPlatform/cortex-data-foundation/blob/main/src/SAP/SAP_REPORTING/reporting_settings_s4_task_dep.yaml).\n- For other data sources, create your own task-dependent reporting settings alongside the original, for example: `reporting_settings_task_dep.yaml.`\n\n| **Note:** These settings are distinct from the standard `reporting_settings.yaml` files so they can be enabled and deployed independently. If a data source lacks a `reporting_settings_task_dep.yaml` file, it will use the regular `reporting_settings.yaml` file without task dependencies regardless of the `enableTaskDependencies` value in *config.json* .\n\nFor more information about the fields available within reporting settings\nfiles, see [dag_types.py](https://github.com/GoogleCloudPlatform/cortex-data-foundation/tree/main/src/common/materializer/dag_types.py).\n\nSpecify and customize task dependencies\n---------------------------------------\n\nCustomize the task dependencies by adding\n`table_setting.dag_setting` as a new section to `table` type nodes: \n\n - sql_file: dependent_table2.sql\n type: table\n table_setting:\n dag_setting:\n name: \"dag1\"\n parents: [\"dependent_table1.sql\"]\n\n- DAG settings include two fields:\n\n - `name`: A required string for **all nodes in a task dependent DAG** that designates the name of the DAG to which the table node belongs. This includes top level nodes which are referenced as a *parent* by other nodes within the DAG.\n - `parents`: An optional list of strings containing the `sql_file` path of other table nodes within the same DAG. These parents must run successfully before the node is triggered.\n\n**Additional considerations**:\n\n- Nodes without defined parents are considered top level nodes and will run at the start of the DAG.\n- At least one top level node must have `table_setting.load_frequency` defined, which will be used as the DAG schedule.\n- If multiple top level nodes have defined `load_frequency`, they must be the same.\n- Child nodes that have `parents` defined can't define `load_frequency`.\n- Nodes that don't have `dag_setting` defined will be generated the same as before as a DAG with a single table refresh node and no task dependencies.\n- Other node types like views and scripts can't be included in task dependent DAGs, which only generate nodes with DML to refresh tables."]]