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 1 commit
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
32 changes: 32 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,32 @@
# FLOWS
The Flows table provide the flow task's information.
discord9 marked this conversation as resolved.
Show resolved Hide resolved

```sql
public=> DESC TABLE INFORMATION_SCHEMA.FLOWS;
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)
```
nicecui marked this conversation as resolved.
Show resolved Hide resolved

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 that were used to creates the flow task.
discord9 marked this conversation as resolved.
Show resolved Hide resolved
* `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
36 changes: 36 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,39 @@ 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;
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)
```
discord9 marked this conversation as resolved.
Show resolved Hide resolved

## SHOW FLOWS

Show all flows:

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