ALTER ETL modifies a running ETL task — its properties, SQL query, or both.
Only tasks in the RUNNING state can be modified.
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.
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 |
|---|---|---|---|
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.