Create a MaxCompute SQL task

Updated at:

Create a MaxCompute SQL task to process data in the MaxCompute offline computing engine.

Background information

SQL offline computing tasks process existing data to produce results that meet your 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 navigation pane on the left, choose Data Processing > Script Task. In the Script Task list, click the image icon and select MaxCompute SQL.

  4. In the New MaxCompute SQL Task dialog box, configure the parameters.

    Parameter

    Description

    Task Name

    Enter the offline computing task name.

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

    Schedule Type

    Select a schedule type for the task:

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

    • One-Time Task: Requires manual triggering to execute.

    Select Directory

    Select the folder containing the task.

    If no directory exists, you can Create Folder using the following steps:

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

    2. In the Create Folder dialog box, enter the folder Name and choose the Select Directory location as needed.

    3. Click Confirm.

    Use Template

    Turn on Use Template to apply a code template. When enabled, you must also Select Template and specify the Template Version.

    The task code in the template is read-only. Configure the template parameters to complete your code development. For more information, see create an offline computing template.

    Description

    Provide a brief description of the task within 1000 characters.

  5. Click Confirm.

  6. In the code editor on the MaxCompute SQL task tab, write the SQL script. Then, click Precompile above the code editor to check the syntax of your code.

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

  8. Click Property in the right-side sidebar. In the Property panel, configure the following task properties: Basic Information, Runtime Parameter, Schedule Property (for recurring tasks), Schedule Dependency (for recurring tasks), Runtime Configuration, and Resource Configuration.

    • Basic Information

      Define the name, owner, description, and other basic details of the task. For more information, see configure basic task information.

    • Runtime Parameter

      If your task uses parameter variables, set their values in this section. The parameter variables are automatically replaced with the specified values during scheduling. For more information, see configure offline task runtime parameters.

    • Schedule Property (recurring task)

      For Recurring Task types, configure the schedule and dependencies in addition to the Basic Information. For more information, see configure offline task schedule property.

    • Schedule Dependency (recurring task)

      For Recurring Task types, configure the schedule dependencies in addition to the Basic Information. For more information, see configure offline task schedule dependency.

    • Runtime Configuration

      Set the task-level runtime timeout and rerun policy. If not configured, tenant-level defaults apply. For more information, see configure task runtime.

    • Resource Configuration

      Assign a scheduling resource group to the task. The task uses the resource quota of this group during scheduling. For more information, see Configure resources for a computing task.

  9. On the MaxCompute SQL task tab, save and submit the task.

    • Click the image icon to save the code.

    • Click the image icon to submit the code.

  10. In the Submitting Log page, confirm the Submission Content and the results of the Pre-check, and enter remarks. For more information, see offline computing task submission instructions.

  11. After verification, click Confirm And Submit.

What to do next

  • In Dev-Prod mode, after the task is submitted, go to the release list and publish the task to the production environment. For more information, see manage release tasks.

  • In Basic mode, the submitted task is automatically scheduled in the production environment. Go to the Operation Center to view the task. For more information, see Manage integration and computing tasks, Manage one-time tasks.