You can create an AnalyticDB for MySQL node and use SQL statements to develop data for the AnalyticDB for MySQL data source. This topic describes how to create and use an AnalyticDB for MySQL node.

Prerequisites

  • DataWorks of the required edition is activated, the required data source is purchased, and the AnalyticDB for MySQL compute engine is bound to DataWorks.
    • DataWorks Standard Edition or a more advanced edition is activated. For more information, see DataWorks advanced editions.
    • An AnalyticDB for MySQL cluster is created. For more information, see Create a cluster.
    • The AnalyticDB for MySQL compute engine is bound to DataWorks on the Workspace Management page. For more information, see Configure a workspace.
  • A resource group is created.

    An exclusive resource group for scheduling is created. For more information, see Create an exclusive resource group for scheduling.

  • A data source is prepared.

    An AnalyticDB for MySQL data source is added. For more information, see Configure an AnalyticDB for MySQL 3.0 connection.

Background information

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

Limits

  • An AnalyticDB for MySQL compute engine instance can be bound only to DataWorks Standard Edition or a more advanced edition.
  • You can run AnalyticDB for MySQL nodes only on exclusive resource groups for scheduling.
  • An AnalyticDB for MySQL node can be used to develop data only for an AnalyticDB for MySQL data source that is added by using the connection string mode. You can go to the Data Source page, find your desired data source, and then click Edit in the Operation column to view the mode that was used to add the data source. For more information, see Configure an AnalyticDB for MySQL 3.0 connection.

Create an AnalyticDB for MySQL node and develop data

  1. Go to the DataStudio page.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. In the top navigation bar, select the region where your workspace resides, find the workspace, and then click Data Analytics in the Actions column.
  2. Create an AnalyticDB for MySQL node.
    1. Move the pointer over the Create icon and choose AnalyticDB for MySQL > ADB for MySQL.
      You can also find the newly created workflow, right-click the workflow name, and then choose Create > AnalyticDB for MySQL > ADB for MySQL.
    2. Click Commit to go to the editing tab of the AnalyticDB for MySQL node.
  3. Use the AnalyticDB for MySQL node to develop data.
    1. Select a data source.
      Select the required data source that needs to be used for data development from the Select Data Store drop-down list. If you cannot find the required data source in the drop-down list, click Add Connection and add a data source on the Data Source page. For more information, see Configure an AnalyticDB for MySQL 3.0 connection.
      Note
      • When you bind the AnalyticDB for MySQL compute engine to DataWorks, the system automatically creates an AnalyticDB for MySQL data source. The system uses the data source to develop data by default. You can also select your desired data source.
      • An AnalyticDB for MySQL node can be used to develop data only for an AnalyticDB for MySQL data source that is added by using the connection string mode. You can go to the Data Source page, find your desired data source, and then click Edit in the Operation column to view the mode that was used to add the data source. For more information, see Configure an AnalyticDB for MySQL 3.0 connection.

    2. Use SQL statements to create a task.
      1. Compile SQL statements in the SQL editor to create a task. SQL editorIn this example, the following statement is used to query tables in the data source. You can compile SQL statements that you want to execute based on the syntax supported by AnalyticDB for MySQL and your business requirements.
        show tables;
      2. Select a resource group.
        In the top toolbar, click the Run icon. In the Arguments dialog box, select the created exclusive resource group for scheduling.
        Note
        • You must use an exclusive resource group for scheduling that is connected to the data source. For more information, see Test data store connectivity.
        • If you want to change the resource group in subsequent operations, you can also perform the change in the Arguments dialog box.
      3. Save and execute the SQL statement.

        In the top toolbar, click the Save icon to save the compiled SQL statement. Then, click the Run icon to execute the SQL statement.

        The following figure shows the results. Results
  4. Configure scheduling properties for the AnalyticDB for MySQL node.
    If you want the system to run the AnalyticDB for MySQL node periodically, you can click Properties in the right-side navigation pane to configure scheduling properties for the node based on your business requirements.
    • Configure resource properties for the AnalyticDB for MySQL node. For more information, see Configure the resource group. You must select the exclusive resource group for scheduling that is connected to the AnalyticDB for MySQL data source. For more information, see Test data store connectivity.