This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git


The following commit(s) were added to refs/heads/main by this push:
     new 8f1423e  Add and Fix the content about showDevice_Template (#134)
8f1423e is described below

commit 8f1423e8490d810882c2c8d9110e602426566d40
Author: linxt20 <[email protected]>
AuthorDate: Wed Jan 17 14:38:58 2024 +0800

    Add and Fix the content about showDevice_Template (#134)
---
 src/UserGuide/Master/API/RestServiceV1.md          |  14 ++-
 src/UserGuide/Master/API/RestServiceV2.md          |  14 ++-
 src/UserGuide/Master/SQL-Manual/SQL-Manual.md      |   4 +
 .../Master/User-Manual/Operate-Metadata.md         | 115 ++++++++++++--------
 .../Master/stage/Operate-Metadata/Node.md          | 103 +++++++++++-------
 .../Master/stage/Operate-Metadata/Template.md      |  12 +--
 src/zh/UserGuide/Master/API/RestServiceV1.md       |  14 ++-
 src/zh/UserGuide/Master/API/RestServiceV2.md       |  14 ++-
 src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md   |  18 ++++
 .../Master/User-Manual/Operate-Metadata.md         | 116 +++++++++++++--------
 .../Master/stage/Operate-Metadata/Node.md          | 104 +++++++++++-------
 .../Master/stage/Operate-Metadata/Template.md      |  12 +--
 12 files changed, 360 insertions(+), 180 deletions(-)

diff --git a/src/UserGuide/Master/API/RestServiceV1.md 
b/src/UserGuide/Master/API/RestServiceV1.md
index 2048c3c..34af056 100644
--- a/src/UserGuide/Master/API/RestServiceV1.md
+++ b/src/UserGuide/Master/API/RestServiceV1.md
@@ -523,7 +523,8 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
   "expressions": null,
   "columnNames": [
     "devices",
-    "isAligned"
+    "isAligned",
+    "Template"
   ],
   "timestamps": null,
   "values": [
@@ -534,6 +535,10 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
     [
       "false",
       "false"
+    ],
+    [
+      "t1",
+      null
     ]
   ]
 }
@@ -551,7 +556,8 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
   "columnNames": [
     "devices",
     "database",
-    "isAligned"
+    "isAligned",
+    "Template"
   ],
   "timestamps": null,
   "values": [
@@ -566,6 +572,10 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
     [
       "false",
       "false"
+    ],
+    [
+      "t1",
+      null
     ]
   ]
 }
diff --git a/src/UserGuide/Master/API/RestServiceV2.md 
b/src/UserGuide/Master/API/RestServiceV2.md
index 900dfe5..24fe76b 100644
--- a/src/UserGuide/Master/API/RestServiceV2.md
+++ b/src/UserGuide/Master/API/RestServiceV2.md
@@ -523,7 +523,8 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
   "expressions": null,
   "column_names": [
     "devices",
-    "isAligned"
+    "isAligned",
+    "Template"
   ],
   "timestamps": null,
   "values": [
@@ -534,6 +535,10 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
     [
       "false",
       "false"
+    ],
+    [
+      "t1",
+      null
     ]
   ]
 }
@@ -551,7 +556,8 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
   "column_names": [
     "devices",
     "database",
-    "isAligned"
+    "isAligned",
+    "Template"
   ],
   "timestamps": null,
   "values": [
@@ -566,6 +572,10 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
     [
       "false",
       "false"
+    ],
+    [
+      "t1",
+      null
     ]
   ]
 }
diff --git a/src/UserGuide/Master/SQL-Manual/SQL-Manual.md 
b/src/UserGuide/Master/SQL-Manual/SQL-Manual.md
index 9e1fc2f..4439e23 100644
--- a/src/UserGuide/Master/SQL-Manual/SQL-Manual.md
+++ b/src/UserGuide/Master/SQL-Manual/SQL-Manual.md
@@ -160,6 +160,10 @@ IoTDB> show schema templates
 IoTDB> show nodes in schema template t1
 IoTDB> show paths set schema template t1
 IoTDB> show paths using schema template t1
+IoTDB> show devices where template = 't1'
+IoTDB> show devices where template != 't1'
+IoTDB> show devices where template is null
+IoTDB> show devices where template is not null
 ```
 
 ### Deactivate Schema Template
diff --git a/src/UserGuide/Master/User-Manual/Operate-Metadata.md 
b/src/UserGuide/Master/User-Manual/Operate-Metadata.md
index ea5d184..2deeef1 100644
--- a/src/UserGuide/Master/User-Manual/Operate-Metadata.md
+++ b/src/UserGuide/Master/User-Manual/Operate-Metadata.md
@@ -397,12 +397,12 @@ show devices root.sg1.**
 ````
 
 ```shell
-+---------------+---------+
-|        devices|isAligned|
-+---------------+---------+
-|    root.sg1.d1|    false|
-|    root.sg1.d2|     true|
-+---------------+---------+
++---------------+---------+---------+
+|        devices|isAligned| Template|
++---------------+---------+---------+
+|    root.sg1.d1|    false|     null|
+|    root.sg1.d2|     true|     null|
++---------------+---------+---------+
 ````
 
 ### Show Schema Template
@@ -1092,6 +1092,8 @@ Similar to `Show Timeseries`, IoTDB also supports two 
ways of viewing devices:
 * `SHOW DEVICES` statement presents all devices' information, which is equal 
to `SHOW DEVICES root.**`.
 * `SHOW DEVICES <PathPattern>` statement specifies the `PathPattern` and 
returns the devices information matching the pathPattern and under the given 
level.
 * `WHERE` condition supports `DEVICE contains 'xxx'`  to do a fuzzy query 
based on the device name.
+* `WHERE` condition supports `TEMPLATE = 'xxx'`,`TEMPLATE != 'xxx'` to do a 
filter query based on the template name.
+* `WHERE` condition supports `TEMPLATE is null`,`TEMPLATE is not null` to do a 
filter query based on whether the template is null (null indicating it's 
inactive)
 
 SQL statement is as follows:
 
@@ -1099,33 +1101,60 @@ SQL statement is as follows:
 IoTDB> show devices
 IoTDB> show devices root.ln.**
 IoTDB> show devices root.ln.** where device contains 't'
+IoTDB> show devices root.ln.** where template = 't1'
+IoTDB> show devices root.ln.** where template is null
 ```
 
 You can get results below:
 
 ```
-+-------------------+---------+
-|            devices|isAligned|
-+-------------------+---------+
-|  root.ln.wf01.wt01|    false|
-|  root.ln.wf02.wt02|    false|
-|root.sgcc.wf03.wt01|    false|
-|    root.turbine.d1|    false|
-+-------------------+---------+
++-------------------+---------+---------+
+|            devices|isAligned| Template|
++-------------------+---------+---------+
+|  root.ln.wf01.wt01|    false|       t1|
+|  root.ln.wf02.wt02|    false|     null|
+|root.sgcc.wf03.wt01|    false|     null|
+|    root.turbine.d1|    false|     null|
++-------------------+---------+---------+
 Total line number = 4
 It costs 0.002s
 
-+-----------------+---------+
-|          devices|isAligned|
-+-----------------+---------+
-|root.ln.wf01.wt01|    false|
-|root.ln.wf02.wt02|    false|
-+-----------------+---------+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
 Total line number = 2
 It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
+Total line number = 2
+It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
++-----------------+---------+---------+
+Total line number = 1
+It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
+Total line number = 1
+It costs 0.001s
 ```
 
-`isAligned` indicates whether the timeseries under the device are aligned.
+`isAligned` indicates whether the timeseries under the device are aligned, 
`Template` displays the name of the template activated on the device, with 
`null` indicating that no template has been activated.
 
 To view devices' information with database, we can use `SHOW DEVICES WITH 
DATABASE` statement.
 
@@ -1143,23 +1172,23 @@ IoTDB> show devices root.ln.** with database
 You can get results below:
 
 ```
-+-------------------+-------------+---------+
-|            devices|     database|isAligned|
-+-------------------+-------------+---------+
-|  root.ln.wf01.wt01|      root.ln|    false|
-|  root.ln.wf02.wt02|      root.ln|    false|
-|root.sgcc.wf03.wt01|    root.sgcc|    false|
-|    root.turbine.d1| root.turbine|    false|
-+-------------------+-------------+---------+
++-------------------+-------------+---------+---------+
+|            devices|     database|isAligned| Template|
++-------------------+-------------+---------+---------+
+|  root.ln.wf01.wt01|      root.ln|    false|       t1|
+|  root.ln.wf02.wt02|      root.ln|    false|     null|
+|root.sgcc.wf03.wt01|    root.sgcc|    false|     null|
+|    root.turbine.d1| root.turbine|    false|     null|
++-------------------+-------------+---------+---------+
 Total line number = 4
 It costs 0.003s
 
-+-----------------+-------------+---------+
-|          devices|     database|isAligned|
-+-----------------+-------------+---------+
-|root.ln.wf01.wt01|      root.ln|    false|
-|root.ln.wf02.wt02|      root.ln|    false|
-+-----------------+-------------+---------+
++-----------------+-------------+---------+---------+
+|          devices|     database|isAligned| Template|
++-----------------+-------------+---------+---------+
+|root.ln.wf01.wt01|      root.ln|    false|       t1|
+|root.ln.wf02.wt02|      root.ln|    false|     null|
++-----------------+-------------+---------+---------+
 Total line number = 2
 It costs 0.001s
 ```
@@ -1181,14 +1210,14 @@ IoTDB> count devices root.ln.**
 You can get results below:
 
 ```
-+-------------------+---------+
-|            devices|isAligned|
-+-------------------+---------+
-|root.sgcc.wf03.wt03|    false|
-|    root.turbine.d1|    false|
-|  root.ln.wf02.wt02|    false|
-|  root.ln.wf01.wt01|    false|
-+-------------------+---------+
++-------------------+---------+---------+
+|            devices|isAligned| Template|
++-------------------+---------+---------+
+|root.sgcc.wf03.wt03|    false|     null|
+|    root.turbine.d1|    false|     null|
+|  root.ln.wf02.wt02|    false|     null|
+|  root.ln.wf01.wt01|    false|       t1|
++-------------------+---------+---------+
 Total line number = 4
 It costs 0.024s
 
diff --git a/src/UserGuide/Master/stage/Operate-Metadata/Node.md 
b/src/UserGuide/Master/stage/Operate-Metadata/Node.md
index 5747061..b886096 100644
--- a/src/UserGuide/Master/stage/Operate-Metadata/Node.md
+++ b/src/UserGuide/Master/stage/Operate-Metadata/Node.md
@@ -141,6 +141,8 @@ Similar to `Show Timeseries`, IoTDB also supports two ways 
of viewing devices:
 * `SHOW DEVICES` statement presents all devices' information, which is equal 
to `SHOW DEVICES root.**`.
 * `SHOW DEVICES <PathPattern>` statement specifies the `PathPattern` and 
returns the devices information matching the pathPattern and under the given 
level.
 * `WHERE` condition supports `DEVICE contains 'xxx'`  to do a fuzzy query 
based on the device name.
+* `WHERE` condition supports `TEMPLATE = 'xxx'`,`TEMPLATE != 'xxx'` to do a 
filter query based on the template name.
+* `WHERE` condition supports `TEMPLATE is null`,`TEMPLATE is not null` to do a 
filter query based on whether the template is null (indicating it's inactive) 
or not null (indicating activation).
 
 SQL statement is as follows:
 
@@ -148,33 +150,60 @@ SQL statement is as follows:
 IoTDB> show devices
 IoTDB> show devices root.ln.**
 IoTDB> show devices root.ln.** where device contains 't'
+IoTDB> show devices root.ln.** where template = 't1'
+IoTDB> show devices root.ln.** where template is null
 ```
 
 You can get results below:
 
 ```
-+-------------------+---------+
-|            devices|isAligned|
-+-------------------+---------+
-|  root.ln.wf01.wt01|    false|
-|  root.ln.wf02.wt02|    false|
-|root.sgcc.wf03.wt01|    false|
-|    root.turbine.d1|    false|
-+-------------------+---------+
++-------------------+---------+---------+
+|            devices|isAligned| Template|
++-------------------+---------+---------+
+|  root.ln.wf01.wt01|    false|       t1|
+|  root.ln.wf02.wt02|    false|     null|
+|root.sgcc.wf03.wt01|    false|     null|
+|    root.turbine.d1|    false|     null|
++-------------------+---------+---------+
 Total line number = 4
 It costs 0.002s
 
-+-----------------+---------+
-|          devices|isAligned|
-+-----------------+---------+
-|root.ln.wf01.wt01|    false|
-|root.ln.wf02.wt02|    false|
-+-----------------+---------+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
 Total line number = 2
 It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
+Total line number = 2
+It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
++-----------------+---------+---------+
+Total line number = 1
+It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
+Total line number = 1
+It costs 0.001s
 ```
 
-`isAligned` indicates whether the timeseries under the device are aligned.
+`isAligned` indicates whether the timeseries under the device are aligned, 
`Template` displays the name of the template activated on the device, with 
"null" indicating that no template has been activated.
 
 To view devices' information with database, we can use `SHOW DEVICES WITH 
DATABASE` statement.
 
@@ -192,23 +221,23 @@ IoTDB> show devices root.ln.** with database
 You can get results below:
 
 ```
-+-------------------+-------------+---------+
-|            devices|     database|isAligned|
-+-------------------+-------------+---------+
-|  root.ln.wf01.wt01|      root.ln|    false|
-|  root.ln.wf02.wt02|      root.ln|    false|
-|root.sgcc.wf03.wt01|    root.sgcc|    false|
-|    root.turbine.d1| root.turbine|    false|
-+-------------------+-------------+---------+
++-------------------+-------------+---------+---------+
+|            devices|     database|isAligned| Template|
++-------------------+-------------+---------+---------+
+|  root.ln.wf01.wt01|      root.ln|    false|       t1|
+|  root.ln.wf02.wt02|      root.ln|    false|     null|
+|root.sgcc.wf03.wt01|    root.sgcc|    false|     null|
+|    root.turbine.d1| root.turbine|    false|     null|
++-------------------+-------------+---------+---------+
 Total line number = 4
 It costs 0.003s
 
-+-----------------+-------------+---------+
-|          devices|     database|isAligned|
-+-----------------+-------------+---------+
-|root.ln.wf01.wt01|      root.ln|    false|
-|root.ln.wf02.wt02|      root.ln|    false|
-+-----------------+-------------+---------+
++-----------------+-------------+---------+---------+
+|          devices|     database|isAligned| Template|
++-----------------+-------------+---------+---------+
+|root.ln.wf01.wt01|      root.ln|    false|       t1|
+|root.ln.wf02.wt02|      root.ln|    false|     null|
++-----------------+-------------+---------+---------+
 Total line number = 2
 It costs 0.001s
 ```
@@ -230,14 +259,14 @@ IoTDB> count devices root.ln.**
 You can get results below:
 
 ```
-+-------------------+---------+
-|            devices|isAligned|
-+-------------------+---------+
-|root.sgcc.wf03.wt03|    false|
-|    root.turbine.d1|    false|
-|  root.ln.wf02.wt02|    false|
-|  root.ln.wf01.wt01|    false|
-+-------------------+---------+
++-------------------+---------+---------+
+|            devices|isAligned| Template|
++-------------------+---------+---------+
+|root.sgcc.wf03.wt03|    false|     null|
+|    root.turbine.d1|    false|     null|
+|  root.ln.wf02.wt02|    false|     null|
+|  root.ln.wf01.wt01|    false|       t1|
++-------------------+---------+---------+
 Total line number = 4
 It costs 0.024s
 
diff --git a/src/UserGuide/Master/stage/Operate-Metadata/Template.md 
b/src/UserGuide/Master/stage/Operate-Metadata/Template.md
index 68757a2..c9e5780 100644
--- a/src/UserGuide/Master/stage/Operate-Metadata/Template.md
+++ b/src/UserGuide/Master/stage/Operate-Metadata/Template.md
@@ -104,12 +104,12 @@ show devices root.sg1.**
 ````
 
 ```shell
-+---------------+---------+
-|        devices|isAligned|
-+---------------+---------+
-|    root.sg1.d1|    false|
-|    root.sg1.d2|     true|
-+---------------+---------+
++---------------+---------+---------+
+|        devices|isAligned| Template|
++---------------+---------+---------+
+|    root.sg1.d1|    false|     null|
+|    root.sg1.d2|     true|     null|
++---------------+---------+---------+
 ````
 
 ## Show Schema Template
diff --git a/src/zh/UserGuide/Master/API/RestServiceV1.md 
b/src/zh/UserGuide/Master/API/RestServiceV1.md
index 06339cb..b724366 100644
--- a/src/zh/UserGuide/Master/API/RestServiceV1.md
+++ b/src/zh/UserGuide/Master/API/RestServiceV1.md
@@ -528,7 +528,8 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
   "expressions": null,
   "columnNames": [
     "devices",
-    "isAligned"
+    "isAligned",
+    "Template"
   ],
   "timestamps": null,
   "values": [
@@ -539,6 +540,10 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
     [
       "false",
       "false"
+    ],
+    [
+      "t1",
+      null
     ]
   ]
 }
@@ -557,7 +562,8 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
   "columnNames": [
     "devices",
     "database",
-    "isAligned"
+    "isAligned",
+    "Template"
   ],
   "timestamps": null,
   "values": [
@@ -572,6 +578,10 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
     [
       "false",
       "false"
+    ],
+    [
+      "t1",
+      null
     ]
   ]
 }
diff --git a/src/zh/UserGuide/Master/API/RestServiceV2.md 
b/src/zh/UserGuide/Master/API/RestServiceV2.md
index d88f10e..e174fee 100644
--- a/src/zh/UserGuide/Master/API/RestServiceV2.md
+++ b/src/zh/UserGuide/Master/API/RestServiceV2.md
@@ -528,7 +528,8 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
   "expressions": null,
   "column_names": [
     "devices",
-    "isAligned"
+    "isAligned",
+    "Template"
   ],
   "timestamps": null,
   "values": [
@@ -539,6 +540,10 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
     [
       "false",
       "false"
+    ],
+    [
+      "t1",
+      null
     ]
   ]
 }
@@ -557,7 +562,8 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
   "column_names": [
     "devices",
     "database",
-    "isAligned"
+    "isAligned",
+    "Template"
   ],
   "timestamps": null,
   "values": [
@@ -572,6 +578,10 @@ curl -H "Content-Type:application/json" -H 
"Authorization:Basic cm9vdDpyb290" -X
     [
       "false",
       "false"
+    ],
+    [
+      "t1",
+      null
     ]
   ]
 }
diff --git a/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md 
b/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md
index 83ebfe1..f66d1c5 100644
--- a/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md
+++ b/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md
@@ -304,6 +304,24 @@ IoTDB> show paths set schema template t1
 
 IoTDB> show paths using schema template t1
 
+IoTDB> show devices using schema template t1
+
+- 查看使用了某个元数据模板的设备信息
+
+IoTDB> show devices where template = 't1'
+
+- 查看没有使用某个元数据模板的设备信息
+
+IoTDB> show devices where template != 't1'
+
+- 查看没有使用元数据模板的设备信息
+
+IoTDB> show devices where template is null
+
+- 查看使用元数据模板的设备信息
+
+IoTDB> show devices where template is not null
+
 #### 解除元数据模板
 
 IoTDB> delete timeseries of schema template t1 from root.sg1.d1
diff --git a/src/zh/UserGuide/Master/User-Manual/Operate-Metadata.md 
b/src/zh/UserGuide/Master/User-Manual/Operate-Metadata.md
index 9d7c57e..53ef593 100644
--- a/src/zh/UserGuide/Master/User-Manual/Operate-Metadata.md
+++ b/src/zh/UserGuide/Master/User-Manual/Operate-Metadata.md
@@ -381,12 +381,12 @@ show devices root.sg1.**
 ```
 
 ```shell
-+---------------+---------+
-|        devices|isAligned|
-+---------------+---------+
-|    root.sg1.d1|    false|
-|    root.sg1.d2|     true|
-+---------------+---------+
++---------------+---------+---------+
+|        devices|isAligned| Template|
++---------------+---------+---------+
+|    root.sg1.d1|    false|     null|
+|    root.sg1.d2|     true|     null|
++---------------+---------+---------+
 ```
 
 ### 查看设备模板
@@ -1065,6 +1065,8 @@ It costs 0.002s
 * `SHOW DEVICES` 语句显示当前所有的设备信息,等价于 `SHOW DEVICES root.**`。
 * `SHOW DEVICES <PathPattern>` 语句规定了 `PathPattern`,返回给定的路径模式所匹配的设备信息。
 * `WHERE` 条件中可以使用 `DEVICE contains 'xxx'`,根据 device 名称进行模糊查询。
+* `WHERE` 条件中可以使用 `TEMPLATE = 'xxx'`,`TEMPLATE != 'xxx'`,根据 template 名称进行过滤查询。
+* `WHERE` 条件中可以使用 `TEMPLATE is null`,`TEMPLATE is not null`,根据 template 
是否为null(null 表示没激活)进行过滤查询。
 
 SQL 语句如下所示:
 
@@ -1072,33 +1074,61 @@ SQL 语句如下所示:
 IoTDB> show devices
 IoTDB> show devices root.ln.**
 IoTDB> show devices root.ln.** where device contains 't'
+IoTDB> show devices root.ln.** where template = 't1'
+IoTDB> show devices root.ln.** where template is null
 ```
 
 你可以获得如下数据:
 
 ```
-+-------------------+---------+
-|            devices|isAligned|
-+-------------------+---------+
-|  root.ln.wf01.wt01|    false|
-|  root.ln.wf02.wt02|    false|
-|root.sgcc.wf03.wt01|    false|
-|    root.turbine.d1|    false|
-+-------------------+---------+
++-------------------+---------+---------+
+|            devices|isAligned| Template|
++-------------------+---------+---------+
+|  root.ln.wf01.wt01|    false|       t1|
+|  root.ln.wf02.wt02|    false|     null|
+|root.sgcc.wf03.wt01|    false|     null|
+|    root.turbine.d1|    false|     null|
++-------------------+---------+---------+
 Total line number = 4
 It costs 0.002s
 
-+-----------------+---------+
-|          devices|isAligned|
-+-----------------+---------+
-|root.ln.wf01.wt01|    false|
-|root.ln.wf02.wt02|    false|
-+-----------------+---------+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
 Total line number = 2
 It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
+Total line number = 2
+It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
++-----------------+---------+---------+
+Total line number = 1
+It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
+Total line number = 1
+It costs 0.001s
 ```
 
-其中,`isAligned`表示该设备下的时间序列是否对齐。
+其中,`isAligned`表示该设备下的时间序列是否对齐,
+`Template`显示着该设备所激活的模板名,null 表示没有激活模板。
 
 查看设备及其 database 信息,可以使用 `SHOW DEVICES WITH DATABASE` 语句。
 
@@ -1115,23 +1145,23 @@ IoTDB> show devices root.ln.** with database
 你可以获得如下数据:
 
 ```
-+-------------------+-------------+---------+
-|            devices|     database|isAligned|
-+-------------------+-------------+---------+
-|  root.ln.wf01.wt01|      root.ln|    false|
-|  root.ln.wf02.wt02|      root.ln|    false|
-|root.sgcc.wf03.wt01|    root.sgcc|    false|
-|    root.turbine.d1| root.turbine|    false|
-+-------------------+-------------+---------+
++-------------------+-------------+---------+---------+
+|            devices|     database|isAligned| Template|
++-------------------+-------------+---------+---------+
+|  root.ln.wf01.wt01|      root.ln|    false|       t1|
+|  root.ln.wf02.wt02|      root.ln|    false|     null|
+|root.sgcc.wf03.wt01|    root.sgcc|    false|     null|
+|    root.turbine.d1| root.turbine|    false|     null|
++-------------------+-------------+---------+---------+
 Total line number = 4
 It costs 0.003s
 
-+-----------------+-------------+---------+
-|          devices|     database|isAligned|
-+-----------------+-------------+---------+
-|root.ln.wf01.wt01|      root.ln|    false|
-|root.ln.wf02.wt02|      root.ln|    false|
-+-----------------+-------------+---------+
++-----------------+-------------+---------+---------+
+|          devices|     database|isAligned| Template|
++-----------------+-------------+---------+---------+
+|root.ln.wf01.wt01|      root.ln|    false|       t1|
+|root.ln.wf02.wt02|      root.ln|    false|     null|
++-----------------+-------------+---------+---------+
 Total line number = 2
 It costs 0.001s
 ```
@@ -1153,14 +1183,14 @@ IoTDB> count devices root.ln.**
 你可以获得如下数据:
 
 ```
-+-------------------+---------+
-|            devices|isAligned|
-+-------------------+---------+
-|root.sgcc.wf03.wt03|    false|
-|    root.turbine.d1|    false|
-|  root.ln.wf02.wt02|    false|
-|  root.ln.wf01.wt01|    false|
-+-------------------+---------+
++-------------------+---------+---------+
+|            devices|isAligned| Template|
++-------------------+---------+---------+
+|root.sgcc.wf03.wt03|    false|     null|
+|    root.turbine.d1|    false|     null|
+|  root.ln.wf02.wt02|    false|     null|
+|  root.ln.wf01.wt01|    false|       t1|
++-------------------+---------+---------+
 Total line number = 4
 It costs 0.024s
 
diff --git a/src/zh/UserGuide/Master/stage/Operate-Metadata/Node.md 
b/src/zh/UserGuide/Master/stage/Operate-Metadata/Node.md
index e054520..fe46182 100644
--- a/src/zh/UserGuide/Master/stage/Operate-Metadata/Node.md
+++ b/src/zh/UserGuide/Master/stage/Operate-Metadata/Node.md
@@ -147,6 +147,8 @@ It costs 0.002s
 * `SHOW DEVICES` 语句显示当前所有的设备信息,等价于 `SHOW DEVICES root.**`。
 * `SHOW DEVICES <PathPattern>` 语句规定了 `PathPattern`,返回给定的路径模式所匹配的设备信息。
 * `WHERE` 条件中可以使用 `DEVICE contains 'xxx'`,根据 device 名称进行模糊查询。
+* `WHERE` 条件中可以使用 `TEMPLATE = 'xxx'`,`TEMPLATE != 'xxx'`,根据 template 名称进行过滤查询。
+* `WHERE` 条件中可以使用 `TEMPLATE is null`,`TEMPLATE is not null`,根据 template 
是否为null(null 表示没激活)进行过滤查询。
 
 SQL 语句如下所示:
 
@@ -154,33 +156,61 @@ SQL 语句如下所示:
 IoTDB> show devices
 IoTDB> show devices root.ln.**
 IoTDB> show devices root.ln.** where device contains 't'
+IoTDB> show devices root.ln.** where template = 't1'
+IoTDB> show devices root.ln.** where template is null
 ```
 
 你可以获得如下数据:
 
 ```
-+-------------------+---------+
-|            devices|isAligned|
-+-------------------+---------+
-|  root.ln.wf01.wt01|    false|
-|  root.ln.wf02.wt02|    false|
-|root.sgcc.wf03.wt01|    false|
-|    root.turbine.d1|    false|
-+-------------------+---------+
++-------------------+---------+---------+
+|            devices|isAligned| Template|
++-------------------+---------+---------+
+|  root.ln.wf01.wt01|    false|       t1|
+|  root.ln.wf02.wt02|    false|     null|
+|root.sgcc.wf03.wt01|    false|     null|
+|    root.turbine.d1|    false|     null|
++-------------------+---------+---------+
 Total line number = 4
 It costs 0.002s
 
-+-----------------+---------+
-|          devices|isAligned|
-+-----------------+---------+
-|root.ln.wf01.wt01|    false|
-|root.ln.wf02.wt02|    false|
-+-----------------+---------+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
 Total line number = 2
 It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
+Total line number = 2
+It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf01.wt01|    false|       t1|
++-----------------+---------+---------+
+Total line number = 1
+It costs 0.001s
+
++-----------------+---------+---------+
+|          devices|isAligned| Template|
++-----------------+---------+---------+
+|root.ln.wf02.wt02|    false|     null|
++-----------------+---------+---------+
+Total line number = 1
+It costs 0.001s
 ```
 
-其中,`isAligned`表示该设备下的时间序列是否对齐。
+其中,`isAligned`表示该设备下的时间序列是否对齐, 
+`Template`显示着该设备所激活的模板名,null 表示没有激活模板。
 
 查看设备及其 database 信息,可以使用 `SHOW DEVICES WITH DATABASE` 语句。
 
@@ -197,23 +227,23 @@ IoTDB> show devices root.ln.** with database
 你可以获得如下数据:
 
 ```
-+-------------------+-------------+---------+
-|            devices|     database|isAligned|
-+-------------------+-------------+---------+
-|  root.ln.wf01.wt01|      root.ln|    false|
-|  root.ln.wf02.wt02|      root.ln|    false|
-|root.sgcc.wf03.wt01|    root.sgcc|    false|
-|    root.turbine.d1| root.turbine|    false|
-+-------------------+-------------+---------+
++-------------------+-------------+---------+---------+
+|            devices|     database|isAligned| Template|
++-------------------+-------------+---------+---------+
+|  root.ln.wf01.wt01|      root.ln|    false|       t1|
+|  root.ln.wf02.wt02|      root.ln|    false|     null|
+|root.sgcc.wf03.wt01|    root.sgcc|    false|     null|
+|    root.turbine.d1| root.turbine|    false|     null|
++-------------------+-------------+---------+---------+
 Total line number = 4
 It costs 0.003s
 
-+-----------------+-------------+---------+
-|          devices|     database|isAligned|
-+-----------------+-------------+---------+
-|root.ln.wf01.wt01|      root.ln|    false|
-|root.ln.wf02.wt02|      root.ln|    false|
-+-----------------+-------------+---------+
++-----------------+-------------+---------+---------+
+|          devices|     database|isAligned| Template|
++-----------------+-------------+---------+---------+
+|root.ln.wf01.wt01|      root.ln|    false|       t1|
+|root.ln.wf02.wt02|      root.ln|    false|     null|
++-----------------+-------------+---------+---------+
 Total line number = 2
 It costs 0.001s
 ```
@@ -235,14 +265,14 @@ IoTDB> count devices root.ln.**
 你可以获得如下数据:
 
 ```
-+-------------------+---------+
-|            devices|isAligned|
-+-------------------+---------+
-|root.sgcc.wf03.wt03|    false|
-|    root.turbine.d1|    false|
-|  root.ln.wf02.wt02|    false|
-|  root.ln.wf01.wt01|    false|
-+-------------------+---------+
++-------------------+---------+---------+
+|            devices|isAligned| Template|
++-------------------+---------+---------+
+|root.sgcc.wf03.wt03|    false|     null|
+|    root.turbine.d1|    false|     null|
+|  root.ln.wf02.wt02|    false|     null|
+|  root.ln.wf01.wt01|    false|       t1|
++-------------------+---------+---------+
 Total line number = 4
 It costs 0.024s
 
diff --git a/src/zh/UserGuide/Master/stage/Operate-Metadata/Template.md 
b/src/zh/UserGuide/Master/stage/Operate-Metadata/Template.md
index 1d52e1d..8086a08 100644
--- a/src/zh/UserGuide/Master/stage/Operate-Metadata/Template.md
+++ b/src/zh/UserGuide/Master/stage/Operate-Metadata/Template.md
@@ -103,12 +103,12 @@ show devices root.sg1.**
 ```
 
 ```shell
-+---------------+---------+
-|        devices|isAligned|
-+---------------+---------+
-|    root.sg1.d1|    false|
-|    root.sg1.d2|     true|
-+---------------+---------+
++---------------+---------+---------+
+|        devices|isAligned| Template|
++---------------+---------+---------+
+|    root.sg1.d1|    false|     null|
+|    root.sg1.d2|     true|     null|
++---------------+---------+---------+
 ```
 
 ## 查看元数据模板

Reply via email to