AnalyticDB for MySQL node

更新时间:
复制 MD 格式

You can use an AnalyticDB for MySQL node in DataWorks to develop and periodically schedule tasks, and integrate them with other jobs in a workflow. This topic describes how to use this node to develop tasks.

Prerequisites

  • A RAM user for task development is added to the workspace and assigned the Development or Workspace Administrator role. The Workspace Administrator role grants extensive permissions, use caution when assigning it. For more information, see Add members to a workspace.

    Note

    If you use an Alibaba Cloud account, you can skip this step.

  • An AnalyticDB for MySQL 3.0 computing resource is bound to the workspace.

  • An AnalyticDB for MySQL node is created. For more information, see Create a node for a workflow.

Limitations

In an AnalyticDB for MySQL node, SET statements cannot be run independently. They must be run together with a specific SQL statement.

Background

AnalyticDB for MySQL is an analytical database service from Alibaba Cloud. For more information, see What is AnalyticDB for MySQL?.

Procedure

  1. On the AnalyticDB for MySQL node editing page, perform the following development steps.

    Develop SQL code

    In the SQL editor, write the task code. You can define variables in your code by using the ${variable_name} format. Then, on the right side of the node editing page, assign a value to the variable in the Scheduling Parameters section of the Scheduling Settings pane. This enables dynamic parameter passing for scheduled runs. For more information about how to use scheduling parameters, see Sources and expressions of scheduling parameters. The following code provides an example.

    SHOW ${var};
    Note

    In the example, the ${var} parameter can be set to TABLES.

    Run SQL task

    1. In the Run Configuration section, under Compute Resource, set the Compute Resource and DataWorks Resource Group.

      1. For Computing Resource, select the AnalyticDB for MySQL (V3.0) computing resource that you registered in DataWorks.

      2. For Resource Group, select the scheduling resource group that has passed the connectivity test with the computing resource. For more information, see Network connectivity solutions.

    2. In the parameter dialog box, select the AnalyticDB for MySQL (V3.0) computing resource that you created and click Run.

  2. To run the node task periodically, configure its scheduling properties. For more information, see Configure scheduling properties for a node.

  3. After you complete the configuration, deploy the node. For details, see Deploy a node or a workflow.

  4. After deployment, go to Operation Center to view the running status of your periodic tasks. For details, see Getting started with Operation Center.