Create a Databricks SQL task

更新时间: 2026-06-17 12:54:11

Create a Databricks SQL task in a project attached to a Databricks compute engine.

Procedure

  1. On the Dataphin home page, from the top menu bar, select Development > Data Development.

  2. In the top menu bar of the Development page, select Project; note that Dev-Prod mode requires the selection of an environment.

  3. In the navigation pane on the left, select Data Processing > Compute Tasks. On the Compute Tasks page, click the image icon and select Databricks SQL.

  4. In the Create Databricks SQL Task dialog box, configure the following 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 the schedule type of the task.

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

    • One-Time Task: Requires manual triggering of the task.

    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 apply a code template. If enabled, also specify Select Template and Template Version.

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

    Description

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

  5. Click Confirm .

  6. On the Databricks SQL task tab, write the code for the Databricks SQL offline task in the code editor. After you write the code, click Precompile above the code editor to check the syntax of your SQL code.

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

    • If the project name is uppercase within double quotes, the quotes are disregarded and treated as case-insensitive.

  7. Once the code precompilation is finished, click the Run button above the code editing area.

  8. Click Properties in the right sidebar. In the Properties panel, configure the Basic Information, Runtime Parameters, Scheduling Properties (for auto triggered tasks), Scheduling Dependencies (for auto triggered tasks), Runtime Configuration, and Resource Configuration.

    • Basic Information

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

    • Runtime Parameter

      Set values for the parameter variables used in your task. During scheduling, these variables are automatically replaced with the configured values. For configuration instructions, see Configure Offline Task Runtime Parameters.

    • Schedule Attribute (for periodic tasks)

      If the schedule type of the offline computing task is Recurring Task, you must also configure the task's schedule attribute in addition to the Basic Information attribute. For configuration instructions, see Offline Task Schedule Attribute Configuration.

    • Schedule Dependency (for periodic tasks)

      If the schedule type of the offline computing task is Recurring Task, you must also configure the task's schedule dependency in addition to the Basic Information attribute. For configuration instructions, see Configure Offline Task Schedule Dependency.

    • Runtime Configuration

      Configure task-level runtime timeout and rerun policies based on your business requirements. If not configured, the tenant-level defaults apply. For configuration instructions, see Compute Task Runtime Configuration.

    • Resource Configuration

      You can configure schedule resource group for the current computing task.

      Schedule Resource Group: The computing task will use the resource quota of this resource group during scheduling. For configuration instructions, see Compute Task Resource Configuration.

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

    1. Click the Save icon above the code editing area to save the code.

    2. Click the Submit icon above the code editing area to submit the code.

  10. On the Submitting Log page, you must verify the Submission Content and the outcomes of the Pre-check, then provide any necessary remarks. For more information, see Offline Computing Task Submission Instructions.

  11. After confirming, click Confirm And Submit.

What to do next

  • If you are using the Dev-Prod mode for development, once the task is successfully submitted, you need to navigate to the release list and publish the task to the production environment. For more information, see Manage Release Tasks.

  • If you are using Basic mode, the submitted Databricks SQL task can be scheduled in the production environment. You can go to the Operation Center to view your published tasks. For more information, see Manage integration and compute tasks and Manage one-time tasks.

上一篇: Create a GaussDB SQL task 下一篇: Create a SelectDB SQL job
阿里云首页 智能数据建设与治理 Dataphin 相关技术圈