ETL management
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 |
| INTEGER |
| The degree of parallelism for the task. |
| BOOLEAN |
| Whether to ignore |
| BOOLEAN |
| Whether to ignore |
| STRING |
| How to handle null values during the sink operation. Valid values: |
| STRING | None | Configures a user-defined function (UDF). Format: |
| ANY | None | A stream engine job parameter passed directly to the underlying engine. For example, |
Sink table
Parameter | Required | Description |
| No | The catalog of the sink table. |
| No | The database where the sink table is located. |
| Yes | The name of the sink table. |
| Yes | A column in the sink table to receive data. Specify one |
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 > 10Examples
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_nameBoth DESCRIBE and DESC are valid.
Parameters
Parameter | Required | Description |
| 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: |
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.
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.
Enclose property names in backticks (` `) and property values in single quotation marks ('). For example: parallelism = '2' `.
Property | Type | Default | Description |
| INTEGER |
| The degree of parallelism for the task. |
| BOOLEAN |
| Whether to ignore |
| BOOLEAN |
| Whether to ignore |
| STRING |
| How null values are handled during the sink operation. Valid values: |
| STRING | None | Registers a user-defined function (UDF). Format: |
| ANY | None | A stream engine job parameter, such as |
Sink table
Parameter | Required | Description |
| No | The catalog of the sink table. |
| No | The database where the sink table is located. |
| Yes | The name of the sink table. |
| 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_nameParameters
Parameter | Description |
| Optional. The statement succeeds even if the named ETL task does not exist. |
| 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 negativeEVENT_TIME_LAGvalue (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 |
+---------+---------------+---------+-----------------+-------------+-----------------+-----------+---------------+----------------+