> ## Documentation Index
> Fetch the complete documentation index at: https://risingwavelabs-wyx-add-timestamp-dedicated-page.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ALTER SINK

> The `ALTER SINK` command modifies the metadata of a sink.

<Note>
  INFO

  To modify the SQL definition of a sink, please refer to [Alter a streaming job](/operate/alter-streaming).
</Note>

## Syntax

```sql theme={null}
ALTER SINK sink_name
    alter_option;
```

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

## Clause

### `OWNER TO`

```sql theme={null}
ALTER SINK sink_name
    OWNER TO new_user;
```

| Parameter or clause | Description                                                                                                   |
| :------------------ | :------------------------------------------------------------------------------------------------------------ |
| **OWNER TO**        | This clause changes the owner of the sink. This will cascadingly change all related internal-objects as well. |
| *new\_user*         | The new owner you want to assign to the sink.                                                                 |

```sql theme={null}
-- Change the owner of the sink named "sink1" to user "user1"
ALTER SINK sink1 OWNER TO user1;
```

### `SET SCHEMA`

```sql theme={null}
ALTER SINK sink_name
    SET SCHEMA schema_name;
```

| Parameter or clause | Description                                             |
| :------------------ | :------------------------------------------------------ |
| **SET SCHEMA**      | This clause moves the sink to a different schema.       |
| *schema\_name*      | The name of the schema to which the sink will be moved. |

```sql theme={null}
-- Move the sink named "test_sink" to the schema named "test_schema"
ALTER SINK test_sink SET SCHEMA test_schema;
```

### `SET PARALLELISM`

```sql theme={null}
ALTER SINK sink_name
SET PARALLELISM { TO | = } parallelism_number;
```

| Parameter or clause | Description                                                                                                                                                                                                             |
| :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **SET PARALLELISM** | This clause controls the degree of [parallelism](/reference/key-concepts#parallelism) for the targeted [streaming job](/reference/key-concepts#streaming-queries).                                                      |
| parallelism\_number | Can be ADAPTIVE or a fixed number (e.g., 1, 2, 3). Setting it to ADAPTIVE expands the job's parallelism to all available units, while a fixed number locks it at that value. Setting it to 0 is equivalent to ADAPTIVE. |

```sql theme={null}
-- Set the parallelism of the sink "s" to 4.
ALTER SINK s SET PARALLELISM = 4;
```

### `SET SINK_RATE_LIMIT`

```sql theme={null}
ALTER SINK sink_name
    SET SINK_RATE_LIMIT { TO | = } { default | rate_limit_number };
```

Use this statement to modify the rate limit of a sink. For the specific value of `SINK_RATE_LIMIT`, refer to [How to view runtime parameters](/operate/view-configure-runtime-parameters/#how-to-view-runtime-parameters).

```sql Example theme={null}
-- Alter the rate limit of a sink to default
ALTER SINK s1 SET SINK_RATE_LIMIT = default;

-- Alter the rate limit of a sink to 1000
ALTER SINK s1 SET SINK_RATE_LIMIT = 1000;
```

### `RENAME TO`

```sql theme={null}
ALTER SINK sink_name
    RENAME TO new_name;
```

| Parameter or clause | Description                               |
| :------------------ | :---------------------------------------- |
| **RENAME TO**       | This clause changes the name of the sink. |
| *new\_name*         | The new name of the sink.                 |

```sql theme={null}
-- Change the name of the sink named "sink0" to "sink1"
ALTER SINK sink0 RENAME TO sink1;
```

### `SWAP WITH`

```sql theme={null}
ALTER SINK name
SWAP WITH target_name;
```

| Parameter      | Description                                        |
| :------------- | :------------------------------------------------- |
| *name*         | The current name of the sink to swap.              |
| *target\_name* | The target name of the sink you want to swap with. |

```sql theme={null}
-- Swap the names of the log_sink sink and the error_sink sink.
ALTER SINK log_sink
SWAP WITH error_sink;
```
