You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/04/22 07:38:11 UTC
[iotdb] branch master updated: [IOTDB-2976] Add English and Chinese docs for count devices and count storage groups (#5635)
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 9504a2b703 [IOTDB-2976] Add English and Chinese docs for count devices and count storage groups (#5635)
9504a2b703 is described below
commit 9504a2b703ec5c35c1832aded71dbea1757bd658
Author: JiaXin Zhang <37...@users.noreply.github.com>
AuthorDate: Fri Apr 22 15:38:06 2022 +0800
[IOTDB-2976] Add English and Chinese docs for count devices and count storage groups (#5635)
---
docs/UserGuide/Operate-Metadata/Node.md | 45 ++++++++++++++++
docs/UserGuide/Operate-Metadata/Storage-Group.md | 60 ++++++++++++++++++++++
docs/zh/UserGuide/Operate-Metadata/Node.md | 45 ++++++++++++++++
.../zh/UserGuide/Operate-Metadata/Storage-Group.md | 60 ++++++++++++++++++++++
4 files changed, 210 insertions(+)
diff --git a/docs/UserGuide/Operate-Metadata/Node.md b/docs/UserGuide/Operate-Metadata/Node.md
index 3d0963b867..2af63ca5d4 100644
--- a/docs/UserGuide/Operate-Metadata/Node.md
+++ b/docs/UserGuide/Operate-Metadata/Node.md
@@ -207,3 +207,48 @@ It costs 0.003s
Total line number = 2
It costs 0.001s
```
+
+## Count Devices
+
+* COUNT DEVICES <PathPattern>
+
+The above statement is used to count the number of devices. At the same time, it is allowed to specify `PathPattern` to count the number of devices matching the `PathPattern`.
+
+SQL statement is as follows:
+
+```
+IoTDB> show devices
+IoTDB> count devices
+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|
++-------------------+---------+
+Total line number = 4
+It costs 0.024s
+
++-------+
+|devices|
++-------+
+| 4|
++-------+
+Total line number = 1
+It costs 0.004s
+
++-------+
+|devices|
++-------+
+| 2|
++-------+
+Total line number = 1
+It costs 0.004s
+```
diff --git a/docs/UserGuide/Operate-Metadata/Storage-Group.md b/docs/UserGuide/Operate-Metadata/Storage-Group.md
index 59618912c0..0a717014c3 100644
--- a/docs/UserGuide/Operate-Metadata/Storage-Group.md
+++ b/docs/UserGuide/Operate-Metadata/Storage-Group.md
@@ -75,3 +75,63 @@ IoTDB > DELETE STORAGE GROUP root.sgcc
// delete all data, all timeseries and all storage groups
IoTDB > DELETE STORAGE GROUP root.**
```
+
+## Count Storage Group
+
+User can use the `COUNT STORAGE GROUP <PathPattern>` statement to count the number of storage groups. It is allowed to specify `PathPattern` to count the number of storage groups matching the `PathPattern`.
+
+SQL statement is as follows:
+
+```
+IoTDB> show storage group
+IoTDB> count storage group
+IoTDB> count storage group root.*
+IoTDB> count storage group root.sgcc.*
+IoTDB> count storage group root.sgcc
+```
+
+The result is as follows:
+
+```
++-------------+
+|storage group|
++-------------+
+| root.sgcc|
+| root.turbine|
+| root.ln|
++-------------+
+Total line number = 3
+It costs 0.003s
+
++-------------+
+|storage group|
++-------------+
+| 3|
++-------------+
+Total line number = 1
+It costs 0.003s
+
++-------------+
+|storage group|
++-------------+
+| 3|
++-------------+
+Total line number = 1
+It costs 0.002s
+
++-------------+
+|storage group|
++-------------+
+| 0|
++-------------+
+Total line number = 1
+It costs 0.002s
+
++-------------+
+|storage group|
++-------------+
+| 1|
++-------------+
+Total line number = 1
+It costs 0.002s
+```
diff --git a/docs/zh/UserGuide/Operate-Metadata/Node.md b/docs/zh/UserGuide/Operate-Metadata/Node.md
index e75eb6c1ef..a8671eee52 100644
--- a/docs/zh/UserGuide/Operate-Metadata/Node.md
+++ b/docs/zh/UserGuide/Operate-Metadata/Node.md
@@ -211,3 +211,48 @@ It costs 0.003s
Total line number = 2
It costs 0.001s
```
+
+## 统计设备数量
+
+* COUNT DEVICES <PathPattern>
+
+上述语句用于统计设备的数量,同时允许指定`PathPattern` 用于统计匹配该`PathPattern` 的设备数量
+
+SQL 语句如下所示:
+
+```
+IoTDB> show devices
+IoTDB> count devices
+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|
++-------------------+---------+
+Total line number = 4
+It costs 0.024s
+
++-------+
+|devices|
++-------+
+| 4|
++-------+
+Total line number = 1
+It costs 0.004s
+
++-------+
+|devices|
++-------+
+| 2|
++-------+
+Total line number = 1
+It costs 0.004s
+```
diff --git a/docs/zh/UserGuide/Operate-Metadata/Storage-Group.md b/docs/zh/UserGuide/Operate-Metadata/Storage-Group.md
index 4b16ce1967..07ca9e0d7e 100644
--- a/docs/zh/UserGuide/Operate-Metadata/Storage-Group.md
+++ b/docs/zh/UserGuide/Operate-Metadata/Storage-Group.md
@@ -77,3 +77,63 @@ IoTDB > DELETE STORAGE GROUP root.sgcc
// 删除所有数据,时间序列以及存储组
IoTDB > DELETE STORAGE GROUP root.**
```
+
+## 统计存储组数量
+
+用户可以使用`COUNT STORAGE GROUP <PathPattern>`语句统计存储组的数量,允许指定`PathPattern` 用来统计匹配该`PathPattern` 的存储组的数量
+
+SQL 语句如下所示:
+
+```
+IoTDB> show storage group
+IoTDB> count storage group
+IoTDB> count storage group root.*
+IoTDB> count storage group root.sgcc.*
+IoTDB> count storage group root.sgcc
+```
+
+执行结果为:
+
+```
++-------------+
+|storage group|
++-------------+
+| root.sgcc|
+| root.turbine|
+| root.ln|
++-------------+
+Total line number = 3
+It costs 0.003s
+
++-------------+
+|storage group|
++-------------+
+| 3|
++-------------+
+Total line number = 1
+It costs 0.003s
+
++-------------+
+|storage group|
++-------------+
+| 3|
++-------------+
+Total line number = 1
+It costs 0.002s
+
++-------------+
+|storage group|
++-------------+
+| 0|
++-------------+
+Total line number = 1
+It costs 0.002s
+
++-------------+
+|storage group|
++-------------+
+| 1|
++-------------+
+Total line number = 1
+It costs 0.002s
+```
\ No newline at end of file