Skip to content

Commit 51dc0ba

Browse files
authored
docs: add create pipe sql reference (#3166)
1 parent 3eaa9e3 commit 51dc0ba

6 files changed

Lines changed: 92 additions & 2 deletions

File tree

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
{"label":"Pipe","position":17}
1+
{
2+
"label": "Pipe",
3+
"position": 17
4+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: CREATE PIPE
3+
sidebar_position: 1
4+
---
5+
6+
创建一个基于 `COPY INTO <table>` 语句的 pipe。
7+
8+
## 语法
9+
10+
```sql
11+
CREATE PIPE [ IF NOT EXISTS ] <name>
12+
[ AUTO_INGEST = TRUE ]
13+
[ COMMENT = '<comment>' | COMMENTS = '<comment>' ]
14+
AS
15+
COPY INTO <table> ...
16+
```
17+
18+
## 参数
19+
20+
| 参数 | 说明 |
21+
|-----------|-------------|
22+
| `IF NOT EXISTS` | 可选。如果 pipe 已存在,则成功返回但不做修改。 |
23+
| `AUTO_INGEST = TRUE` | 可选。启用自动导入。 |
24+
| `COMMENT` / `COMMENTS` | 可选的 pipe 备注。 |
25+
| `AS COPY INTO ...` | pipe 执行的 `COPY INTO <table>` 语句。 |
26+
27+
## 示例
28+
29+
```sql
30+
CREATE PIPE IF NOT EXISTS my_pipe
31+
AUTO_INGEST = TRUE
32+
COMMENTS = 'load staged files into target table'
33+
AS
34+
COPY INTO my_table
35+
FROM @my_stage;
36+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
---
22
title: Pipe
33
---
4+
5+
Databend 中导入管道相关的 SQL 命令。
6+
7+
## 命令参考
8+
49
| 命令 | 描述 |
510
|---------|-------------|
11+
| [CREATE PIPE](create-pipe.md) | 创建基于 `COPY INTO` 的 pipe |
612
| [DESCRIBE PIPE](describe-pipe.md) | 显示 pipe 属性 |
713
| [DROP PIPE](drop-pipe.md) | 删除 pipe |
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
{"label":"Pipe","position":17}
1+
{
2+
"label": "Pipe",
3+
"position": 17
4+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: CREATE PIPE
3+
sidebar_position: 1
4+
---
5+
6+
Creates a pipe backed by a `COPY INTO <table>` statement.
7+
8+
## Syntax
9+
10+
```sql
11+
CREATE PIPE [ IF NOT EXISTS ] <name>
12+
[ AUTO_INGEST = TRUE ]
13+
[ COMMENT = '<comment>' | COMMENTS = '<comment>' ]
14+
AS
15+
COPY INTO <table> ...
16+
```
17+
18+
## Parameters
19+
20+
| Parameter | Description |
21+
|-----------|-------------|
22+
| `IF NOT EXISTS` | Optional. Succeeds without changes if the pipe already exists. |
23+
| `AUTO_INGEST = TRUE` | Optional. Enables automatic ingestion. |
24+
| `COMMENT` / `COMMENTS` | Optional pipe comment. |
25+
| `AS COPY INTO ...` | The `COPY INTO <table>` statement executed by the pipe. |
26+
27+
## Example
28+
29+
```sql
30+
CREATE PIPE IF NOT EXISTS my_pipe
31+
AUTO_INGEST = TRUE
32+
COMMENTS = 'load staged files into target table'
33+
AS
34+
COPY INTO my_table
35+
FROM @my_stage;
36+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
---
22
title: Pipe
33
---
4+
5+
Pipe-related SQL commands for ingestion pipelines in Databend.
6+
7+
## Command Reference
8+
49
| Command | Description |
510
|---------|-------------|
11+
| [CREATE PIPE](create-pipe.md) | Creates a pipe backed by a `COPY INTO` statement |
612
| [DESCRIBE PIPE](describe-pipe.md) | Shows pipe properties |
713
| [DROP PIPE](drop-pipe.md) | Deletes a pipe |

0 commit comments

Comments
 (0)