Skip to content

Commit aaca952

Browse files
DongLiang-0xiaozhuoyang
authored andcommitted
improve the article format of hdfs() and mv_infos() function (apache#1828)
## Versions - [x] dev - [x] 3.0 - [x] 2.1 - [ ] 2.0 ## Languages - [x] Chinese - [x] English ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built
1 parent a316c87 commit aaca952

File tree

12 files changed

+925
-1093
lines changed

12 files changed

+925
-1093
lines changed

docs/sql-manual/sql-functions/table-valued-functions/hdfs.md

Lines changed: 111 additions & 128 deletions
Large diffs are not rendered by default.

docs/sql-manual/sql-functions/table-valued-functions/mv_infos.md

Lines changed: 42 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -24,79 +24,62 @@ specific language governing permissions and limitations
2424
under the License.
2525
-->
2626

27-
## `mv_infos`
28-
29-
### Name
30-
31-
mv_infos
32-
33-
### description
27+
## Description
3428

3529
Table function, generating temporary tables for asynchronous materialized views, which can view information about asynchronous materialized views created in a certain database.
3630

37-
This function is used in the from clause.
38-
39-
This funciton is supported since 2.1.0.
40-
41-
#### syntax
42-
43-
`mv_infos("database"="")`
44-
45-
mv_infos() Table structure:
31+
## Syntax
4632
```sql
47-
mysql> desc function mv_infos("database"="tpch100");
48-
+--------------------+---------+------+-------+---------+-------+
49-
| Field | Type | Null | Key | Default | Extra |
50-
+--------------------+---------+------+-------+---------+-------+
51-
| Id | BIGINT | No | false | NULL | NONE |
52-
| Name | TEXT | No | false | NULL | NONE |
53-
| JobName | TEXT | No | false | NULL | NONE |
54-
| State | TEXT | No | false | NULL | NONE |
55-
| SchemaChangeDetail | TEXT | No | false | NULL | NONE |
56-
| RefreshState | TEXT | No | false | NULL | NONE |
57-
| RefreshInfo | TEXT | No | false | NULL | NONE |
58-
| QuerySql | TEXT | No | false | NULL | NONE |
59-
| EnvInfo | TEXT | No | false | NULL | NONE |
60-
| MvProperties | TEXT | No | false | NULL | NONE |
61-
| MvPartitionInfo | TEXT | No | false | NULL | NONE |
62-
| SyncWithBaseTables | BOOLEAN | No | false | NULL | NONE |
63-
+--------------------+---------+------+-------+---------+-------+
64-
12 rows in set (0.01 sec)
33+
MV_INFOS("database"="<database>")
6534
```
6635

67-
* Id: Materialized View ID
68-
* Name: Materialized View Name
69-
* JobName: The job name corresponding to the materialized view
70-
* State: Materialized View State
71-
* SchemaChangeDetail: The reason why the materialized view State becomes a SchemeChange
72-
* RefreshState: Materialized view refresh status
73-
* RefreshInfo: Refreshing strategy information defined by materialized views
74-
* QuerySql: Query statements defined by materialized views
75-
* EnvInfo: Environmental information during the creation of materialized views
76-
* MvProperties: Materialized visual attributes
77-
* MvPartitionInfo: Partition information of materialized views
78-
* SyncWithBaseTables:Is it synchronized with the base table data? To see which partition is not synchronized, please use [SHOW PARTITIONS](../sql-reference/Show-Statements/SHOW-PARTITIONS.md)
36+
## Required Parameters
37+
**`<database>`**
38+
> Specify the cluster database name to be queried
7939
80-
### example
8140

82-
1. View all materialized views under db1
41+
## Return Value
8342

84-
```sql
85-
mysql> select * from mv_infos("database"="db1");
86-
```
43+
| Field | Type | Description |
44+
|------------------------|---------|---------------------------------------------------------------------|
45+
| Id | BIGINT | Materialized view ID |
46+
| Name | TEXT | Materialized view name |
47+
| JobName | TEXT | Job name corresponding to the materialized view |
48+
| State | TEXT | State of the materialized view |
49+
| SchemaChangeDetail | TEXT | Reason for the state change to SchemaChange |
50+
| RefreshState | TEXT | Refresh state of the materialized view |
51+
| RefreshInfo | TEXT | Refresh strategy information defined for the materialized view |
52+
| QuerySql | TEXT | SQL query defined for the materialized view |
53+
| EnvInfo | TEXT | Environment information when the materialized view was created |
54+
| MvProperties | TEXT | Materialized view properties |
55+
| MvPartitionInfo | TEXT | Partition information of the materialized view |
56+
| SyncWithBaseTables | BOOLEAN | Whether the data is synchronized with the base table. To check which partition is not synchronized, use [SHOW PARTITIONS](../sql-reference/Show-Statements/SHOW-PARTITIONS.md) |
57+
58+
## Examples
8759

88-
2. View the materialized view named mv1 under db1
60+
View all materialized views under test
8961

9062
```sql
91-
mysql> select * from mv_infos("database"="db1") where Name = "mv1";
63+
select * from mv_infos("database"="test");
64+
```
65+
```text
66+
+-------+--------------------------+------------------+--------+--------------------+--------------+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+--------------------+
67+
| Id | Name | JobName | State | SchemaChangeDetail | RefreshState | RefreshInfo | QuerySql | MvProperties | MvPartitionInfo | SyncWithBaseTables |
68+
+-------+--------------------------+------------------+--------+--------------------+--------------+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+--------------------+
69+
| 19494 | mv1 | inner_mtmv_19494 | NORMAL | | SUCCESS | BUILD DEFERRED REFRESH AUTO ON MANUAL | SELECT `internal`.`test`.`user`.`k2`, `internal`.`test`.`user`.`k3` FROM `internal`.`test`.`user` | {partition_sync_limit=100, partition_sync_time_unit=YEAR} | MTMVPartitionInfo{partitionType=FOLLOW_BASE_TABLE, relatedTable=user, relatedCol='k2', partitionCol='k2'} | 1 |
70+
| 21788 | test_tablet_type_mtmv_mv | inner_mtmv_21788 | NORMAL | | SUCCESS | BUILD DEFERRED REFRESH AUTO ON MANUAL | SELECT `internal`.`test`.`test_tablet_type_mtmv_table`.`k2`, `internal`.`test`.`test_tablet_type_mtmv_table`.`k3` from `internal`.`test`.`test_tablet_type_mtmv_table` | {} | MTMVPartitionInfo{partitionType=SELF_MANAGE} | 0 |
71+
+-------+--------------------------+------------------+--------+--------------------+--------------+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+--------------------+
9272
```
9373

94-
3. View the status of the materialized view named mv1 under db1
74+
View the materialized view named mv1 under test
9575

9676
```sql
97-
mysql> select State from mv_infos("database"="db1") where Name = "mv1";
77+
select * from mv_infos("database"="test") where Name = "mv1";
9878
```
99-
100-
### keywords
101-
102-
mv, infos
79+
```text
80+
+-------+------+------------------+--------+--------------------+--------------+---------------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+--------------------+
81+
| Id | Name | JobName | State | SchemaChangeDetail | RefreshState | RefreshInfo | QuerySql | MvProperties | MvPartitionInfo | SyncWithBaseTables |
82+
+-------+------+------------------+--------+--------------------+--------------+---------------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+--------------------+
83+
| 19494 | mv1 | inner_mtmv_19494 | NORMAL | | SUCCESS | BUILD DEFERRED REFRESH AUTO ON MANUAL | SELECT `internal`.`test`.`user`.`k2`, `internal`.`test`.`user`.`k3` FROM `internal`.`test`.`user` | {partition_sync_limit=100, partition_sync_time_unit=YEAR} | MTMVPartitionInfo{partitionType=FOLLOW_BASE_TABLE, relatedTable=user, relatedCol='k2', partitionCol='k2'} | 1 |
84+
+-------+------+------------------+--------+--------------------+--------------+---------------------------------------+---------------------------------------------------------------------------------------------+-----------------------------------------------------------+-----------------------------------------------------------------------------------------------------------+--------------------+
85+
```

0 commit comments

Comments
 (0)