An SQL script template is a reusable SQL code block with multiple input and output parameters. It processes data and generates a result table by filtering, joining, and aggregating data from source tables. You can create SQL Script Template nodes in Data Studio and use these templates to quickly build data processing nodes, improving development efficiency. This topic describes how to reference and use SQL script templates.
Usage notes
Editions: This feature is available only in DataWorks Standard Edition or later.
Permissions: You must have the Development role in a DataWorks workspace to create and use components. For more information, see Manage permissions on workspace-level services.
Prerequisites
-
A MaxCompute computing resource must be bound to the DataWorks workspace.
The required SQL script template is prepared. For more information, see Script template management.
An SQL Script Template node is created. For more information, see Create a node for a scheduled workflow.
Procedure
On the editing page of the SQL Script Template node, perform the following operations.
Reference a script template
In the right-side pane, click the Component Settings tab. In the Reference Settings section, select an SQL Script Template.
NoteTo update the referenced template to the latest version, click Update Code below the SQL Script Template field.
Click Edit Snippet to view the details of the referenced SQL script template.
After you select the component code, you can assign values to the automatically identified parameters in the Enter a parameter value. dialog box.
Run the node task
On the Run Configuration tab, in the Compute Resource section, configure the Compute Resource and Compute Quota and Resource Group.
NoteTo access data sources in the public network or VPC network environment, use a resource group for scheduling that has passed the connectivity test with the data source. For more information, see Network connectivity solutions.
On the toolbar, click Run to run the node task.
To run the node task on a periodic basis, configure the schedule settings based on your business requirements. For more information, see Configure node scheduling.
After the node task is configured, you must deploy the node. For more information, see Node and workflow deployment.
After the task is deployed, you can view the running status of the scheduled task in Operation Center. For more information, see Get started with operation center.