section> Computing
  • Auto Scaling
  • Bare Metal Server
  • Dedicated Host
  • Elastic Cloud Server
  • FunctionGraph
  • Image Management Service
Network
  • Direct Connect
  • Domain Name Service
  • Elastic IP
  • Elastic Load Balancing
  • Enterprise Router
  • NAT Gateway
  • Private Link Access Service
  • Secure Mail Gateway
  • Virtual Private Cloud
  • Virtual Private Network
  • VPC Endpoint
Storage
  • Cloud Backup and Recovery
  • Cloud Server Backup Service
  • Elastic Volume Service
  • Object Storage Service
  • Scalable File Service
  • Storage Disaster Recovery Service
  • Volume Backup Service
Application
  • API Gateway (APIG)
  • Application Operations Management
  • Application Performance Management
  • Distributed Message Service (for Kafka)
  • Simple Message Notification
Data Analysis
  • Cloud Search Service
  • Data Lake Insight
  • Data Warehouse Service
  • DataArts Studio
  • MapReduce Service
  • ModelArts
  • Optical Character Recognition
Container
  • Application Service Mesh
  • Cloud Container Engine
  • Cloud Container Instance
  • Software Repository for Containers
Databases
  • Data Replication Service
  • Distributed Cache Service
  • Distributed Database Middleware
  • Document Database Service
  • GeminiDB
  • Relational Database Service
  • TaurusDB
Management & Deployment
  • Cloud Create
  • Cloud Eye
  • Cloud Trace Service
  • Config
  • Log Tank Service
  • Resource Formation Service
  • Tag Management Service
Security Services
  • Anti-DDoS
  • Cloud Firewall
  • Database Security Service
  • Dedicated Web Application Firewall
  • Host Security Service
  • Identity and Access Management
  • Key Management Service
  • Web Application Firewall
Other
  • Enterprise Dashboard
  • Marketplace
  • Price Calculator
  • Status Dashboard
APIs
  • REST API
  • API Usage Guidelines
  • Endpoints
Development and Automation
  • SDKs
  • Drivers and Tools
  • Terraform
  • Ansible
  • Cloud Create
Architecture Center
  • Best Practices
  • Blueprints
IaaSComputingAuto ScalingBare Metal ServerDedicated HostElastic Cloud ServerFunctionGraphImage Management ServiceNetworkDirect ConnectDomain Name ServiceElastic IPElastic Load BalancingEnterprise RouterNAT GatewayPrivate Link Access ServiceSecure Mail GatewayVirtual Private CloudVirtual Private NetworkVPC EndpointStorageCloud Backup and RecoveryCloud Server Backup ServiceElastic Volume ServiceObject Storage ServiceScalable File ServiceStorage Disaster Recovery ServiceVolume Backup ServicePaaSApplicationAPI Gateway (APIG)Application Operations ManagementApplication Performance ManagementDistributed Message Service (for Kafka)Simple Message NotificationData AnalysisCloud Search ServiceData Lake InsightData Warehouse ServiceDataArts StudioMapReduce ServiceModelArtsOptical Character RecognitionContainerApplication Service MeshCloud Container EngineCloud Container InstanceSoftware Repository for ContainersDatabasesData Replication ServiceDistributed Cache ServiceDistributed Database MiddlewareDocument Database ServiceGeminiDBRelational Database ServiceTaurusDBManagementManagement & DeploymentCloud CreateCloud EyeCloud Trace ServiceConfigLog Tank ServiceResource Formation ServiceTag Management ServiceSecuritySecurity ServicesAnti-DDoSCloud FirewallDatabase Security ServiceDedicated Web Application FirewallHost Security ServiceIdentity and Access ManagementKey Management ServiceWeb Application FirewallOtherOtherEnterprise DashboardMarketplacePrice CalculatorStatus Dashboard

Data Lake Insight

  • Service Overview
  • Getting Started
  • DLI Job Development Process
  • Preparations
  • Creating an Elastic Resource Pool and Queues Within It
  • Creating Databases and Tables
  • Data Migration and Transmission
  • Configuring an Agency to Allow DLI to Access Other Cloud Services
  • Submitting a SQL Job Using DLI
  • Submitting a Flink Job Using DLI
    • Flink Job Overview
    • Creating a Flink OpenSource SQL Job
    • Creating a Flink Jar Job
    • Configuring Flink Job Permissions
    • Managing Flink Jobs
    • Managing Flink Job Templates
    • Adding Tags to a Flink Job
  • Submitting a Spark Job Using DLI
  • Using Cloud Eye to Monitor DLI
  • Using AOM to Monitor DLI
  • Using CTS to Audit DLI
  • Permissions Management
  • Common DLI Management Operations
  • FAQ
  • Change History
  • User Guide
  • Submitting a Flink Job Using DLI
  • Creating a Flink OpenSource SQL Job

Creating a Flink OpenSource SQL Job¶

This section describes how to create a Flink OpenSource SQL job.

DLI Flink OpenSource SQL jobs are fully compatible with the syntax of Flink provided by the community. In addition, Redis and GaussDB(DWS) data source types are added based on the community connector. For the syntax and constraints of Flink SQL DDL, DML, and functions, see Table API & SQL.

Prerequisites¶

  • You have prepared the source and sink streams.

  • A datasource connection has been created to enable the network between the queue where the job is about to run and external data sources.

    • For details about the external data sources that can be accessed by Flink jobs, see Common Development Methods for DLI Cross-Source Analysis.

    • For how to create a datasource connection, see Configuring the Network Connection Between DLI and Data Sources (Enhanced Datasource Connection).

      On the Resources > Queue Management page, locate the queue you have created, click More in the Operation column, and select Test Address Connectivity to check if the network connection between the queue and the data source is normal. For details, see Testing Address Connectivity.

Creating a Flink OpenSource SQL Job¶

  1. In the left navigation pane of the DLI management console, choose Job Management > Flink Jobs. The Flink Jobs page is displayed.

  2. In the upper right corner of the Flink Jobs page, click Create Job.

  3. Set job parameters.

    Table 1 Job parameters¶

    Parameter

    Description

    Type

    Set Type to Flink OpenSource SQL. You will need to start jobs by compiling SQL statements.

    Name

    Job name. Enter 1 to 57 characters. Only letters, numbers, 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 Job Templates.

    Tags

    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

    • A maximum of 20 tags can be added.

    • Only one tag value can be added to a tag key.

    • The key name in each resource must be unique.

    • Tag key: Enter a tag key name in the text box.

      Note

      A tag key can contain a maximum of 128 characters. Only letters, numbers, spaces, and special characters (_.:+-@) are allowed, but the value cannot start or end with a space or start with _sys_.

    • Tag value: Enter a tag value in the text box.

      Note

      A tag value can contain a maximum of 255 characters. Only letters, numbers, spaces, and special characters (_.:+-@) are allowed.

  4. Click OK to enter the editing page.

  5. Edit an OpenSource SQL job.

    Enter detailed SQL statements in the statement editing area. For details about SQL statements, see the Data Lake Insight Flink OpenSource SQL Syntax Reference.

  6. Click Check Semantics.

    • You can Start a job only after the semantic verification is successful.

    • If verification is successful, the message "The SQL semantic verification is complete. No error." will be displayed.

    • If verification fails, a red "X" mark will be displayed in front of each SQL statement that produced an error. You can move the cursor to the "X" mark to view error details and change the SQL statement as prompted.

    Note

    Flink 1.15 does not support syntax verification.

  7. Set job running parameters.

    Table 2 Running parameters¶

    Parameter

    Description

    Queue

    Select a queue to run the job.

    UDF Jar

    UDF JAR file, which contains UDFs that can be called in subsequent jobs.

    There are the following ways to manage UDF JAR files:

    • Upload packages to OBS: Upload Jar packages to an OBS bucket in advance and select the corresponding OBS path.

    • Upload packages to DLI: Upload JAR files to an OBS bucket in advance and create a package on the Data Management > Package Management page of the DLI management console. For details, see Creating a DLI Package.

    For Flink 1.15 or later, only OBS packages can be selected when creating jobs, and DLI packages are not supported.

    Agency

    If you choose Flink 1.15 to execute your job, you can create a custom agency to allow DLI to access other services.

    CUs

    Sum of the number of compute units and job manager CUs of DLI. One CU equals 1 vCPU and 4 GB.

    The value is the number of CUs required for job running and cannot exceed the number of CUs in the bound queue.

    Note

    When Task Manager Config is selected, elastic resource pool queue management is optimized by automatically adjusting CUs to match Actual CUs after setting Slot(s) per TM.

    CUs = Actual number of CUs = max[Job Manager CPUs + Task Manager CPU, (Job Manager Memory + Task Manager Memory/4)]

    • Job Manager CPUs + Task Manager CPUs = Actual TMs x CU(s) per TM + Job Manager CUs.

    • Job Manager Memory + Task Manager Memory = Actual TMs x Memory per TM + Job Manager Memory

    • If Slot(s) per TM is set, then: Actual TMs = Parallelism/Slot(s) per TM.

    • If Slot(s) per TM is not set, then: Actual TMs = (CUs - Job Manager CUs)/CU(s) per TM.

    • If Memory per TM and Job Manager Memory in the optimization parameters are not set, then: Memory per TM = CU(s) per TM x 4. Job Manager Memory = Job Manager CUs x 4.

    • The parallelism degree of Spark resources is jointly determined by the number of Executors and the number of Executor CPU cores.

    Job Manager CUs

    Number of CUs of the management unit.

    Parallelism

    Number of tasks concurrently executed by each operator in a job.

    Note

    This value cannot be greater than four times the compute units (number of CUs minus the number of job manager CUs).

    Task Manager Config

    Whether Task Manager resource parameters are set

    • If selected, you need to set the following parameters:

      • CU(s) per TM: Number of resources occupied by each Task Manager.

      • Slot(s) per TM: Number of slots contained in each Task Manager.

    • If not selected, the system automatically uses the default values.

      • CU(s) per TM: The default value is 1.

      • Slot(s) per TM: The default value is (Parallelism x CU(s) per TM)/(CUs - Job Manager CUs).

    OBS Bucket

    OBS bucket to store job logs and checkpoint information. If the OBS bucket you selected is unauthorized, click Authorize.

    Save Job Log

    Whether job running logs are saved to OBS. The logs are saved in the following path: Bucket name/jobs/logs/Directory starting with the job ID.

    Caution

    CAUTION: You are advised to configure this parameter. Otherwise, no run log is generated after the job is executed. If the job fails, 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 job logs. If the OBS bucket you selected is unauthorized, click Authorize.

    Note

    If Enable Checkpointing and Save Job Log are both selected, you only need to authorize OBS once.

    Alarm on Job Exception

    Whether to notify users of any job exceptions, such as running exceptions or arrears, via SMS or email.

    If this option is selected, you need to set the following parameters:

    SMN Topic

    Select a custom SMN topic. For how to create a custom SMN topic, see "Creating a Topic" in the 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:

    • Checkpoint Interval: interval for creating checkpoints, in seconds. The value ranges from 1 to 999999, and the default value is 30.

    • Checkpoint Mode can be set to either of the following values:

      • At least once: Events are processed at least once.

      • Exactly once: Events are processed only once.

    If you select Enable Checkpointing, you also need to set OBS Bucket.

    OBS Bucket: Select an OBS bucket to store your checkpoints. If the OBS bucket you selected is unauthorized, click Authorize.

    The checkpoint path is Bucket name/jobs/checkpoint/Directory starting with the job ID.

    Note

    If Enable Checkpointing and Save Job Log are both selected, you only need to authorize OBS once.

    Auto Restart upon Exception

    Whether automatic restart is enabled. If enabled, jobs will be automatically restarted and restored when exceptions occur.

    If this option is selected, you need to set the following parameters:

    • Max. Retry Attempts: maximum number of retries upon an exception. The unit is times/hour.

      • Unlimited: The number of retries is unlimited.

      • Limited: The number of retries is user-defined.

    • Restore Job from Checkpoint: This parameter is available only when Enable Checkpointing is selected.

    Idle State Retention Time

    Clears intermediate states of operators such as GroupBy, RegularJoin, Rank, and Depulicate that have not been updated after the maximum retention time. The default value is 1 hour.

    Dirty Data Policy

    Policy for processing dirty data. The following policies are supported: Ignore, Trigger a job exception, and Save.

    If you set this field to Save, the Dirty Data Dump Address must be set. Click the address box to select the OBS path for storing dirty data.

    This parameter is available only when a DIS data source is used.

  8. (Optional) Set the runtime configuration as required.

  9. Click Save.

  10. Click Start. On the displayed Start Flink Jobs page, confirm the job specifications, and click Start Now to start the job.

    After the job is started, the system automatically switches to the Flink Jobs page, and the created job is displayed in the job list. You can view the job status in the Status column. Once a job is successfully submitted, its status changes from Submitting to Running. After the execution is complete, the status changes to Completed.

    If the job status is Submission failed or Running exception, the job fails to submit or run. In this case, you can hover over the status icon in the Status column of the job list to view the error details. You can click image1 to copy these details. Rectify the fault based on the error information and resubmit the job.

    Note

    Other buttons are as follows:

    • Save As: Save the created job as a new job.

    • Static Stream Graph: Provide the static concurrency estimation function and stream graph display function.

    • Simplified Stream Graph: Display the data processing flow from the source to the sink.

    • Format: Format the SQL statements in the editing box.

    • Set as Template: Set the created SQL statements as a job template.

    • Theme Settings: Set the theme related parameters, including Font Size, Wrap, and Page Style.

Simplified Stream Graph¶

On the OpenSource SQL job editing page, click Simplified Stream Graph.

Note

Simplified stream graph viewing is only supported in Flink 1.12 and Flink 1.10.

Static Stream Graph¶

On the OpenSource SQL job editing page, click Static Stream Graph.

Note

  • Simplified stream graph viewing is only supported in Flink 1.12 and Flink 1.10.

  • If you use a UDF in a Flink OpenSource SQL job, it is not possible to generate a static stream graph.

The Static Stream Graph page also allows you to:

  • Estimate concurrencies. Click Estimate Concurrencies on the Static Stream Graph page to estimate concurrencies. Click Restore Initial Value to restore the initial value after concurrency estimation.

  • Zoom in or out the page.

  • Expand or merge operator chains.

  • You can edit Parallelism, Output rate, and Rate factor.

    • Parallelism: indicates the number of concurrent tasks.

    • Output rate: indicates the data traffic of an operator. The unit is piece/s.

    • Rate factor: indicates the retention rate after data is processed by operators. Rate factor = Data output volume of an operator/Data input volume of the operator (Unit: %)

  • Prev
  • Next
last updated: 2025-06-16 14:07 UTC - commit: 2d6c283406071bb470705521bc41e86fa3400203
Edit pageReport Documentation Bug
Page Contents
  • Creating a Flink OpenSource SQL Job
    • Prerequisites
    • Creating a Flink OpenSource SQL Job
    • Simplified Stream Graph
    • Static Stream Graph
© T-Systems International GmbH
  • Contact
  • Data privacy
  • Disclaimer of Liabilities
  • Imprint