This topic describes how to create an OushuDB SQL task in a Dataphin project associated with an OushuDB compute engine.
Procedure
In the top navigation bar of the Dataphin homepage, choose R&D > Data Development.
On the Develop page, select Project from the top menu bar (for Dev-Prod mode, you must also select an environment).
In the left-side navigation pane, choose Data Processing > Compute Task. In the Compute Task list, click the
icon and select OushuDB SQL.In the Create OushuDB SQL Task dialog box, configure the following parameters.
Parameter
Description
Task name
Enter a name for the offline computing task.
The name can be up to 256 characters long and cannot contain vertical bars (|), forward slashes (/), backslashes (\), colons (:), question marks (?), angle brackets (<>), asterisks (*), or double quotation marks (").
Scheduling type
Select a scheduling type for the task. The available types are:
Scheduled task: The task runs automatically on a schedule.
Manual task: You must trigger the task manually.
Select directory
Select a directory to store the task.
If no directory exists, you can click New Folder to create one. To do so:
Above the compute task list on the left, click the
icon to open the New Folder dialog box.In the New Folder dialog box, enter a Name for the folder and select a directory location if needed.
Click OK.
Use template
Enable the Use Template switch to use a code template. If you enable this option, you must select a template and a template version.
Using a code template can improve development efficiency. The code in a template task is read-only. You only need to configure the template parameters. For more information, see Create an offline computing template.
Description
Enter a brief description of the task, up to 1,000 characters.
Click OK.
In the code editor of the OushuDB SQL task tab, write the SQL code for the task. After you finish writing the code, click Pre-compile above the editor to check your SQL syntax.
NoteIf you use double quotation marks (") to enclose table or column names, the names must be in lowercase.
If you enclose an uppercase project name in double quotation marks, the quotation marks are ignored and the name is treated as case-insensitive.
After pre-compiling the code, click Run above the code editor.
On the right sidebar, click Properties. In the Properties panel, configure the task's Basic information, Runtime parameters, Scheduling properties (for scheduled tasks), Scheduling dependencies (for scheduled tasks), Running configuration, and Resource configuration.
Basic information
Set the task's name, owner, and description. For more information, see Configure basic task information.
Runtime parameters
If your task uses parameters, assign their values in this section. The system replaces the parameters with these values at runtime. For more information, see Configure and use node parameters.
Scheduling properties (for scheduled tasks)
If the task is a scheduled task, you must configure its scheduling properties in addition to its basic information. For more information, see Configure scheduling properties.
Scheduling dependencies (for scheduled tasks)
If the task is a scheduled task, you must configure its scheduling dependencies in addition to its basic information. For more information, see Configure scheduling dependencies.
Running configuration
You can configure a task-level timeout period and a retry policy for task failures. If you do not configure these settings, the task inherits the default tenant-level settings. For more information, see Configure the running configuration of a compute task.
Resource configuration
You can configure a scheduling resource group for the compute task. The task then uses this group's resource quota for scheduling. For more information, see Configure the resource configuration of a compute task.
Save and submit the task.
Click the
icon above the code editor to save the code.Click the
icon above the code editor to submit the code.
On the Submission Details page, confirm the Submission Content and the Pre-check results, and enter remarks. For more information, see Offline Computing Task Submission Instructions.
After confirming the details, click Confirm and Submit.
Next steps
If you are in Dev-Prod mode, you must publish the task to the production environment from the publish list after submission. For more information, see Manage release tasks.
If your development mode is Basic mode, OushuDB SQL tasks that are successfully submitted can be scheduled in the production environment. You can go to the O&M Center to view your published tasks. For more information, see View and manage script tasks, View and manage manual tasks.