This section describes how to create a Flink SQL job. You can use Flink SQLs to develop jobs to meet your service requirements. Using SQL statements simplifies logic implementation. You can edit Flink SQL statements for your job in the DLI SQL editor. This section describes how to use the SQL editor to write Flink SQL statements.
DLI Flink OpenSource SQL jobs are fully compatible with the syntax of Flink 1.10 and 1.12 provided by the community. In addition, Redis, GaussDB(DWS), and DIS data source types are added based on the community connector.
Parameter |
Description |
|---|---|
Type |
Set Type to Flink SQL. You will need to rewrite SQL statements to start the job. |
Name |
Name of a job. Enter 1 to 57 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. NOTE:
The job name must be globally unique. |
Description |
Description of a job. It can contain a maximum of 512 characters. |
Template Name |
You can select a sample template or a custom job template. For details about templates, see Managing Flink Templates. |
Tag |
Tags used to identify cloud resources. A tag includes the tag key and tag value. If you want to use the same tag to identify multiple cloud resources, that is, to select the same tag from the drop-down list box for all services, you are advised to create predefined tags on the Tag Management Service (TMS). NOTE:
|
Enter details SQL statements in the statement editing area. For details about SQL syntax, see the Data Lake Insight SQL Syntax Reference.
Parameter |
Description |
|---|---|
Queue |
A shared queue is selected by default. You can select a custom queue as needed. NOTE:
|
UDF Jar |
If you selected custom queues, you need to configure this parameter. You can customize a UDF Jar file. Before you select a JAR file, upload the corresponding JAR package to the OBS bucket and choose to create a package. For details, see Creating a Package. In SQL, you can call a user-defined function that is inserted into a JAR file. |
CUs |
Sum of the number of compute units and job manager CUs of DLI. One CU equals 1 vCPU and 4 GB. The configured number of CUs is the number of CUs required for job running and cannot exceed the number of CUs in the bound queue. |
Job Manager CUs |
Number of CUs of the management unit. |
Parallelism |
Number of Flink SQL jobs that run at the same time Properly increasing the number of parallel threads improves the overall computing capability of the job. However, the switchover overhead caused by the increase of threads must be considered. NOTE:
|
Task Manager Configuration |
Whether to set Task Manager resource parameters If this option is selected, you need to set the following parameters:
|
OBS Bucket |
OBS bucket to store job logs and checkpoint information. If the selected OBS bucket is not authorized, click Authorize. NOTE:
If Enable Checkpointing and Save Job Log are both selected, you only need to authorize OBS once. |
Save Job Log |
Whether to save the job running logs to OBS The logs are saved in the following path: Bucket name/jobs/logs/Directory starting with the job ID. To go to this path, go to the job list and click the job name. On the Run Log tab page, click the provided OBS link. CAUTION:
You are advised to select this parameter. Otherwise, no run log is generated after the job is executed. If the job is abnormal, the run log cannot be obtained for fault locating. If this option is selected, you need to set the following parameters: OBS Bucket: Select an OBS bucket to store user job logs. If the selected OBS bucket is not authorized, click Authorize.
NOTE:
If Enable Checkpointing and Save Job Log are both selected, you only need to authorize OBS once. |
Alarm Generation upon Job Exception |
Whether to report job exceptions, for example, abnormal job running or exceptions due to an insufficient balance, to users via SMS or email If this option is selected, you need to set the following parameters: SMN Topic Select a user-defined SMN topic. For details about how to create a custom SMN topic, see "Creating a Topic" in Simple Message Notification User Guide. |
Enable Checkpointing |
Whether to enable job snapshots. If this function is enabled, jobs can be restored based on the checkpoints. If this option is selected, you need to set the following parameters:
|
Auto Restart upon Exception |
Whether to enable automatic restart. If this function is enabled, any job that has become abnormal will be automatically restarted. If this option is selected, you need to set the following parameters:
|
Idle State Retention Time |
Defines for how long the state of a key is retained without being updated before it is removed in GroupBy or Window. The default value is 1 hour. |
Dirty Data Policy |
Select a policy for processing dirty data. The following policies are supported: Ignore, Trigger a job exception, and Save. NOTE:
Save indicates that the dirty data is stored to the OBS bucket selected above. |
Dirty Data Dump Address |
Set this parameter when Dirty Data Policy is set to Save. Click the address box to select the OBS path for storing dirty data. |
After the job is started, the system automatically switches to the page, and the created job is displayed in the job list. You can view the job status in the column. After a job is successfully submitted, the job status will change from to . After the execution is complete, the message Completed is displayed.
If the job status is or , the job submission failed or the job did not execute successfully. In this case, you can move the cursor over the status icon in the column of the job list to view the error details. You can click
to copy error information. After handling the fault based on the provided information, resubmit the job.
Other available buttons are as follows: