All Products
Search
Document Center

Dataphin:Step 4: Develop FLINK_SQL real-time tasks

Last Updated:Jan 21, 2025

This topic provides a guide for creating and developing FLINK_SQL real-time tasks within this tutorial.

Step 1: Create FLINK_SQL task

  1. Navigate to the Dataphin home page and select the Develop option from the top menu bar.

  2. Refer to the operation guide in the figure below to access the New FLINK_SQL Task dialog box.

    image

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

    Parameter

    Description

    Task Name

    Enter the name flink_dataphin.

    Production Environment Cluster

    Select the appropriate 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

    Provide a concise description of the FLINK_SQL task, 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 FLINK_SQL task code editor, write the following 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 the image button in the upper left corner to verify the syntax and permissions of the code.

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

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

Step 3: Submit FLINK_SQL task

  1. Click the image button in the upper left corner and provide remarks in the Submit Remarks dialog box.

  2. Click OK And Submit to complete the submission process.