INFO

To modify the SQL definition of a sink, please refer to Alter a streaming job.

Syntax

ALTER SINK sink_name
    alter_option;

alteroption depends on the operation you want to perform on the sink. For all supported clauses, see the sections below.

Clause

OWNER TO

ALTER SINK sink_name
    OWNER TO new_user;
Parameter or clauseDescription
OWNER TOThis clause changes the owner of the sink. This will cascadingly change all related internal-objects as well.
new_userThe new owner you want to assign to the sink.
-- Change the owner of the sink named "sink1" to user "user1"
ALTER SINK sink1 OWNER TO user1;

SET SCHEMA

ALTER SINK sink_name
    SET SCHEMA schema_name;
Parameter or clauseDescription
SET SCHEMAThis clause moves the sink to a different schema.
schema_nameThe name of the schema to which the sink will be moved.
-- Move the sink named "test_sink" to the schema named "test_schema"
ALTER SINK test_sink SET SCHEMA test_schema;

SET PARALLELISM

ALTER SINK sink_name
SET PARALLELISM = parallelism_number;
Parameter or clauseDescription
SET PARALLELISMThis clause controls the degree of parallelism for the targeted streaming job.
parallelism_numberThis parameter can be ADAPTIVE or a fixed number, like 1, 2, 3, etc. Altering the parameter to ADAPTIVE will expand the streaming job’s degree of parallelism to encompass all available units, whereas setting it to a fixed number will lock the job’s parallelism at that specific figure. Setting it to 0 is equivalent to ADAPTIVE.
-- Set the parallelism of the sink "s" to 4.
ALTER SINK s SET PARALLELISM = 4;

RENAME TO

ALTER SINK sink_name
    RENAME TO new_name;
Parameter or clauseDescription
RENAME TOThis clause changes the name of the sink.
new_nameThe new name of the sink.
-- Change the name of the sink named "sink0" to "sink1"
ALTER SINK sink0 RENAME TO sink1;

SWAP WITH

ALTER SINK name
SWAP WITH target_name;
ParameterDescription
nameThe current name of the sink to swap.
target_nameThe target name of the sink you want to swap with.
-- Swap the names of the log_sink sink and the error_sink sink.
ALTER SINK log_sink
SWAP WITH error_sink;