All Products
Search
Document Center

Dataphin:Create a MAX_COMPUTE_SQL task

Last Updated:Jan 21, 2025

This topic describes how to create a MAX_COMPUTE_SQL task using the offline computing engine MaxCompute.

Background information

SQL offline computing tasks are ideal for processing data to meet specific business requirements.

Procedure

  1. On the Dataphin home page, navigate to the top menu bar and select Development > Data Development.

  2. On the Development page, select Project from the top menu bar (Dev-Prod mode requires selecting the environment).

  3. In the left-side navigation pane, choose Data Processing > Script Task. In the Script Task list, click the image icon and select MAX_COMPUTE_SQL.

  4. In the New MAX_COMPUTE_SQL Task dialog box, configure the following parameters:

    Parameter

    Description

    Task Name

    Enter the name of the offline computing task. The name must not exceed 256 characters and cannot include vertical lines (|), forward slashes (/), backslashes (\), colons (:), question marks (?), angle brackets (<>), asterisks (*), or quotation marks (").

    The length must not exceed 256 characters and must not contain vertical lines (|), forward slashes (/), backslashes (\), colons (:), question marks (?), angle brackets (<>), asterisks (*), or quotation marks (").

    Schedule Type

    Choose the schedule type for the task. Options for Schedule Type include:

    • Recurring Task: Automatically included in the system's periodic scheduling.

    • One-Time Task: Requires manual triggering.

    Select Directory

    Choose the directory to store the task. If no directory exists, create one as follows:

    If no directory exists, you can Create a Folder by following these steps:

    1. Click the image icon above the task list on the left to open the Create A Folder dialog box.

    2. In the Create A Folder dialog box, enter the folder Name and select the desired Directory location.

    3. Click Confirm.

    Use Template

    Toggle the Use Template switch to decide if a code template should be used. When enabled, you must also Select Template and specify the Template Version.

    Utilize reference code templates to streamline your development process. The code within these templates is read-only and not subject to modification. Simply configure the necessary template parameters to finalize your code development. For more information, see how to create an offline computing template.

    Description

    Provide a brief description of the task, up to 1000 characters.

  5. Click Confirm.

  6. In the code editing area of the current MAX_COMPUTE_SQL task tab, write the code for the MAX_COMPUTE_SQL offline computing task. After coding, click Precompile to check the SQL code syntax.

  7. Once the code precompilation is successful, click Run to execute the code.

  8. Click Attribute in the right sidebar. In the Attribute panel, configure the node's Basic Information, Runtime Parameter, Schedule Property (auto triggered node), Schedule Dependency (auto triggered node), Runtime Configuration, and Resource Configuration.

    • Basic Information

      This section is for defining the scheduling task's name, responsible individual, description, and other fundamental details. For configuration instructions, see Configure basic task information.

    • Runtime Parameter

      When your task utilizes parameter variables, you can set values for these parameters in the attributes. This ensures that during node scheduling, the parameter variables are automatically substituted with their respective values. For guidance on configuration, see Parameter configuration and use of node parameters.

    • Scheduling Attribute (Recurring Task)

      When the schedule type for an offline computing task is set to Recurring Task, you must not only provide the Basic Information but also define the task's scheduling attributes and dependencies. For guidance on configuration, see Configure scheduling attributes.

    • Schedule Dependency (Recurring Task)

      When the offline computing task is set as a Recurring Task, you must not only provide the Basic Information but also configure its scheduling dependencies. For guidance on configuration, see Configure scheduling dependencies.

    • Runtime Configuration

      You can set the task-level runtime timeout and rerun policy for your offline computing tasks to match specific business needs. If these settings are not specified, they will default to the values established at the tenant level. For guidance on how to configure these settings, see Compute task runtime configuration.

    • Resource Configuration

      You can set up the scheduling resource group for your current computing task, which will utilize the resource quota of that group during scheduling. For guidance on configuration, see Compute task resource configuration.

  9. Save and submit the task under the current MAX_COMPUTE_SQL task tab.

    • Click the image icon to save the code.

    • Click the image icon to submit the code.

  10. In the Submitting Log page, you need to confirm the Submission Content and the results of the Pre-check, and fill in the remarks. For more information, see Offline computing task submission instructions.

  11. Once confirmed, click Confirm And Submit.

What to do next

  • In Dev-Prod mode, once you have successfully submitted your task, proceed to the release list to publish the task to the production environment. For more information, see Manage release tasks.

  • If your development mode is Basic mode, the successfully submitted MAX_COMPUTE_SQL task can participate in the production environment scheduling. You can go to the Operation Center to view the tasks you have published. For more information, see View and manage script tasks, View and manage one-time tasks.