Create a GaussDB SQL task

更新时间:
复制 MD 格式

Create a GaussDB SQL task in a project bound to a GaussDB Data Warehouse Service (DWS) compute engine.

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 an environment).

  3. In the navigation pane, go to Data Processing > Script Task. In the Script Task list, click the image icon and choose GaussDB SQL.

  4. In the Create GaussDB SQL Task dialog box, configure the parameters.

    Parameter

    Description

    Task Name

    Enter the name of the offline computing task.

    The length must not exceed 256 characters and cannot contain 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: Runs automatically on the system's periodic schedule.

    • One-Time Task: Requires manual triggering.

    Select Directory

    Select the directory where the task is stored.

    If no directory is created, you can Create Folder, as follows:

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

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

    3. Click Confirm.

    Use Template

    Turn on Use Template to use a code template. If enabled, also specify Select Template and Template Version.

    Template task code is read-only. You only need to configure the template parameters to complete code development. For more information, see Create Offline Computing Template.

    Description

    Provide a brief description of the task, within 1000 characters.

  5. Click Confirm.

  6. On the GaussDB SQL task tab, write the code for the GaussDB SQL offline task in the code editor. Then, click Precompile above the code editor to check the SQL syntax.

    Note
    • When editing code, use lowercase for table and column names within double quotes.

    • Project names in uppercase within double quotes are treated as case-insensitive.

  7. After precompiling the code, click Run.

  8. Click Attribute in the page's right sidebar. In the Attribute panel, configure the task's Basic Information, Runtime Parameter, Scheduling Property (for periodic tasks), Schedule Dependency (for periodic tasks), Runtime Configuration, and Resource Configuration.

    • Basic Information

      Define the task name, owner, description, and other basic details. For configuration guidance, see Configure Task Basic Information.

    • Runtime Parameter

      If your task uses parameter variables, set their values here. During scheduling, the variables are automatically replaced with the configured values. For more information, see Configuring Offline Task Runtime Parameters.

    • Scheduling Property (for periodic tasks)

      For Recurring Task, configure the scheduling attributes in addition to Basic Information. For configuration guidance, see Offline Task Schedule Attribute Configuration.

    • Schedule Dependency (for periodic tasks)

      For Recurring Task, configure the schedule dependencies in addition to Basic Information. For configuration instructions, see Configure Offline Task Schedule Dependencies.

    • Runtime Configuration

      Set task-level runtime timeouts and rerun policies. If not set, tenant-level defaults apply. For more information, see Compute Task Runtime Configuration.

    • Resource Configuration

      Assign a schedule resource group for this task. The task consumes the resource quota of the assigned group during scheduling. For configuration instructions, see Compute Task Resource Configuration.

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

    1. Click the image icon to save the code.

    2. Click the image icon to submit the code.

  10. On the Submitting Log page, review the Submission Content and Pre-check results, and add comments as needed. 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, you must visit the release list to publish the task to the production environment. For more information, see Manage Release Tasks.

  • If you use the Basic development model, the GaussDB SQL task can be scheduled in the production environment after it is submitted. You can go to the Operation Center to view the published task. For more information, see Manage integration and computing tasks, and Manage manual tasks.