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

docs: SHOW FLOW & FLOWS table info #1079

Merged
merged 6 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
35 changes: 35 additions & 0 deletions docs/nightly/en/reference/sql/information-schema/flows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# FLOWS
The `Flows` table provides the flow task information.

```sql
public=> DESC TABLE INFORMATION_SCHEMA.FLOWS;
```

```sql
Column | Type | Key | Null | Default | Semantic Type
------------------+--------+-----+------+---------+---------------
flow_name | String | | NO | | FIELD
flow_id | UInt32 | | NO | | FIELD
table_catalog | String | | NO | | FIELD
flow_definition | String | | NO | | FIELD
comment | String | | YES | | FIELD
expire_after | Int64 | | YES | | FIELD
source_table_ids | String | | YES | | FIELD
sink_table_name | String | | NO | | FIELD
flownode_ids | String | | YES | | FIELD
options | String | | YES | | FIELD
(10 rows)
```

The columns in table:

* `flow_name`: the flow task's name.
* `flow_id`: the flow task's id.
* `table_catalog`: the catalog this flow belongs to, named as `table_catalog` to keep consistent with the `INFORMATION_SCHEMA` standard.
* `flow_definition`: the flow task's definition. It's the SQL statement used to create the flow task.
* `comment`: the comment of the flow task.
* `expire_after`: the expire time of the flow task.
* `source_table_ids`: the source table ids of the flow task.
* `sink_table_name`: the sink table name of the flow task.
* `flownode_ids`: the flownode ids used by the flow task.
* `options`: extra options of the flow task.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ There is still lots of work to do for `INFORMATION_SCHEMA`. The tracking [issue]
| [`REGION_PEERS`](./region-peers.md) | Provides details about where regions are stored. |
| [`RUNTIME_METRICS`](./runtime-metrics.md)| Provides the system runtime metrics.|
| [`CLUSTER_INFO`](./cluster-info.md)| Provides the topology information of the cluster.|
| [`FLOWS`](./flows.md) | Provides the flow information.|



Expand Down
45 changes: 45 additions & 0 deletions docs/nightly/en/reference/sql/show.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,48 @@ WITH(

* `Table`: the table name.
* `Create Table`: The SQL to create the table.

## SHOW CREATE FLOW

Shows the `CREATE FLOW` statement that creates the flow task.

For example:

```sql
public=> SHOW CREATE FLOW filter_numbers;
```

```sql
Flow | Create Flow
----------------+-------------------------------------------------------
filter_numbers | CREATE OR REPLACE FLOW IF NOT EXISTS filter_numbers +
| SINK TO out_num_cnt +
| AS SELECT number FROM numbers_input WHERE number > 10
(1 row)
```

## SHOW FLOWS

Show all flows:

```sql
public=> SHOW FLOWS;
```

```sql
Flows
----------------
filter_numbers
(1 row)
```
also support `LIKE` expression:
```sql
public=> show flows like "filter%";
```

```sql
Flows
----------------
filter_numbers
(1 row)
```
35 changes: 35 additions & 0 deletions docs/nightly/zh/reference/sql/information-schema/flows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# FLOWS
`Flows` 表提供了 Flow 任务的相关信息。

```sql
public=> DESC TABLE INFORMATION_SCHEMA.FLOWS;
```

```sql
Column | Type | Key | Null | Default | Semantic Type
------------------+--------+-----+------+---------+---------------
flow_name | String | | NO | | FIELD
flow_id | UInt32 | | NO | | FIELD
table_catalog | String | | NO | | FIELD
flow_definition | String | | NO | | FIELD
comment | String | | YES | | FIELD
expire_after | Int64 | | YES | | FIELD
source_table_ids | String | | YES | | FIELD
sink_table_name | String | | NO | | FIELD
flownode_ids | String | | YES | | FIELD
options | String | | YES | | FIELD
(10 rows)
```

表中的列:

* `flow_name`: Flow 任务的名称。
* `flow_id`: Flow 任务的 id。
* `table_catalog`: the catalog this flow belongs to, named as `table_catalog` to keep consistent with the `INFORMATION_SCHEMA` standard. 该 Flow 所属的目录,命名为 `table_catalog` 以保持与 `INFORMATION_SCHEMA` 标准的一致性。
discord9 marked this conversation as resolved.
Show resolved Hide resolved
* `flow_definition`: Flow 任务的定义。这是用于创建 Flow 任务的 SQL 语句。
discord9 marked this conversation as resolved.
Show resolved Hide resolved
* `comment`: Flow 任务的注释。
* `expire_after`: Flow 任务的过期时间。
* `source_table_ids`: Flow 任务的源表 id。
* `sink_table_name`: Flow 任务的目标表名称。
* `flownode_ids`: Flow 任务使用的 flownode id。
* `options`: Flow 任务的其他额外选项。
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
| [`REGION_PEERS`](./region-peers.md) | 提供了表的 Region 存储的详细信息。 |
| [`RUNTIME_METRICS`](./runtime-metrics.md)| 提供了系统运行时指标。|
| [`CLUSTER_INFO`](./cluster-info.md)| 提供了集群的节点拓扑信息。|

| [`FLOWS`](./flows.md) | 提供 Flow 相关信息。|

45 changes: 45 additions & 0 deletions docs/nightly/zh/reference/sql/show.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,48 @@ WITH(

* `Table`: 表的名称
* `Create Table`: 用于创建该表的 SQL

## SHOW CREATE FLOW

展示创建指定 Flow 任务的 `CREATE FLOW` 语句。

比如:

```sql
public=> SHOW CREATE FLOW filter_numbers;
```

```sql
Flow | Create Flow
----------------+-------------------------------------------------------
filter_numbers | CREATE OR REPLACE FLOW IF NOT EXISTS filter_numbers +
| SINK TO out_num_cnt +
| AS SELECT number FROM numbers_input WHERE number > 10
(1 row)
```

## SHOW FLOWS

展示当前所有 Flow 任务:

```sql
public=> SHOW FLOWS;
```

```sql
Flows
----------------
filter_numbers
(1 row)
```
also support `LIKE` expression:
discord9 marked this conversation as resolved.
Show resolved Hide resolved
```sql
public=> show flows like "filter%";
```

```sql
Flows
----------------
filter_numbers
(1 row)
```