节点管理
示例:
- 查询 root.ln 的下一层:show child paths root.ln
| child paths|
+------------+
|root.ln.wf01|
|root.ln.wf02|
+------------+
- 查询形如 root.xx.xx.xx 的路径:show child paths root.*.*
+---------------+
| child paths|
+---------------+
|root.ln.wf01.s1|
|root.ln.wf02.s2|
+---------------+
SHOW CHILD NODES pathPattern
可以查看此路径模式所匹配的节点的下一层的所有节点。
示例:
- 查询 root 的下一层:show child nodes root
- 查询 root.ln 的下一层 :show child nodes root.ln
+------------+
| child nodes|
+------------+
| wf01|
| wf02|
+------------+
IoTDB > COUNT NODES root.** LEVEL=2
IoTDB > COUNT NODES root.ln.** LEVEL=2
IoTDB > COUNT NODES root.ln.wf01.* LEVEL=3
IoTDB > COUNT NODES root.**.temperature LEVEL=3
对于上面提到的例子和 Metadata Tree,你可以获得如下结果:
+-----+
|count|
+-----+
| 4|
Total line number = 1
It costs 0.003s
+-----+
|count|
+-----+
+-----+
Total line number = 1
It costs 0.002s
+-----+
|count|
+-----+
| 1|
+-----+
Total line number = 1
It costs 0.002s
+-----+
|count|
+-----+
| 2|
+-----+
Total line number = 1
It costs 0.002s
- SHOW DEVICES pathPattern? (WITH STORAGE GROUP)? limitClause? #showDevices
与 Show Timeseries
相似,IoTDB 目前也支持两种方式查看设备。
SHOW DEVICES
语句显示当前所有的设备信息,等价于SHOW DEVICES root.**
。SHOW DEVICES <PathPattern>
语句规定了PathPattern
,返回给定的路径模式所匹配的设备信息。
你可以获得如下数据:
+-------------------+---------+
| devices|isAligned|
+-------------------+---------+
| root.ln.wf01.wt01| false|
| root.ln.wf02.wt02| false|
|root.sgcc.wf03.wt01| false|
+-------------------+---------+
Total line number = 4
It costs 0.002s
+-----------------+---------+
| devices|isAligned|
+-----------------+---------+
|root.ln.wf01.wt01| false|
|root.ln.wf02.wt02| false|
+-----------------+---------+
Total line number = 2
It costs 0.001s
其中,isAligned
表示该设备下的时间序列是否对齐。
查看设备及其存储组信息,可以使用 SHOW DEVICES WITH STORAGE GROUP
语句。
SHOW DEVICES WITH STORAGE GROUP
语句显示当前所有的设备信息和其所在的存储组,等价于SHOW DEVICES root.**
。SHOW DEVICES <PathPattern> WITH STORAGE GROUP
语句规定了PathPattern
,返回给定的路径模式所匹配的设备信息和其所在的存储组。
IoTDB> show devices with storage group
IoTDB> show devices root.ln.** with storage group
你可以获得如下数据:
+-------------------+-------------+---------+
| devices|storage group|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|
+-------------------+-------------+---------+
Total line number = 4
It costs 0.003s
+-----------------+-------------+---------+
| devices|storage group|isAligned|
+-----------------+-------------+---------+
|root.ln.wf01.wt01| root.ln| false|
|root.ln.wf02.wt02| root.ln| false|
+-----------------+-------------+---------+
Total line number = 2