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
  • VPC Endpoint
  • Virtual Private Network
Storage
  • Cloud Backup and Recovery
  • Cloud Server Backup Service
  • Elastic Volume Service
  • Object Storage Service
  • Storage Disaster Recovery Service
  • Scalable File Service
  • Volume Backup Service
Application Services
  • Application Operations Management
  • Application Performance Management
  • API Gateway (APIG)
  • Distributed Message Service
  • Simple Message Notification
Database Services
  • Distributed Cache Service
  • Document Database Service
  • Data Replication Service
  • GaussDB (for MySQL)
  • GeminiDB
  • Relational Database Service
Big Data and Data Analysis
  • Cloud Search Service
  • DataArts Studio
  • Data Ingestion Service
  • Data Lake Insight
  • Data Warehouse Service
  • ModelArts
  • MapReduce Service
  • Optical Character Recognition
Container Services
  • Cloud Container Engine
  • Software Repository for Containers
Applications and Databases
  • Anti DDoS
  • Database Security Service
  • Host Security Service
  • Web Application Firewall
  • Dedicated Web Application Firewall
Identity and Access Management
  • Identity and Access Management Service
Key Management
  • Key Management Service
Compliance
  • Core Services Certifications
Monitoring and Logging
  • Cloud Eye
  • Cloud Trace Service
  • Log Tank Service
Resource Management
  • Cloud Create
  • Resource Management Service
  • Tag Management Service
Other
  • Enterprise Dashboard
  • Price API
  • Price Calculator
APIs
  • REST API
  • API Usage Guidelines
  • Endpoints
Development and Automation
  • SDKs
  • Drivers and Tools
  • Terraform
  • Ansible
  • Cloud Create
Architecture Center
  • Best Practices
  • Blueprints
Other
  • Status Dashboard
  • Portfolio Roadmap
  • Training Certifications
IaaSComputingAuto ScalingBare Metal ServerDedicated HostElastic Cloud ServerFunctionGraphImage Management ServiceNetworkDirect ConnectDomain Name ServiceElastic IPElastic Load BalancingEnterprise RouterNAT GatewayPrivate Link Access ServiceSecure Mail GatewayVirtual Private CloudVPC EndpointVirtual Private NetworkStorageCloud Backup and RecoveryCloud Server Backup ServiceElastic Volume ServiceObject Storage ServiceStorage Disaster Recovery ServiceScalable File ServiceVolume Backup ServicePaaSApplications ServicesApplication Operation ManagementApplication Performance ManagementAPI Gateway (APIG)Distributed Message ServiceSimple Message NotificationDatabase ServicesDistributed Cache ServiceDocument Database ServiceData Replication ServiceGaussDB (for MySQL)GeminiDBRelational Database ServiceBig Data and Data AnalysisCloud Search ServiceDataArts StudioData Ingestion ServiceData Lake InsightData Warehouse ServiceModelArtsMapReduce ServiceOptical Character RecognitionContainer ServicesCloud Container EngineSoftware Repository for ContainersSecurityApplications and DatabasesAnti DDoSDatabase Security ServiceHost Security ServiceWeb Application FirewallDedicated Web Application FirewallIdentity and Access ManagementIdentity and Access Management ServiceKey ManagementKey Management ServiceComplianceCore Services CertificationsManagementMonitoring and LoggingCloud EyeCloud Tracking ServiceLog Tank ServiceResource ManagementCloud CreateResource Management ServiceTag Management ServiceOtherEnterprise DashboardPrice APIPrice CalculatorDevelopersAPIsREST APIAPI Usage GuidelinesEndpointsAutomation and DevelopmentSDKsDrivers and ToolsTerraformAnsibleCloud CreateArchitecture CenterBest PracticesBlueprintsOtherStatus DashboardPortfolio RoadmapTraining Certifications

Data Lake Insight

  • Service Overview
  • Getting Started
  • DLI Console Overview
  • SQL Editor
  • Job Management
    • Overview
    • SQL Job Management
    • Flink Job Management
      • Overview
      • Managing Flink Job Permissions
      • Preparing Flink Job Data
      • (Recommended) Creating a Flink OpenSource SQL Job
      • Creating a Flink SQL Job
      • Creating a Flink Jar Job
      • Performing Operations on a Flink Job
      • Flink Job Details
      • Tag Management
      • Enabling Dynamic Scaling for Flink Jobs
    • Spark Job Management
    • Setting the Priority for a Job
  • Queue Management
  • Elastic Resource Pool
  • Data Management
  • Job Templates
  • Enhanced Datasource Connections
  • Datasource Authentication
  • Global Configuration
  • Permissions Management
  • Other Common Operations
  • FAQ
  • Change History
  • User Guide
  • Job Management
  • Flink Job Management
  • Creating a Flink SQL Job

Creating a Flink SQL Job¶

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.

Prerequisites¶

  • You have prepared the data input and data output channels. For details, see Preparing Flink Job Data.

  • When you use a Flink SQL job to access other external data sources, such as OpenTSDB, HBase, Kafka, GaussDB(DWS), RDS, CSS, CloudTable, DCS Redis, and DDS, you need to create a datasource connection to connect the job running queue to the external data source.

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

    • For details about how to create a datasource connection, see Enhanced Datasource Connections. After a datasource connection is created, you can choose More > Test Address Connectivity in the Operation column on the Queue Management page to check whether the network connection between the queue and the external data source is normal. For details, see Testing Address Connectivity.

Creating a Flink 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. Specify job parameters.

    Table 1 Job configuration information¶

    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

    • 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, digits, 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, digits, spaces, and special characters (_.:=+-@) are allowed. The value cannot start or end with a space.

  4. Click OK to enter the editing page.

  5. Edit a Flink SQL job.

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

  6. Click Check Semantics.

    • You can Debug or 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.

  7. Set job running parameters.

    Table 2 Running parameters¶

    Parameter

    Description

    Queue

    A shared queue is selected by default. You can select a custom queue as needed.

    Note

    • During job creation, a sub-user can only select a queue that has been allocated to the user.

    • If the remaining capacity of the selected queue cannot meet the job requirements, the system automatically scales up the capacity. When a queue is idle, the system automatically scales in the queue.

    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 Data Management > Package Management 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

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

    • The priority of the number of parallel tasks on this page is lower than that set in the code.

    Task Manager Configuration

    Whether to set Task Manager resource parameters

    If this option is 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.

    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

    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:

    • Checkpoint Interval indicates the interval for creating checkpoints. 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.

    • OBS Bucket: Select an OBS bucket to store your checkpoints. If the selected OBS bucket is not authorized, 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 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:

    • Max. Retry Attempts: maximum number of retry times 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

    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.

  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. After a job is successfully submitted, the job status will change from Submitting to Running. After the execution is complete, the message Completed is displayed.

    If the job status is Submission failed or Running exception, 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 Status column of the job list to view the error details. You can click image1 to copy error information. After handling the fault based on the provided information, resubmit the job.

    Note

    Other available buttons are as follows:

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

    • 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.

  • Prev
  • Next
last updated: 2025-04-11 13:47 UTC - commit: aa96e2e0eed630617f88dab58364d89a112d472d
Edit pageReport Documentation Bug
Page Contents
  • Creating a Flink SQL Job
    • Prerequisites
    • Creating a Flink SQL Job
© T-Systems International GmbH
  • Contact
  • Data privacy
  • Disclaimer of liabilitys
  • Imprint