ETL management

Updated at:

This topic describes ETL management SQL statements in the Lindorm stream engine, including creating, describing, altering, dropping, and listing ETL tasks.

Engine and version

Applies to the stream engine only. Requires version 3.1.8 or later.

To check or update your minor version, see Upgrade the minor engine version.

CREATE ETL

CREATE ETL creates an extract, transform, and load (ETL) task in the Lindorm stream engine. The task continuously reads data from a source table, applies a SQL filter, and writes matching rows to a sink table.

Syntax

CREATE ETL [IF NOT EXISTS] etl_name
    [WITH (
        `property_name` = 'property_value'
        [, `property_name` = 'property_value'] ...
    )]
    AS INSERT INTO [[catalog_name.]db_name.]table_name (column_name [, column_name] ...)
    SELECT column_name [, column_name] ...
    FROM [[catalog_name.]db_name.]source_table_name
    [WHERE condition]

Enclose property names in backticks (`) and property values in single quotation marks ('). For example: `parallelism` = '2'.

Parameters

ETL name

The etl_name parameter is required and must follow these rules:

  • Allowed characters: digits, letters (uppercase and lowercase), periods (.), hyphens (-), and underscores (_)

  • Cannot start with a period (.) or a hyphen (-)

  • Length: 1–255 characters

ETL properties

Use the WITH clause to configure the following properties:

Property

Type

Default

Description

parallelism

INTEGER

1

The degree of parallelism for the task.

sink.ignore-update-before

BOOLEAN

false

Whether to ignore -U records during the sink operation.

sink.ignore-delete

BOOLEAN

false

Whether to ignore -D records during the sink operation. Set to true to skip delete records at the sink.

sink.null-mode

STRING

NO_OP

How to handle null values during the sink operation. Valid values: NO_OP (retain and write null values from the source) and SKIP (skip and do not write null values).

udf.xxxx

STRING

None

Configures a user-defined function (UDF). Format: `udf.<udfFunction>` = '<jarName>#<className>', where udfFunction is the function name, jarName is the JAR file name, and className is the class name. Upload the JAR file before using this property.

stream.xxx

ANY

None

A stream engine job parameter passed directly to the underlying engine. For example, `stream.execution.checkpointing.interval` = '30000' sets the checkpointing interval.

Sink table

Parameter

Required

Description

catalog_name

No

The catalog of the sink table.

db_name

No

The database where the sink table is located.

table_name

Yes

The name of the sink table.

column_name

Yes

A column in the sink table to receive data. Specify one column_name entry for each column.

SELECT statement

The SELECT statement filters and maps data from the source table. For example:

SELECT p1, c1 FROM `lindorm_table`.`default`.`source` WHERE c1 > 10

Examples

The following examples use these source and sink tables:

-- Source table
CREATE TABLE source (p1 INT, c1 DOUBLE, PRIMARY KEY (p1));
-- Sink table
CREATE TABLE sink   (p1 INT, c1 DOUBLE, PRIMARY KEY (p1));

Example 1: Create a basic ETL task

Filter rows where c1 > 10 from source and insert them into sink.

CREATE ETL IF NOT EXISTS filter1
AS
  INSERT INTO `lindorm_table`.`default`.`sink` (p1, c1)
  SELECT p1, c1 FROM `lindorm_table`.`default`.`source` WHERE c1 > 10;

Example 2: Create an ETL task with properties

This task inserts data that meets the specified conditions from the source table source into the sink table sink and adds properties.

CREATE ETL IF NOT EXISTS filter2
WITH (
  `parallelism` = '2',
  `stream.execution.checkpointing.interval` = '30000'
)
AS
  INSERT INTO `lindorm_table`.`default`.`sink` (p1, c1)
  SELECT p1, c1 FROM `lindorm_table`.`default`.`source` WHERE c1 > 10;

DESCRIBE ETL

Returns the details of a specified ETL task, including its schema, data insertion logic, current status, and resource group assignment.

Syntax

{ DESCRIBE | DESC } ETL etl_name

Both DESCRIBE and DESC are valid.

Parameters

Parameter

Required

Description

etl_name

Yes

The name of the ETL task to query.

Result set

Field

Description

ETL_ID

The name of the ETL task.

ETL_VERSION

The version of the ETL task.

SOURCE_SCHEMA

The fields of the source table.

SINK_SCHEMA

The fields of the sink table.

CONTENT

The complete data insertion logic of the ETL task.

ATTRIBUTES

The ETL properties (etl_properties) set when the task was created. Empty if no properties were set.

STATUS

The status of the ETL task. Valid values: SUBMIT (submitted), RUNNING (running), DELETE (being deleted).

RESOURCE_GROUP

The resource group the task is using. To change it, use the SET statement.

CREATE_USER

The user who created the ETL task.

CREATE_TIME

The time when the ETL task was created.

Example

Query the details of the ETL task filter1 in the current resource group.

DESC ETL filter1;

Result:

+---------+---------------+------------------------------------------+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+------------+---------+------------------+-------------+------------------------------+
| ETL_ID  | ETL_VERSION   | SOURCE_SCHEMA                            | SINK_SCHEMA                            | CONTENT                                                                                                                             | ATTRIBUTES | STATUS  | RESOURCE_GROUP   | CREATE_USER | CREATE_TIME                  |
+---------+---------------+------------------------------------------+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+------------+---------+------------------+-------------+------------------------------+
| filter1 | 1747293558894 | `lindorm_table`.`default`.`source`:p1,c1 | `lindorm_table`.`default`.`sink`:p1,c1 | INSERT INTO `lindorm_table`.`default`.`sink` (`p1`, `c1`) SELECT `p1`, `c1` FROM `lindorm_table`.`default`.`source` WHERE `c1` > 10 | {}         | RUNNING | lstream-e00s**** | r***        | Thu May 15 15:19:18 CST 2025 |
+---------+---------------+------------------------------------------+----------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+------------+---------+------------------+-------------+------------------------------+

ALTER ETL

ALTER ETL modifies a running ETL task — its properties, SQL query, or both.

Note

Only tasks in the RUNNING state can be modified.

Syntax

ALTER ETL etl_name
    [WITH etl_properties]
    AS INSERT INTO [[catalog_name.]db_name.]table_name column_list
    select_statement

etl_properties      ::= '(' property_definition (',' property_definition)* ')'
property_definition ::= property_name '=' property_value
column_list         ::= '(' column_name (',' column_name)* ')'

Parameters

etl_name

Required. The name of the ETL task to modify.

ETL properties (WITH clause)

Use the WITH clause to update task properties.

Important

Enclose property names in backticks (` `) and property values in single quotation marks ('). For example: parallelism = '2' `.

Property

Type

Default

Description

parallelism

INTEGER

1

The degree of parallelism for the task.

sink.ignore-update-before

BOOLEAN

false

Whether to ignore -U (update-before) records during the sink operation.

sink.ignore-delete

BOOLEAN

false

Whether to ignore -D (delete) records during the sink operation.

sink.null-mode

STRING

NO_OP

How null values are handled during the sink operation. Valid values: NO_OP (write null values from the source) and SKIP (drop null values).

udf.<udfFunction>

STRING

None

Registers a user-defined function (UDF). Format: udf.<udfFunction> = <jarName>#<className>. Upload the JAR file before using this property.

stream.<parameter>

ANY

None

A stream engine job parameter, such as stream.execution.checkpointing.interval.

Sink table

Parameter

Required

Description

catalog_name

No

The catalog of the sink table.

db_name

No

The database where the sink table is located.

table_name

Yes

The name of the sink table.

column_name

Yes

A column name in the sink table.

select_statement

The new SQL query for the ETL task.

Examples

The following examples use these tables in LindormTable:

-- Source table
CREATE TABLE source (p1 INT, c1 DOUBLE, PRIMARY KEY(p1));

-- Sink table
CREATE TABLE sink (p1 INT, c1 DOUBLE, PRIMARY KEY(p1));

All examples modify an ETL task named filter2, which was created with the following statement:

CREATE ETL IF NOT EXISTS filter2
WITH (
    `parallelism` = '2',
    `stream.execution.checkpointing.interval` = '30000'
)
AS
    INSERT INTO `lindorm_table`.`default`.`sink` (p1, c1)
    SELECT p1, c1 FROM `lindorm_table`.`default`.`source` WHERE c1 > 10;

Modify task properties

Change the parallelism property to 4:

ALTER ETL filter2
WITH (`parallelism` = '4')
AS
    INSERT INTO `lindorm_table`.`default`.`sink` (p1, c1)
    SELECT p1, c1 FROM `lindorm_table`.`default`.`source`;

Verify the result

Run DESC ETL filter2; and check the ATTRIBUTES field to confirm that the changes took effect.

DROP ETL

Deletes an ETL task from the current resource group.

Syntax

DROP ETL [ IF EXISTS ] etl_name

Parameters

Parameter

Description

IF EXISTS

Optional. The statement succeeds even if the named ETL task does not exist.

etl_name

The name of the ETL task to delete.

Examples

Delete an ETL task

DROP ETL filter2;

Delete an ETL task without raising an error if it does not exist

DROP ETL IF EXISTS filter2;

Verify the result

Run SHOW ETLS; to confirm the task has been removed.

SHOW ETLS

SHOW ETLS lists all extract, transform, and load (ETL) tasks in the current resource group, or filters tasks by name using a wildcard pattern.

Syntax

show_etls_statement ::= SHOW ETLS [ LIKE string_literal ]

Usage notes

LIKE clause

The LIKE clause accepts a string literal that the system uses to perform a wildcard match on system properties. The string literal supports two wildcard characters:

  • %: Matches zero or more characters.

  • _: Matches exactly one character.

Output fields

Field

Description

ETL_ID

The name of the ETL task.

ETL_VERSION

The version number of the ETL task. Only the latest version is shown.

STATUS

The status of the ETL task. See Task status.

JOB_RESTART_NUM

The number of times the ETL task has been restarted.

NUM_RECORDS

The number of data records processed by the ETL task.

RECORDS_PER_SEC

The number of records processed per second.

NUM_BYTES

The total amount of data processed, in bytes.

BYTES_PER_SEC

The amount of data processed per second, in bytes.

EVENT_TIME_LAG

The data processing latency, in milliseconds (ms).

A negative EVENT_TIME_LAG value (for example, -1.0) indicates no data is currently flowing into the ETL task.

Task status

Status

Description

SUBMIT

The task is submitted.

RUNNING

The task is currently running.

DELETE

The task is being deleted.

Examples

List all ETL tasks

SHOW ETLS;

Output:

+---------+---------------+---------+-----------------+-------------+-----------------+-----------+---------------+----------------+
| ETL_ID  | ETL_VERSION   | STATUS  | JOB_RESTART_NUM | NUM_RECORDS | RECORDS_PER_SEC | NUM_BYTES | BYTES_PER_SEC | EVENT_TIME_LAG |
+---------+---------------+---------+-----------------+-------------+-----------------+-----------+---------------+----------------+
| filter1 | 1753940184757 | RUNNING | 0               | 0.0         | 0.0             | 0.0       | 0.0           | -1.0           |
| filter2 | 1753945414775 | RUNNING | 0               | 0.0         | 0.0             | 0.0       | 0.0           | -1.0           |
+---------+---------------+---------+-----------------+-------------+-----------------+-----------+---------------+----------------+

Filter tasks by name pattern

List all ETL tasks whose names start with filter:

SHOW ETLS LIKE 'filter%';

Output:

+---------+---------------+---------+-----------------+-------------+-----------------+-----------+---------------+----------------+
| ETL_ID  | ETL_VERSION   | STATUS  | JOB_RESTART_NUM | NUM_RECORDS | RECORDS_PER_SEC | NUM_BYTES | BYTES_PER_SEC | EVENT_TIME_LAG |
+---------+---------------+---------+-----------------+-------------+-----------------+-----------+---------------+----------------+
| filter1 | 1753940184757 | RUNNING | 0               | 0.0         | 0.0             | 0.0       | 0.0           | -1.0           |
| filter2 | 1753945414775 | RUNNING | 0               | 0.0         | 0.0             | 0.0       | 0.0           | -1.0           |
+---------+---------------+---------+-----------------+-------------+-----------------+-----------+---------------+----------------+