Create a Blink SQL task

更新时间: 2026-06-23 14:31:56

Create a Blink SQL task based on the Alibaba Blink real-time compute engine.

Prerequisites

Make sure that you have enabled the real-time compute engine and configured an Alibaba Blink compute source for the project. For more information, see Create a general project.

Permissions

Only super administrators, project administrators, and developers can create Blink SQL tasks.

Step 1: Create a Blink SQL task

  1. On the Dataphin home page, click Develop in the top menu bar.

  2. Follow the instructions in the following figure to open the Create Blink SQL dialog box.

    image.png

  3. In the Create Blink SQL dialog box, configure the parameters.

    Parameter

    Description

    Task Name

    The task name must follow these conventions:

    • Can contain only lowercase letters, digits, and underscores (_).

    • Must be 3 to 62 characters in length.

    • Must be unique within the project.

    • Must start with a letter.

    Resource Queue

    Select a resource queue from the real-time compute source attached to the project.

    Engine Version

    Select a version supported by the current resource queue.

    Storage Directory

    The default directory is Code Management. You can also create a storage directory.image

    Creation Method

    You can select Create from Scratch or Use Template.

    • Create from Scratch: Create a blank Blink SQL task.

    • Use Template: Create a task from a real-time compute task template.

    Description

    Enter a description of the task, up to 1,000 characters.

Step 2: Develop the Blink SQL task code

  1. On the code page for the Blink SQL task, write the task code.image

    Note
    • Click the image icon in the upper-right corner of the page to automatically format the SQL code.

    • Dataphin supports using native DDL statements to quickly create metatables. When Dataphin detects a native create table/create temporary table statement, you can click the image..png icon in the editor to quickly create a metatable. For more information, see Flink SQL task development methods.

  2. Click Precompile in the upper-left corner of the page to check the code syntax and permissions.

    Note
    1. When precompilation succeeds, a pop-up message with the 1 icon appears at the top of the page.

    2. If precompilation fails, a 2 message appears. Click Console at the bottom of the page to view the failure log.

Step 3: Configure the Blink SQL task

  1. In the editor's sidebar, click Configuration.

  2. In the Configuration dialog box, configure the parameters for Real-time Mode and Offline Mode.

    Note

    Dataphin real-time computing supports unified stream and batch processing. You can use a unified compute engine to configure both Stream + Batch (Real-time Mode + Offline Mode) settings for a single piece of code, generating instances for different modes from the same code. To enable batch processing, enable offline mode on the task configuration page and configure resources, scheduling dependencies, and other settings.

  3. Click OK.

Step 4: Debug the Blink SQL task code (Optional)

Dataphin lets you debug your Blink SQL code. Click the image debug icon in the upper-right corner of the page to sample data and perform local debugging. You can debug in real-time mode or offline mode.

Note

Currently, you can debug in only one mode at a time. After you select a mode, the system samples data from the corresponding table for debugging.

  • Real-time mode debugging: Samples data from the corresponding real-time physical table, then performs local debugging in Flink Stream mode. For more information, see Real-time mode debugging.

  • Offline mode debugging: Samples data from the corresponding offline physical table, then performs local debugging in Flink Batch mode. For more information, see Offline mode debugging.

Step 5: Submit the Blink SQL task

  1. Click the image icon in the upper-left corner of the page and enter comments in the Submit Comments dialog box.

  2. Click OK and Submit.

    Note

    If the project is in Dev-Prod mode, you must publish the Flink SQL task to the production environment. For more information, see Manage published tasks.

What to do next

Go to the Operation Center to view and manage the Blink SQL task and ensure that it runs as expected. For more information, see Manage real-time tasks.

上一篇: Develop real-time tasks based on Blink exclusive/shared clusters 下一篇: Create a Blink DataStream task
阿里云首页 智能数据建设与治理 Dataphin 相关技术圈