Syntax
ALTER FRAGMENT fragment_id [, ...]
alter_option;
alter_option depends on the operation you want to perform on the fragment.
Clauses
SET PARALLELISM
ALTER FRAGMENT fragment_id [, ...]
SET PARALLELISM { TO | = } { parallelism_number | ADAPTIVE | DEFAULT };
| Parameter or clause | Description |
|---|---|
| SET PARALLELISM | This clause controls the degree of parallelism for specific streaming fragments. This allows fine-grained control over fragment execution, enabling targeted scaling of individual fragments within a streaming job. |
| fragment_id | The ID of the fragment to modify. You can specify multiple fragment IDs separated by commas. To find fragment IDs, query the rw_fragment_parallelism system table. |
| parallelism_number | A fixed number (e.g., 1, 2, 3) that locks the fragment’s parallelism at that value. Setting it to 0 is equivalent to ADAPTIVE. |
| ADAPTIVE | Expands the fragment’s parallelism to all available units in the cluster. |
| DEFAULT | Resets the fragment’s parallelism to inherit from its parent streaming job’s parallelism setting. |
Example
-- Set the parallelism of fragment 5 to 4
ALTER FRAGMENT 5 SET PARALLELISM = 4;
-- Set the parallelism of multiple fragments to adaptive
ALTER FRAGMENT 10, 11, 12 SET PARALLELISM = ADAPTIVE;
-- Reset fragment parallelism to inherit from the job
ALTER FRAGMENT 7 SET PARALLELISM = DEFAULT;
SET BACKFILL_RATE_LIMIT
ALTER FRAGMENT fragment_id
SET BACKFILL_RATE_LIMIT { TO | = } rate_limit_number;
| Parameter or clause | Description |
|---|---|
| SET BACKFILL_RATE_LIMIT | This clause controls the rate limit for backfilling operations on the specified fragment. |
| fragment_id | The ID of the fragment to modify. Only a single fragment ID is supported for this operation. |
| rate_limit_number | The rate limit value in records per second. Set to 0 to pause backfilling. |
Example
-- Set backfill rate limit for fragment 3
ALTER FRAGMENT 3 SET BACKFILL_RATE_LIMIT = 1000;
-- Pause backfilling for fragment 3
ALTER FRAGMENT 3 SET BACKFILL_RATE_LIMIT = 0;
See also
- System catalogs — View fragment information using
rw_fragment_parallelismandrw_fragments