All Products
Search
Document Center

Dataphin:Step 4: Develop FLINK_SQL real-time tasks

Last Updated:Jun 23, 2026

Create a FLINK_SQL real-time task, write the aggregation query, and submit the task for deployment.

Step 1: Create FLINK_SQL task

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

  2. Follow the steps shown below to open the New FLINK_SQL Task dialog box.

    image

  3. In the New FLINK_SQL Task dialog box, configure the following parameters:

    Parameter

    Description

    Task Name

    Enter the name flink_dataphin.

    Production Environment Cluster

    Select the cluster for the FLINK_SQL task.

    Engine Version

    Choose the vvr-8.0.1-flink-1.17 version.

    Use Template

    By default, this is set to Disabled.

    Storage Directory

    The default is set to Code Management.

    Description

    Enter a brief description, such as Calculate the total sales of a single product.

  4. Click OK to confirm.

Step 2: Develop and precompile FLINK_SQL task code

  1. In the code editor, enter the following SQL code:

    INSERT INTO ads_gross
    SELECT
             sku_type as prod_code
            ,sum(sku_quantity) as sale_num
    FROM    oms_orders
    GROUP BY  sku_type;
  2. Click image in the upper-left corner to verify the code syntax and permissions.

    Note
    1. If precompilation succeeds, a 1 notification appears at the top of the page.

    2. If precompilation fails, a 2 notification appears. Click Console at the bottom to view the error log.

Step 3: Submit FLINK_SQL task

  1. Click image in the upper-left corner and enter remarks in the Submit Remarks dialog box.

  2. Click OK And Submit.