Skip to content

Commit 5e041d7

Browse files
authored
add show timeseries where tag (#657)
1 parent dc3aec7 commit 5e041d7

16 files changed

Lines changed: 506 additions & 6 deletions

src/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_apache.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,37 @@ It costs 0.016s
743743

744744
```
745745
746+
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
747+
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
748+
749+
The query result set is filtered by tags. For example:
750+
751+
```
752+
show timeseries root.ln.** where TAGS(unit)='c'
753+
show timeseries root.ln.** where TAGS(description) contains 'test1'
754+
```
755+
756+
The query results are as follows:
757+
758+
```
759+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
760+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
761+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
762+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|{"unit":"c"}| null| null| null|
763+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
764+
Total line number = 1
765+
It costs 0.005s
766+
767+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
768+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
769+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
770+
|root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| PLAIN| SNAPPY|{"description":"test1"}| null| null| null|
771+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
772+
Total line number = 1
773+
It costs 0.004s
774+
775+
```
776+
746777
747778
* SHOW LATEST TIMESERIES
748779

src/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_timecho.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,38 @@ It costs 0.016s
745745
```
746746
747747
748+
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
749+
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
750+
751+
The query result set is filtered by tags. For example:
752+
753+
```
754+
show timeseries root.ln.** where TAGS(unit)='c'
755+
show timeseries root.ln.** where TAGS(description) contains 'test1'
756+
```
757+
758+
The query results are as follows:
759+
760+
```
761+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
762+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
763+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
764+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|{"unit":"c"}| null| null| null|
765+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
766+
Total line number = 1
767+
It costs 0.005s
768+
769+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
770+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
771+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
772+
|root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| PLAIN| SNAPPY|{"description":"test1"}| null| null| null|
773+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
774+
Total line number = 1
775+
It costs 0.004s
776+
777+
```
778+
779+
748780
* SHOW LATEST TIMESERIES
749781
750782
all the returned timeseries information should be sorted in descending order of the last timestamp of timeseries

src/UserGuide/V1.3.x/Basic-Concept/Operate-Metadata_apache.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,37 @@ It costs 0.016s
743743

744744
```
745745
746+
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
747+
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
748+
749+
The query result set is filtered by tags. For example:
750+
751+
```
752+
show timeseries root.ln.** where TAGS(unit)='c'
753+
show timeseries root.ln.** where TAGS(description) contains 'test1'
754+
```
755+
756+
The query results are as follows:
757+
758+
```
759+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
760+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
761+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
762+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|{"unit":"c"}| null| null| null|
763+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
764+
Total line number = 1
765+
It costs 0.005s
766+
767+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
768+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
769+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
770+
|root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| PLAIN| SNAPPY|{"description":"test1"}| null| null| null|
771+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
772+
Total line number = 1
773+
It costs 0.004s
774+
775+
```
776+
746777
747778
* SHOW LATEST TIMESERIES
748779

src/UserGuide/V1.3.x/Basic-Concept/Operate-Metadata_timecho.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,38 @@ It costs 0.016s
745745
```
746746
747747
748+
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
749+
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
750+
751+
The query result set is filtered by tags. For example:
752+
753+
```
754+
show timeseries root.ln.** where TAGS(unit)='c'
755+
show timeseries root.ln.** where TAGS(description) contains 'test1'
756+
```
757+
758+
The query results are as follows:
759+
760+
```
761+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
762+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
763+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
764+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|{"unit":"c"}| null| null| null|
765+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
766+
Total line number = 1
767+
It costs 0.005s
768+
769+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
770+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
771+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
772+
|root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| PLAIN| SNAPPY|{"description":"test1"}| null| null| null|
773+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
774+
Total line number = 1
775+
It costs 0.004s
776+
777+
```
778+
779+
748780
* SHOW LATEST TIMESERIES
749781
750782
all the returned timeseries information should be sorted in descending order of the last timestamp of timeseries

src/UserGuide/dev-1.3/Basic-Concept/Operate-Metadata_apache.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,37 @@ It costs 0.016s
743743

744744
```
745745
746+
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
747+
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
748+
749+
The query result set is filtered by tags. For example:
750+
751+
```
752+
show timeseries root.ln.** where TAGS(unit)='c'
753+
show timeseries root.ln.** where TAGS(description) contains 'test1'
754+
```
755+
756+
The query results are as follows:
757+
758+
```
759+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
760+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
761+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
762+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|{"unit":"c"}| null| null| null|
763+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
764+
Total line number = 1
765+
It costs 0.005s
766+
767+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
768+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
769+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
770+
|root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| PLAIN| SNAPPY|{"description":"test1"}| null| null| null|
771+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
772+
Total line number = 1
773+
It costs 0.004s
774+
775+
```
776+
746777
747778
* SHOW LATEST TIMESERIES
748779

src/UserGuide/dev-1.3/Basic-Concept/Operate-Metadata_timecho.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,38 @@ It costs 0.016s
745745
```
746746
747747
748+
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
749+
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
750+
751+
The query result set is filtered by tags. For example:
752+
753+
```
754+
show timeseries root.ln.** where TAGS(unit)='c'
755+
show timeseries root.ln.** where TAGS(description) contains 'test1'
756+
```
757+
758+
The query results are as follows:
759+
760+
```
761+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
762+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
763+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
764+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|{"unit":"c"}| null| null| null|
765+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
766+
Total line number = 1
767+
It costs 0.005s
768+
769+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
770+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
771+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
772+
|root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| PLAIN| SNAPPY|{"description":"test1"}| null| null| null|
773+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
774+
Total line number = 1
775+
It costs 0.004s
776+
777+
```
778+
779+
748780
* SHOW LATEST TIMESERIES
749781
750782
all the returned timeseries information should be sorted in descending order of the last timestamp of timeseries

src/UserGuide/latest/Basic-Concept/Operate-Metadata_apache.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,37 @@ It costs 0.016s
743743

744744
```
745745
746+
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
747+
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
748+
749+
The query result set is filtered by tags. For example:
750+
751+
```
752+
show timeseries root.ln.** where TAGS(unit)='c'
753+
show timeseries root.ln.** where TAGS(description) contains 'test1'
754+
```
755+
756+
The query results are as follows:
757+
758+
```
759+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
760+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
761+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
762+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|{"unit":"c"}| null| null| null|
763+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
764+
Total line number = 1
765+
It costs 0.005s
766+
767+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
768+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
769+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
770+
|root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| PLAIN| SNAPPY|{"description":"test1"}| null| null| null|
771+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
772+
Total line number = 1
773+
It costs 0.004s
774+
775+
```
776+
746777
747778
* SHOW LATEST TIMESERIES
748779

src/UserGuide/latest/Basic-Concept/Operate-Metadata_timecho.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,38 @@ It costs 0.016s
745745
```
746746
747747
748+
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
749+
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
750+
751+
The query result set is filtered by tags. For example:
752+
753+
```
754+
show timeseries root.ln.** where TAGS(unit)='c'
755+
show timeseries root.ln.** where TAGS(description) contains 'test1'
756+
```
757+
758+
The query results are as follows:
759+
760+
```
761+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
762+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
763+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
764+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|{"unit":"c"}| null| null| null|
765+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
766+
Total line number = 1
767+
It costs 0.005s
768+
769+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
770+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
771+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
772+
|root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| PLAIN| SNAPPY|{"description":"test1"}| null| null| null|
773+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
774+
Total line number = 1
775+
It costs 0.004s
776+
777+
```
778+
779+
748780
* SHOW LATEST TIMESERIES
749781
750782
all the returned timeseries information should be sorted in descending order of the last timestamp of timeseries

src/zh/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_apache.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,37 @@ It costs 0.016s
725725
```
726726

727727

728+
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
729+
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
730+
731+
对查询结果集根据标签进行过滤。例如:
732+
733+
```
734+
show timeseries root.ln.** where TAGS(unit)='c'
735+
show timeseries root.ln.** where TAGS(description) contains 'test1'
736+
```
737+
738+
执行结果分别为:
739+
740+
```
741+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
742+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
743+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
744+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|{"unit":"c"}| null| null| null|
745+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
746+
Total line number = 1
747+
It costs 0.005s
748+
749+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
750+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
751+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
752+
|root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| PLAIN| SNAPPY|{"description":"test1"}| null| null| null|
753+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
754+
Total line number = 1
755+
It costs 0.004s
756+
757+
```
758+
728759
* SHOW LATEST TIMESERIES
729760

730761
表示查询出的时间序列需要按照最近插入时间戳降序排列

src/zh/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_timecho.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,12 +724,44 @@ It costs 0.016s
724724
725725
```
726726

727+
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
728+
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
729+
730+
对查询结果集根据标签进行过滤。例如:
731+
732+
```
733+
show timeseries root.ln.** where TAGS(unit)='c'
734+
show timeseries root.ln.** where TAGS(description) contains 'test1'
735+
```
736+
737+
执行结果分别为:
738+
739+
```
740+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
741+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
742+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
743+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| SNAPPY|{"unit":"c"}| null| null| null|
744+
+--------------------------+-----+-------------+--------+--------+-----------+------------+----------+--------+-------------------+
745+
Total line number = 1
746+
It costs 0.005s
747+
748+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
749+
| timeseries|alias| database|dataType|encoding|compression| tags|attributes|deadband|deadband parameters|
750+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
751+
|root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| PLAIN| SNAPPY|{"description":"test1"}| null| null| null|
752+
+------------------------+-----+-------------+--------+--------+-----------+-----------------------+----------+--------+-------------------+
753+
Total line number = 1
754+
It costs 0.004s
755+
756+
```
757+
727758

728759
* SHOW LATEST TIMESERIES
729760

730761
表示查询出的时间序列需要按照最近插入时间戳降序排列
731762

732763

764+
733765
需要注意的是,当查询路径不存在时,系统会返回 0 条时间序列。
734766

735767
### 3.5 统计时间序列总数

0 commit comments

Comments
 (0)