All Products
Search
Document Center

Lindorm:CREATE JOB

Last Updated:Mar 28, 2026

CREATE JOB packages one or more Flink SQL statements into a named job and submits it to the Lindorm stream engine for execution. Use it to implement stream processing logic such as filtering, transformation, enrichment, and aggregation, with results written to Lindorm.

Prerequisites

Before you begin, ensure that you have:

  • Stream engine version 3.1.8 or later. CREATE JOB applies only to the stream engine. To check the version or perform a minor version upgrade, go to the Lindorm console.

Syntax

delimiter $$
CREATE JOB job_name
(
    flink_sqls
)
$$
delimiter ;

flink_sqls is one or more semicolon-terminated Flink SQL statements (such as SET, CREATE TABLE, and INSERT INTO) that define the computation logic. All statements are executed together as a single job.

Parameters

ParameterRequiredTypeConstraints
job_nameYesStringLetters, numbers, periods (.), hyphens (-), and underscores (_) only. Cannot start with . or -. Length: 1–255 characters.
flink_sqlsYesFlink SQLOne or more semicolon-terminated Flink SQL statements. For syntax details, see the Flink community documentation.

Example

The following job generates random data using the datagen connector and prints it to the console using the print connector.

delimiter $$
CREATE JOB datagen_job (
  SET 'parallelism.default' = '6';
  CREATE TABLE datagen (
    f_sequence INT,
    f_random INT,
    f_random_str STRING,
    ts AS localtimestamp,
    WATERMARK FOR ts AS ts
  ) WITH (
    'connector' = 'datagen',
    -- optional options --
    'rows-per-second'='5',
    'fields.f_sequence.kind'='sequence',
    'fields.f_sequence.start'='1',
    'fields.f_sequence.end'='50000000',
    'fields.f_random.min'='1',
    'fields.f_random.max'='500',
    'fields.f_random_str.length'='10'
  );

  CREATE TABLE print_table (
    f_sequence INT,
    f_random INT,
    f_random_str STRING
    ) WITH (
    'connector' = 'print'
  );

  INSERT INTO print_table select f_sequence,f_random,f_random_str from datagen;
)
$$
delimiter ;

Verify the job

Run SHOW JOBS; to confirm the job was created.