Create a FLINK_SQL real-time task, write the aggregation query, and submit the task for deployment.
Step 1: Create FLINK_SQL task
-
On the Dataphin home page, click Develop in the top menu bar.
-
Follow the steps shown below to open the New FLINK_SQL Task dialog box.

-
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.
-
Click OK to confirm.
Step 2: Develop and precompile FLINK_SQL task code
-
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; -
Click
in the upper-left corner to verify the code syntax and permissions.Note-
If precompilation succeeds, a
notification appears at the top of the page. -
If precompilation fails, a
notification appears. Click Console at the bottom to view the error log.
-
Step 3: Submit FLINK_SQL task
-
Click
in the upper-left corner and enter remarks in the Submit Remarks dialog box. -
Click OK And Submit.