Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document alter source pause/resume #186

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/product-lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
57 changes: 39 additions & 18 deletions sql/commands/sql-alter-source.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,44 @@ ALTER SOURCE src1
</Note>



### `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.
Expand Down Expand Up @@ -92,23 +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`

```sql
Expand Down Expand Up @@ -169,4 +190,4 @@ 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;
```
```
Loading