Create a MaxCompute SQL public node

Updated at:

A MaxCompute SQL node is an offline node that runs on a MaxCompute cloud computing resource. You can use SQL statements to process data from MaxCompute data sources. This topic shows how to create a MaxCompute SQL public node.

Prerequisites

A MaxCompute cloud computing resource has been created. For more information, see Create a cloud computing resource.

Procedure

  1. Log on to the Data Resource Platform console.

  2. In the upper-left corner of the page, click the 菜单 icon and select Collaboration.

  3. In the top menu bar, click the 选择工作组 icon, select the target workspace, and then click Asset Processing.

    Note

    If you are already on the Asset Processing page, skip the step to click Asset Processing.

  4. In the left-side navigation pane, click the image icon and select public node.

  5. Click the image icon. On the public node page, click Create Node.

  6. In the Create Node dialog box, select the MaxCompute SQL node type and click OK.

  7. Configure the node on the node editing page.

    1. In the right pane, on the Node Properties tab, specify the node name, node identifier, and node description.

      Parameter

      Description

      Node name

      The name of the node. You can customize the name.

      Node Identifier

      The unique identifier for the node. It must be unique within the same workspace.

      Node Directory

      The directory where the node is located.

      Public node version

      When you create the node, the version defaults to development version (Beta). After the first release, the version number increments with each release.

      Node description

      A description of the node.

    2. On the node editing page, enter the SQL statements and click the 保存 icon.

    3. If you need to use a custom function in SQL, click the Referenced Functions tab, find the required custom function in the custom function list, and then return to the editing page to enter it. If the function list is empty, you need to create a function first. For more information, see Create a custom function.

    4. In the Confirm Node Information dialog box, verify that the Node Identifier, Node Name, and Node Directory are correct, and then click Confirm.

    5. Optional: If your code uses input tables, output tables, or node variables, you can add them manually or click the 解析 icon on the editing page to automatically parse the inputs, outputs, and node variables for the public node.

      The following steps use parsing as an example. The following table describes the parameters.

      1. Click the Parse icon on the edit page. The automatically parsed inputs, outputs, and node variables are displayed on the Running Configurations tab of the node editing page.

      2. Turn on the image.png switch for Node Input to view the node input.

      3. Turn on the Node Output switch image.png to view the node output.

      4. Specify the values for the node variables.

        Parameter

        Description

        Node input

        Input identifier

        The identifier for the input variable. You can customize this based on the Script Content. Example: Input.

        Data structure

        Select the logical table for the input data. This defines the data structure of the source table within the cloud computing resource, based on its data model.

        • If you select a data table, ensure that its data model matches the output data model of the upstream node.

        • Select an asterisk (*) to allow any data structure. This is useful for tables that do not have a defined data model.

        Node output

        Output identifier

        The identifier for the output variable. You can customize this based on the Script Content. Example: Output.

        Data structure

        Select the logical table for the output data. This defines the data structure of the destination table within the cloud computing resource, based on its data model.

        • If you select a data table, ensure that the node's output data model matches the input data model of the downstream node.

        • Select an asterisk (*) to allow any data structure. This is useful for tables that do not have a defined data model.

        Node variable

        Variable name

        The name of the variable. You can customize the name.

        Variable value

        The value of the variable, which must be a string.

        Variable description

        A description of the variable.

    6. On the node editing page, click the 保存 icon in the upper-left corner.

    7. Click the 运行 icon. In the Node variable dialog box that opens, verify that the variable names and values are correct, and then click OK.

      Note

      If parsing detects no variables, the Node variable dialog box does not appear after you click the run icon.

    8. Check the run results and the log. A Current task status:SUCCESS message indicates that the public node ran successfully.