Checkpoint Validation for Offline Data Transformation
This topic describes checkpoint validation performed on data from offline business systems during the data generation process.
Code Commit Checkpoint Validation
Code commit checkpoint validation involves manually or automatically scanning your SQL code at submission time to verify its logic. Validation rules fall into the following categories:
Code convention rules.
Examples include table naming conventions, lifecycle settings, and table comments.
Code quality rules.
Examples include warnings for division by zero, NULL values affecting calculation results, and incorrect field order in INSERT statements.
Code performance rules.
Examples include failed partition pruning, warnings for scanning large tables, and detection of redundant computations.
When using the Data Development feature in DataWorks, syntax errors in your code trigger red wavy underlines. In the following ODPS SQL script, line 6 contains a syntax error in the insert select overwrite table statement:
--odps sql
--*********************************************************************--
--author:xxx xxx
--create time:2019-07-02 17:32:09
--*********************************************************************--
insert select overwrite table ods_user_trace_log partition (dt=${bdp.system.bizdate})
select
md5,
uid ,
ts,
ip,
status,
bytes,
device,
system,
customize_event,
use_time,
customize_event_content
from ots_user_trace_log
where to_char(FROM_UNIXTIME(ts),'yyyymmdd')=${bdp.system.bizdate};Task Publishing Checkpoint Validation
To ensure data accuracy in production, every change must undergo testing before being published to the production environment. The publishing process is only considered successful after tests pass in the production environment.
Pre-publishing tests include code review and regression testing. For applications with high asset levels—such as the A2-level application used in this tutorial—you must complete regression testing before publishing any task.
Perform regression testing by simulating the real environment as closely as possible:
For standard mode projects, use SQL statements to copy data from the production environment to the development environment, run the workflow, and monitor for errors.
For basic mode projects, run the workflow directly and monitor for errors.
Because this tutorial uses basic mode, submit and run the workflow directly. All four nodes—start, ods_user_trace_log, dw_user_trace_log, and rpt_user_trace_log—run successfully with no errors.
After the run completes, if all nodes display a green icon, the workflow passes testing.
Task Changes
Before performing an update, notify downstream stakeholders about the reason for the change, the modified logic, and the scheduled change time. Only execute the change at the agreed-upon time after confirming that downstream stakeholders have no objections. This minimizes the impact of the change on downstream systems.
For example, if the table schema of the Tablestore data source changes in this tutorial, notify the owners of the ots_user_trace_log, ods_user_trace_log, dw_user_trace_log, and rpt_user_trace_log tables so they can update their table schemas promptly.