From 0c6b6940e468f18fff145b575779e13102376354 Mon Sep 17 00:00:00 2001 From: WanYixian Date: Tue, 7 Jan 2025 15:15:55 +0800 Subject: [PATCH 1/4] Update sql-alter-source.mdx --- sql/commands/sql-alter-source.mdx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/sql/commands/sql-alter-source.mdx b/sql/commands/sql-alter-source.mdx index 2acf6055..31d4f931 100644 --- a/sql/commands/sql-alter-source.mdx +++ b/sql/commands/sql-alter-source.mdx @@ -169,4 +169,27 @@ SWAP WITH target_name; -- Swap the names of the api_data source and the file_data source. ALTER SOURCE api_data SWAP WITH file_data; -``` \ No newline at end of file +``` + +### `PAUSE` | `RESUME` + +```sql +ALTER SOURCE source_name + { PAUSE | RESUME }; +``` + +| Parameter or clause | Description | +| :----------------- | :---------- | +| **PAUSE** | Temporarily stops the source by setting its `source_rate_limit` to 0. | +| **RESUME** | Restarts the source by removing the rate limit. | + +```sql +-- Pause a source named "kafka_source". +ALTER SOURCE kafka_source PAUSE; + +-- Resume a previously paused source. +ALTER SOURCE kafka_source RESUME; +``` + + + From e36273d4c3d2ed034b16fb66e51bdfd94f9df717 Mon Sep 17 00:00:00 2001 From: WanYixian Date: Tue, 7 Jan 2025 15:17:39 +0800 Subject: [PATCH 2/4] sort --- sql/commands/sql-alter-source.mdx | 72 ++++++++++++++++--------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/sql/commands/sql-alter-source.mdx b/sql/commands/sql-alter-source.mdx index 31d4f931..9e01f7ce 100644 --- a/sql/commands/sql-alter-source.mdx +++ b/sql/commands/sql-alter-source.mdx @@ -40,6 +40,44 @@ ALTER SOURCE src1 + +### `OWNER TO` + +```sql +ALTER SOURCE current_source_name + OWNER TO new_user; +``` + +| Parameter or clause | Description | +| :------------------ | :---------------------------------------------- | +| **OWNER TO** | This clause changes the owner of the source. | +| _new\_user_ | The new owner you want to assign to the source. | + +```sql +-- Change the owner of the source named "src" to user "user1" +ALTER SOURCE src OWNER TO user1; +``` + +### `PAUSE` | `RESUME` + +```sql +ALTER SOURCE source_name + { PAUSE | RESUME }; +``` + +| Parameter or clause | Description | +| :----------------- | :---------- | +| **PAUSE** | Temporarily stops the source by setting its `source_rate_limit` to 0. | +| **RESUME** | Restarts the source by removing the rate limit. | + +```sql +-- Pause a source named "kafka_source". +ALTER SOURCE kafka_source PAUSE; + +-- Resume a previously paused source. +ALTER SOURCE kafka_source RESUME; +``` + ### `REFRESH SCHEMA` Fetch the latest schema from the schema registry and update the source schema. @@ -92,22 +130,6 @@ ALTER SOURCE src RENAME TO src1; ``` -### `OWNER TO` - -```sql -ALTER SOURCE current_source_name - OWNER TO new_user; -``` - -| Parameter or clause | Description | -| :------------------ | :---------------------------------------------- | -| **OWNER TO** | This clause changes the owner of the source. | -| _new\_user_ | The new owner you want to assign to the source. | - -```sql --- Change the owner of the source named "src" to user "user1" -ALTER SOURCE src OWNER TO user1; -``` ### `SET SCHEMA` @@ -171,25 +193,7 @@ ALTER SOURCE api_data SWAP WITH file_data; ``` -### `PAUSE` | `RESUME` - -```sql -ALTER SOURCE source_name - { PAUSE | RESUME }; -``` - -| Parameter or clause | Description | -| :----------------- | :---------- | -| **PAUSE** | Temporarily stops the source by setting its `source_rate_limit` to 0. | -| **RESUME** | Restarts the source by removing the rate limit. | -```sql --- Pause a source named "kafka_source". -ALTER SOURCE kafka_source PAUSE; - --- Resume a previously paused source. -ALTER SOURCE kafka_source RESUME; -``` From 300eb2086748ee101310d8ad3392331ebc5f24b8 Mon Sep 17 00:00:00 2001 From: WanYixian Date: Tue, 7 Jan 2025 15:26:44 +0800 Subject: [PATCH 3/4] public preview --- changelog/product-lifecycle.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog/product-lifecycle.mdx b/changelog/product-lifecycle.mdx index d9c73fa5..6168a208 100644 --- a/changelog/product-lifecycle.mdx +++ b/changelog/product-lifecycle.mdx @@ -22,6 +22,7 @@ Below is a list of all features in the public preview phase: | Feature name | Start version | | :-- | :-- | +| [ALTER SOURCE pause/resume](/sql/commands/sql-alter-source#pause-resume)| 2.2 | | [Ingest data from MySQL table](/integrations/sources/mysql-table)| 2.2 | | [EXPLAIN FORMAT JSON](/sql/commands/sql-explain#explain-options)| 2.2 | | [Ingest data from Postgres table](/integrations/sources/postgresql-table) | 2.1 | From 94786ff352d520c051f578570daafc163b8c52c5 Mon Sep 17 00:00:00 2001 From: WanYixian Date: Tue, 7 Jan 2025 15:29:46 +0800 Subject: [PATCH 4/4] Update sql-alter-source.mdx --- sql/commands/sql-alter-source.mdx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sql/commands/sql-alter-source.mdx b/sql/commands/sql-alter-source.mdx index 9e01f7ce..b0afaadd 100644 --- a/sql/commands/sql-alter-source.mdx +++ b/sql/commands/sql-alter-source.mdx @@ -130,7 +130,6 @@ ALTER SOURCE src RENAME TO src1; ``` - ### `SET SCHEMA` ```sql @@ -192,8 +191,3 @@ SWAP WITH target_name; ALTER SOURCE api_data SWAP WITH file_data; ``` - - - - -