DataWorks provides AnalyticDB for MySQL nodes that you can use to develop and periodically schedule AnalyticDB for MySQL tasks and integrate the tasks with other types of tasks. This topic describes how to use an AnalyticDB for MySQL node to develop tasks.
Prerequisites
(Required if you use a RAM user to develop tasks) The desired RAM user is added to your DataWorks workspace as a member and is assigned the Development or Workspace Administrator role. The Workspace Administrator role has extensive permissions. We recommend that you assign the Workspace Administrator role to a user only when necessary. For more information about how to add a member, see Add workspace members and assign roles to them.
NoteIf you use an Alibaba Cloud account, ignore this prerequisite.
An AnalyticDB for MySQL 3.0 computing resource has been associated with the workspace.
An AnalyticDB for MySQL node is created. For more information, see the Create auto triggered tasks section in the "Node development" topic.
Limits
You cannot separately use a SET statement in the code of an AnalyticDB for MySQL node. They must be executed with other SQL statements.
Background information
AnalyticDB for MySQL is an analytical database of Alibaba Cloud. For more information, see What is AnalyticDB for MySQL?
Procedure
On the configuration tab of the AnalyticDB for MySQL node, perform the following operations to develop a task:
Develop SQL code
In the code editor, develop node code. You can define variables in the ${Variable} format in the node code and configure the scheduling parameters that are assigned to the variables as values in the Scheduling Parameters section of the Properties tab. This way, the values of the scheduling parameters are dynamically replaced in the node code when the node is scheduled to run. For more information about how to use scheduling parameters, see Supported formats of scheduling parameters. Sample code:
SHOW ${var};NoteIn the sample code, you can set ${var} to the
TABLESfield.Run the task
On the Debugging Configurations tab, configure the Computing Resource parameter in the Computing Resource section and configure the Resource Group parameter in the DataWorks Configurations section.
Select the name of the AnalyticDB for MySQL V3.0 computing resource that you registered in DataWorks from the Computing Resource drop-down list.
Select a resource group for scheduling that is connected to the computing resource from the Resource Group drop-down list. For more information, see Network connectivity solutions.
In the upper part of the code editor, click the Select DataSource drop-down list. In the popover that appears, select the created AnalyticDB for MySQL V3.0 computing resource and click Run in the top toolbar to run the node.
If you want to run the node on a regular basis, configure the scheduling information based on your business requirements. For more information, see Node scheduling.
After the node is configured, deploy the node. For more information, see Deploy a node or a workflow.
After you deploy the node, view the running status of the node in Operation Center. For more information, see Getting started with Operation Center.