如何确定子路径是 Apache IoTDB 中的节点还是时间序列
How to determine whether a subpath is a node or a timeseries in Apache IoTDB
比如有一条路径root.sg_2
.
show child paths root.sg_2
可以显示它的子路径,但是我无法确定子路径是节点还是时间序列。
我试过用show timeseries
,它会显示所有时间序列。但是我只想知道子路径的信息。
您可以使用 SHOW TIMESERIES <PathPattern>
.
IoTDB> show timeseries
+----------------+-----+-------------+--------+--------+-----------+----+----------+
| timeseries|alias|storage group|dataType|encoding|compression|tags|attributes|
+----------------+-----+-------------+--------+--------+-----------+----+----------+
| root.sg.d1.s3| null| root.sg| INT32| RLE| SNAPPY|null| null|
| root.sg.d1.s1| null| root.sg| INT32| RLE| SNAPPY|null| null|
| root.sg.d1.s2| null| root.sg| INT32| RLE| SNAPPY|null| null|
|root.sg.d1.c1.s4| null| root.sg| INT32| RLE| SNAPPY|null| null|
|root.sg.d1.c1.s5| null| root.sg| INT32| RLE| SNAPPY|null| null|
+----------------+-----+-------------+--------+--------+-----------+----+----------+
Total line number = 5
It costs 0.026s
IoTDB> show child paths root.sg.d1
+-------------+
| child paths|
+-------------+
|root.sg.d1.s1|
|root.sg.d1.s2|
|root.sg.d1.s3|
|root.sg.d1.c1|
+-------------+
Total line number = 4
It costs 0.015s
IoTDB> show timeseries root.sg.d1.*
+----------------+-----+-------------+--------+--------+-----------+----+----------+
| timeseries|alias|storage group|dataType|encoding|compression|tags|attributes|
+----------------+-----+-------------+--------+--------+-----------+----+----------+
| root.sg.d1.s3| null| root.sg| INT32| RLE| SNAPPY|null| null|
| root.sg.d1.s1| null| root.sg| INT32| RLE| SNAPPY|null| null|
| root.sg.d1.s2| null| root.sg| INT32| RLE| SNAPPY|null| null|
+----------------+-----+-------------+--------+--------+-----------+----+----------+
Total line number = 3
It costs 0.015s
IoTDB> show timeseries root.sg.*
+----------------+-----+-------------+--------+--------+-----------+----+----------+
| timeseries|alias|storage group|dataType|encoding|compression|tags|attributes|
+----------------+-----+-------------+--------+--------+-----------+----+----------+
+----------------+-----+-------------+--------+--------+-----------+----+----------+
Total line number = 0
查看文档 https://iotdb.apache.org/UserGuide/Master/IoTDB-SQL-Language/DDL-Data-Definition-Language.html#show-timeseries 了解更多详情。
比如有一条路径root.sg_2
.
show child paths root.sg_2
可以显示它的子路径,但是我无法确定子路径是节点还是时间序列。
我试过用show timeseries
,它会显示所有时间序列。但是我只想知道子路径的信息。
您可以使用 SHOW TIMESERIES <PathPattern>
.
IoTDB> show timeseries
+----------------+-----+-------------+--------+--------+-----------+----+----------+
| timeseries|alias|storage group|dataType|encoding|compression|tags|attributes|
+----------------+-----+-------------+--------+--------+-----------+----+----------+
| root.sg.d1.s3| null| root.sg| INT32| RLE| SNAPPY|null| null|
| root.sg.d1.s1| null| root.sg| INT32| RLE| SNAPPY|null| null|
| root.sg.d1.s2| null| root.sg| INT32| RLE| SNAPPY|null| null|
|root.sg.d1.c1.s4| null| root.sg| INT32| RLE| SNAPPY|null| null|
|root.sg.d1.c1.s5| null| root.sg| INT32| RLE| SNAPPY|null| null|
+----------------+-----+-------------+--------+--------+-----------+----+----------+
Total line number = 5
It costs 0.026s
IoTDB> show child paths root.sg.d1
+-------------+
| child paths|
+-------------+
|root.sg.d1.s1|
|root.sg.d1.s2|
|root.sg.d1.s3|
|root.sg.d1.c1|
+-------------+
Total line number = 4
It costs 0.015s
IoTDB> show timeseries root.sg.d1.*
+----------------+-----+-------------+--------+--------+-----------+----+----------+
| timeseries|alias|storage group|dataType|encoding|compression|tags|attributes|
+----------------+-----+-------------+--------+--------+-----------+----+----------+
| root.sg.d1.s3| null| root.sg| INT32| RLE| SNAPPY|null| null|
| root.sg.d1.s1| null| root.sg| INT32| RLE| SNAPPY|null| null|
| root.sg.d1.s2| null| root.sg| INT32| RLE| SNAPPY|null| null|
+----------------+-----+-------------+--------+--------+-----------+----+----------+
Total line number = 3
It costs 0.015s
IoTDB> show timeseries root.sg.*
+----------------+-----+-------------+--------+--------+-----------+----+----------+
| timeseries|alias|storage group|dataType|encoding|compression|tags|attributes|
+----------------+-----+-------------+--------+--------+-----------+----+----------+
+----------------+-----+-------------+--------+--------+-----------+----+----------+
Total line number = 0
查看文档 https://iotdb.apache.org/UserGuide/Master/IoTDB-SQL-Language/DDL-Data-Definition-Language.html#show-timeseries 了解更多详情。