Skip to content

Commit

Permalink
docs: SHOW FLOW & FLOWS table info (#1079)
Browse files Browse the repository at this point in the history
Co-authored-by: Yiran <[email protected]>
  • Loading branch information
discord9 and nicecui authored Jul 24, 2024
1 parent 758f1f8 commit a2260a4
Show file tree
Hide file tree
Showing 12 changed files with 326 additions and 2 deletions.
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`: 该 Flow 所属的目录,命名为 `table_catalog` 以保持与 `INFORMATION_SCHEMA` 标准一致。
* `flow_definition`: Flow 任务的定义,是用于创建 Flow 任务的 SQL 语句。
* `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 相关信息。|

46 changes: 46 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,49 @@ 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)
```

同样也支持 `LIKE` 表达式:
```sql
public=> show flows like "filter%";
```

```sql
Flows
----------------
filter_numbers
(1 row)
```
35 changes: 35 additions & 0 deletions docs/v0.9/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.
1 change: 1 addition & 0 deletions docs/v0.9/en/reference/sql/information-schema/overview.md
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/v0.9/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/v0.9/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`: 该 Flow 所属的目录,命名为 `table_catalog` 以保持与 `INFORMATION_SCHEMA` 标准一致。
* `flow_definition`: Flow 任务的定义,是用于创建 Flow 任务的 SQL 语句。
* `comment`: Flow 任务的注释。
* `expire_after`: Flow 任务的过期时间。
* `source_table_ids`: Flow 任务的源表 id。
* `sink_table_name`: Flow 任务的目标表名称。
* `flownode_ids`: Flow 任务使用的 flownode id。
* `options`: Flow 任务的其他额外选项。
2 changes: 1 addition & 1 deletion docs/v0.9/zh/reference/sql/information-schema/overview.md
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 相关信息。|

46 changes: 46 additions & 0 deletions docs/v0.9/zh/reference/sql/show.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,49 @@ 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)
```

同样也支持 `LIKE` 表达式:
```sql
public=> show flows like "filter%";
```

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

0 comments on commit a2260a4

Please sign in to comment.