This topic describes how to create a MaxCompute SQL task using the MaxCompute offline computing engine.
Background information
SQL offline computing tasks process existing data to generate results that align with business requirements.
Procedure
On the Dataphin home page, navigate to the top menu bar and select Development > Data Development.
On the Development page, select Project from the top menu bar (Dev-Prod mode requires selecting the environment).
In the navigation pane on the left, choose Data Processing > Script Task. In the Script Task list, click the
icon and select MaxCompute SQL.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
Choose the schedule type for the task. Options for Schedule Type include the following:
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:
Click the
icon above the task list on the left to open the Create Folder dialog box.In the Create Folder dialog box, enter the folder Name and choose the Select Directory location as needed.
Click Confirm.
Use Template
Toggle the Use Template switch to decide on utilizing a code template. When enabled, you must also Select Template and specify the Template Version.
Utilize the code template for streamlined development. The task code within the template is read-only and cannot be modified. Simply configure the template parameters to finalize your code development. For additional details, see create an offline computing template.
Description
Provide a brief description of the task within 1000 characters.
Click Confirm.
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.
Once precompilation is successful, click Run to execute the code.
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
This section is for defining the name, owner, description, and other fundamental details of the scheduling task. For guidance on configuration, see configure basic task information.
Runtime Parameter
If your task invokes parameter variables, you can set values for these parameters in the properties section. This allows for the automatic substitution of parameter variables with their respective values during node scheduling. For configuration instructions, see configure and use node parameters.
Schedule Property (recurring task)
For offline computing tasks set as a Recurring Task, you must not only provide the Basic Information but also define the task's schedule and its dependencies. For guidance on configuring these properties, see configure schedule property.
Schedule Dependency (recurring task)
For offline computing tasks set as a Recurring Task, you must not only fill in the Basic Information but also configure the task's schedule dependencies. For guidance on configuration, see configure schedule dependency.
Runtime Configuration
Configure the task-level runtime timeout and rerun policy for your offline computing tasks to match your business needs. If these settings are not specified, they will default to the tenant-level configurations. For guidance on setting these parameters, see configure task runtime.
Resource Configuration
You can configure a scheduling resource group for the task. The task uses the resource quota of this resource group when it is scheduled. For more information, see Configure resources for a computing task.
On the MaxCompute SQL task tab, save and submit the task.
Click the
icon to save the code.Click the
icon to submit the code.
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.
After verification, click Confirm And Submit.
What to do next
In Dev-Prod mode, upon successful submission of your task, navigate to the release list and publish the task to the production environment. For more information, see manage release tasks.
If you are in Basic mode, the submitted MaxCompute SQL task is automatically scheduled in the production environment. You can go to the Operation Center to view your published task. For more information, see View and manage script tasks, View and manage one-time tasks.