diff --git a/src/UserGuide/Master/API/RestServiceV1.md b/src/UserGuide/Master/API/RestServiceV1.md index 5dc7f1b88..34af05673 100644 --- a/src/UserGuide/Master/API/RestServiceV1.md +++ b/src/UserGuide/Master/API/RestServiceV1.md @@ -538,7 +538,7 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X ], [ "t1", - "null" + null ] ] } @@ -575,7 +575,7 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X ], [ "t1", - "null" + null ] ] } diff --git a/src/UserGuide/Master/API/RestServiceV2.md b/src/UserGuide/Master/API/RestServiceV2.md index 6cd9a902d..24fe76b67 100644 --- a/src/UserGuide/Master/API/RestServiceV2.md +++ b/src/UserGuide/Master/API/RestServiceV2.md @@ -538,7 +538,7 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X ], [ "t1", - "null" + null ] ] } @@ -575,7 +575,7 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X ], [ "t1", - "null" + null ] ] } diff --git a/src/UserGuide/Master/SQL-Manual/SQL-Manual.md b/src/UserGuide/Master/SQL-Manual/SQL-Manual.md index 65b49f982..4439e23b5 100644 --- a/src/UserGuide/Master/SQL-Manual/SQL-Manual.md +++ b/src/UserGuide/Master/SQL-Manual/SQL-Manual.md @@ -160,8 +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 = '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 9f6362762..77b9f00fe 100644 --- a/src/UserGuide/Master/User-Manual/Operate-Metadata.md +++ b/src/UserGuide/Master/User-Manual/Operate-Metadata.md @@ -1092,7 +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 ` 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 = '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: @@ -1100,7 +1101,8 @@ 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 = 't1' +IoTDB> show devices root.ln.** where template is null ``` You can get results below: @@ -1130,12 +1132,29 @@ 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, `Template` displays the name of the template activated on the device, with "null" indicating that no template has been activated. +`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. diff --git a/src/UserGuide/Master/stage/Operate-Metadata/Node.md b/src/UserGuide/Master/stage/Operate-Metadata/Node.md index 9c9c82ebf..b88609651 100644 --- a/src/UserGuide/Master/stage/Operate-Metadata/Node.md +++ b/src/UserGuide/Master/stage/Operate-Metadata/Node.md @@ -141,7 +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 ` 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 = '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: @@ -149,7 +150,8 @@ 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 = 't1' +IoTDB> show devices root.ln.** where template is null ``` You can get results below: @@ -179,6 +181,23 @@ 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 diff --git a/src/zh/UserGuide/Master/API/RestServiceV1.md b/src/zh/UserGuide/Master/API/RestServiceV1.md index b58a71ecb..b72436621 100644 --- a/src/zh/UserGuide/Master/API/RestServiceV1.md +++ b/src/zh/UserGuide/Master/API/RestServiceV1.md @@ -543,7 +543,7 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X ], [ "t1", - "null" + null ] ] } @@ -581,7 +581,7 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X ], [ "t1", - "null" + null ] ] } diff --git a/src/zh/UserGuide/Master/API/RestServiceV2.md b/src/zh/UserGuide/Master/API/RestServiceV2.md index 37c3c3a53..e174fee3b 100644 --- a/src/zh/UserGuide/Master/API/RestServiceV2.md +++ b/src/zh/UserGuide/Master/API/RestServiceV2.md @@ -543,7 +543,7 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X ], [ "t1", - "null" + null ] ] } @@ -581,7 +581,7 @@ curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X ], [ "t1", - "null" + null ] ] } diff --git a/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md b/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md index 2d35bf74a..32dc1bf99 100644 --- a/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md +++ b/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md @@ -306,11 +306,21 @@ 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 != t1 +- 查看没有使用某个元数据模板的设备信息 + +IoTDB> show devices where template != 't1' + +- 查看没有使用元数据模板的设备信息 + +IoTDB> show devices where template is null + +- 查看使用元数据模板的设备信息 + +IoTDB> show devices where template is not null #### 解除元数据模板 diff --git a/src/zh/UserGuide/Master/User-Manual/Operate-Metadata.md b/src/zh/UserGuide/Master/User-Manual/Operate-Metadata.md index 08c3e9551..3780ae693 100644 --- a/src/zh/UserGuide/Master/User-Manual/Operate-Metadata.md +++ b/src/zh/UserGuide/Master/User-Manual/Operate-Metadata.md @@ -1066,6 +1066,7 @@ It costs 0.002s * `SHOW DEVICES ` 语句规定了 `PathPattern`,返回给定的路径模式所匹配的设备信息。 * `WHERE` 条件中可以使用 `DEVICE contains 'xxx'`,根据 device 名称进行模糊查询。 * `WHERE` 条件中可以使用 `TEMPLATE = 'xxx'`,`TEMPLATE != 'xxx'`,根据 template 名称进行过滤查询。 +* `WHERE` 条件中可以使用 `TEMPLATE is null`,`TEMPLATE is not null`,根据 template 是否为null(null 表示没激活)进行过滤查询。 SQL 语句如下所示: @@ -1073,7 +1074,8 @@ 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 = 't1' +IoTDB> show devices root.ln.** where template is null ``` 你可以获得如下数据: @@ -1103,6 +1105,23 @@ 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 diff --git a/src/zh/UserGuide/Master/stage/Operate-Metadata/Node.md b/src/zh/UserGuide/Master/stage/Operate-Metadata/Node.md index 7ee140b41..fe4618204 100644 --- a/src/zh/UserGuide/Master/stage/Operate-Metadata/Node.md +++ b/src/zh/UserGuide/Master/stage/Operate-Metadata/Node.md @@ -148,7 +148,7 @@ It costs 0.002s * `SHOW DEVICES ` 语句规定了 `PathPattern`,返回给定的路径模式所匹配的设备信息。 * `WHERE` 条件中可以使用 `DEVICE contains 'xxx'`,根据 device 名称进行模糊查询。 * `WHERE` 条件中可以使用 `TEMPLATE = 'xxx'`,`TEMPLATE != 'xxx'`,根据 template 名称进行过滤查询。 - +* `WHERE` 条件中可以使用 `TEMPLATE is null`,`TEMPLATE is not null`,根据 template 是否为null(null 表示没激活)进行过滤查询。 SQL 语句如下所示: @@ -156,7 +156,8 @@ 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 = 't1' +IoTDB> show devices root.ln.** where template is null ``` 你可以获得如下数据: @@ -186,6 +187,23 @@ 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