Confirm the lineage of a table
Before you configure upstream and downstream dependencies for a task, you must confirm the table lineage of the current node, such as the lineage between table data and the partition data that a table produces, and then configure scheduling dependencies based on the lineage. This topic describes how to confirm table lineage, and the impacts of configuring node dependencies without considering table lineage.
Background information
The following table describes how to confirm table lineage and the impacts of configuring node dependencies without considering table lineage.
Category | Description |
Dependency on table data in the same workspace: based on the parameter configurations of the upstream and downstream nodes and the parameter replacement results of the instances, confirm the partition data that the upstream table produces each day. | |
Dependency on table data across workspaces: based on the output information in Data Map, confirm the partition data that the upstream table produces each day. | |
Impacts of configuring node dependencies without considering table lineage | A lineage dependency exists, but no node dependency is configured. As a result, errors occur when downstream nodes obtain data. |
A lineage dependency exists and a node dependency is configured, but the dependency time is incorrect. As a result, errors occur when downstream nodes obtain data. |
Usage notes
In DataWorks, the table partitions that a node reads or produces are both determined by scheduling parameters. If the partition value that an upstream node produces does not match the partition on which a downstream node depends, consider your business requirements and determine whether to modify the scheduling parameter configurations of the node, so that the partitions the node produces match the partitions on which the node depends.
To depend on the partition data that an upstream node produced in the previous cycle, configure a cross-cycle dependency, that is, the current node depends on the upstream node in the previous cycle.
For partitioned tables, make sure that the partitions produced by the upstream node are the partition data on which the downstream node needs to depend.
Confirm the lineage of a table
Confirm the lineage of an upstream table in the same workspace
A node periodically writes data to a partition of a table, which is implemented dynamically by using scheduling parameters in most cases. For more information about how scheduling parameters are replaced, see Scheduling parameters. If you need to depend on a node in the same workspace, check the scheduling parameter configurations of the node.
Open the configuration tab of the upstream node to view the scheduling parameter configurations and code details of the node.
View the runtime properties of the Batch Synchronization node and the ODPS SQL node separately, and verify that the execution parameters of both tasks are
bizdate=20241028and that both tasks have run successfully.
Confirm the lineage of an upstream table across workspaces
If you need to depend on a node in another workspace, use Data Map to check how the table data is written each day. For example, check whether the table partition that the upstream node writes each day is dated the previous day or the current day.
On the table details page in Data Map, click the Change History tab and use the Change Type drop-down list to filter partition write or delete records, which contain information such as the change content, change time, and operating account. For example, the change history may show that the partition dt=20250312 was deleted by a system account on March 20, 2025.
Impacts of configuring node dependencies without considering table lineage
Scenario 1: A strong lineage dependency exists but no node dependency is configured, which causes errors when downstream nodes obtain data
If the code of the current node Job_B reads data from Table A, but the node Job_A that produces the data of Table A is not configured as an upstream node of the current node, the current node may start to run before the data of Table A is produced. As a result, the table data produced by the Job_B node may be invalid.
Although the scheduled time of the Job_A node is earlier than that of the Job_B node, if the Job_A node cannot finish producing data before 02:00, errors occur when the Job_B node obtains data. The Job_A node may fail to produce data at its scheduled time of 01:00 for the following reasons:
An upstream node of the Job_A node fails to run or runs more slowly than expected.
The Job_A node or its upstream nodes are waiting for resources.
An upstream node of the Job_A node is frozen on a specific day.
Scenario 2: A scheduling dependency is configured, but the parameter configurations cause a downstream node to read data from an upstream table before the upstream table produces the data
If a same-cycle dependency is configured, the partitions of the table produced by the upstream node may not match the partitions that the downstream node reads. This may cause data quality issues when the downstream node obtains data, or cause the downstream task to report errors. The following figure shows an example.
When a MaxCompute node uses the max_pt function, make sure that the upstream table produces data as expected each day.