You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_apache.md
+69-25Lines changed: 69 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -666,21 +666,28 @@ drop timeseries root.ln.wf02.*;
666
666
667
667
### 3.4 Show Timeseries
668
668
669
-
* SHOW LATEST? TIMESERIES pathPattern? whereClause? limitClause?
669
+
#### 1. Grammar
670
670
671
-
There are four optional clauses added in SHOW TIMESERIES, return information of time series
672
-
673
-
Timeseries information includes: timeseries path, alias of measurement, database it belongs to, data type, encoding type, compression type, tags and attributes.
671
+
```sql
672
+
// ---- Show Timeseries
673
+
showTimeseries
674
+
: SHOW LATEST? TIMESERIES prefixPath? timeseriesWhereClause? timeConditionClause? orderByTimeseriesClause? rowPaginationClause?
675
+
;
676
+
// order by timeseries for SHOW TIMESERIES
677
+
orderByTimeseriesClause
678
+
: ORDER BY TIMESERIES (ASC | DESC)?
679
+
;
680
+
```
674
681
675
-
Examples:
682
+
The timeseries query results include: timeseries path, database, alias of measurement, data type, encoding, compression, tags and attributes, etc.
676
683
677
-
* SHOW TIMESERIES
684
+
> Note: Since V2.0.11, the query results can be sorted by timeseries name.
678
685
679
-
presents all timeseries information in JSON form
686
+
#### 2. Usage
680
687
681
-
* SHOW TIMESERIES<`PathPattern`>
688
+
***`SHOW TIMESERIES`**: presents all timeseries information in the system
682
689
683
-
returns all timeseries information matching the given <`PathPattern`>. SQL statements are as follows:
690
+
***`SHOW TIMESERIES <Path>`**: returns all timeseries information under the given path. The `Path` should be a timeseries pathor a path pattern. For example, to view the timeseries under the `root`pathand the `root.ln`path respectively, the SQL statements are as follows:
684
691
685
692
```sql
686
693
show timeseries root.**;
@@ -716,17 +723,13 @@ Total line number = 4
716
723
It costs 0.004s
717
724
```
718
725
719
-
* SHOW TIMESERIES LIMIT INT OFFSET INT
720
-
721
-
returns all the timeseries information start from the offset and limit the number of series returned. For example,
726
+
* **`SHOW TIMESERIES LIMIT INT OFFSET INT`**: returns all the timeseries information start from the offset and limit the number of series returned. For example,
722
727
723
728
```sql
724
729
show timeseries root.ln.** limit 10 offset 10
725
730
```
726
731
727
-
* SHOW TIMESERIES WHERE TIMESERIES contains 'containStr'
728
-
729
-
The query result set is filtered by string fuzzy matching based on the names of the timeseries. For example:
732
+
***`SHOW TIMESERIES WHERE TIMESERIES contains 'containStr'`**: The query result set is filtered by string fuzzy matching based on the names of the timeseries. For example:
730
733
731
734
```sql
732
735
show timeseries root.ln.**where timeseries contains 'wf01.wt'
@@ -745,9 +748,7 @@ Total line number = 2
745
748
It costs 0.016s
746
749
```
747
750
748
-
* SHOW TIMESERIES WHERE DataType=type
749
-
750
-
The query result set is filtered by data type. For example:
751
+
***`SHOW TIMESERIES WHERE DataType=type`**: The query result set is filtered by data type. For example:
751
752
752
753
```sql
753
754
show timeseries root.ln.**where dataType=FLOAT
@@ -768,10 +769,7 @@ It costs 0.016s
768
769
769
770
```
770
771
771
-
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
772
-
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
773
-
774
-
The query result set is filtered by tags. For example:
772
+
***`SHOW TIMESERIES WHERE TAGS(KEY) = VALUE`** / **`SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE`**: The query result set is filtered by tags. For example:
775
773
776
774
```sql
777
775
show timeseries root.ln.**where TAGS(unit)='c';
@@ -800,11 +798,57 @@ It costs 0.004s
800
798
```
801
799
802
800
803
-
* SHOW LATEST TIMESERIES
801
+
***`SHOW LATEST TIMESERIES`**: the returned timeseries are sorted in descending order of the last insertion timestamp. Note that when the queried path does not exist, the system will return 0 timeseries.
802
+
803
+
***`SHOW INVALID TIMESERIES`**: Since V2.0.8, this SQL statement is supported to show the invalidated timeseries after a full path rename succeeds.
Note: The last column `NewPath` in the result shows the new timeseries corresponding to the invalidated one, which serves scenarios such as view construction and cluster migration (Load + rename).
818
+
819
+
***`SHOW TIMESERIES ORDER BY TIMESERIES (ASC | DESC)`**: Since V2.0.11, the query results can be sorted by timeseries name.
820
+
821
+
```sql
822
+
-- Sort by timeseries name in descending order
823
+
show timeseries root.ln.**order by timeseries desc
Copy file name to clipboardExpand all lines: src/UserGuide/latest/Basic-Concept/Operate-Metadata_apache.md
+69-25Lines changed: 69 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -666,21 +666,28 @@ drop timeseries root.ln.wf02.*;
666
666
667
667
### 3.4 Show Timeseries
668
668
669
-
* SHOW LATEST? TIMESERIES pathPattern? whereClause? limitClause?
669
+
#### 1. Grammar
670
670
671
-
There are four optional clauses added in SHOW TIMESERIES, return information of time series
672
-
673
-
Timeseries information includes: timeseries path, alias of measurement, database it belongs to, data type, encoding type, compression type, tags and attributes.
671
+
```sql
672
+
// ---- Show Timeseries
673
+
showTimeseries
674
+
: SHOW LATEST? TIMESERIES prefixPath? timeseriesWhereClause? timeConditionClause? orderByTimeseriesClause? rowPaginationClause?
675
+
;
676
+
// order by timeseries for SHOW TIMESERIES
677
+
orderByTimeseriesClause
678
+
: ORDER BY TIMESERIES (ASC | DESC)?
679
+
;
680
+
```
674
681
675
-
Examples:
682
+
The timeseries query results include: timeseries path, database, alias of measurement, data type, encoding, compression, tags and attributes, etc.
676
683
677
-
* SHOW TIMESERIES
684
+
> Note: Since V2.0.11, the query results can be sorted by timeseries name.
678
685
679
-
presents all timeseries information in JSON form
686
+
#### 2. Usage
680
687
681
-
* SHOW TIMESERIES<`PathPattern`>
688
+
***`SHOW TIMESERIES`**: presents all timeseries information in the system
682
689
683
-
returns all timeseries information matching the given <`PathPattern`>. SQL statements are as follows:
690
+
***`SHOW TIMESERIES <Path>`**: returns all timeseries information under the given path. The `Path` should be a timeseries pathor a path pattern. For example, to view the timeseries under the `root`pathand the `root.ln`path respectively, the SQL statements are as follows:
684
691
685
692
```sql
686
693
show timeseries root.**;
@@ -716,17 +723,13 @@ Total line number = 4
716
723
It costs 0.004s
717
724
```
718
725
719
-
* SHOW TIMESERIES LIMIT INT OFFSET INT
720
-
721
-
returns all the timeseries information start from the offset and limit the number of series returned. For example,
726
+
* **`SHOW TIMESERIES LIMIT INT OFFSET INT`**: returns all the timeseries information start from the offset and limit the number of series returned. For example,
722
727
723
728
```sql
724
729
show timeseries root.ln.** limit 10 offset 10
725
730
```
726
731
727
-
* SHOW TIMESERIES WHERE TIMESERIES contains 'containStr'
728
-
729
-
The query result set is filtered by string fuzzy matching based on the names of the timeseries. For example:
732
+
***`SHOW TIMESERIES WHERE TIMESERIES contains 'containStr'`**: The query result set is filtered by string fuzzy matching based on the names of the timeseries. For example:
730
733
731
734
```sql
732
735
show timeseries root.ln.**where timeseries contains 'wf01.wt'
@@ -745,9 +748,7 @@ Total line number = 2
745
748
It costs 0.016s
746
749
```
747
750
748
-
* SHOW TIMESERIES WHERE DataType=type
749
-
750
-
The query result set is filtered by data type. For example:
751
+
***`SHOW TIMESERIES WHERE DataType=type`**: The query result set is filtered by data type. For example:
751
752
752
753
```sql
753
754
show timeseries root.ln.**where dataType=FLOAT
@@ -768,10 +769,7 @@ It costs 0.016s
768
769
769
770
```
770
771
771
-
* SHOW TIMESERIES WHERE TAGS(KEY) = VALUE
772
-
* SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE
773
-
774
-
The query result set is filtered by tags. For example:
772
+
***`SHOW TIMESERIES WHERE TAGS(KEY) = VALUE`** / **`SHOW TIMESERIES WHERE TAGS(KEY) CONTAINS VALUE`**: The query result set is filtered by tags. For example:
775
773
776
774
```sql
777
775
show timeseries root.ln.**where TAGS(unit)='c';
@@ -800,11 +798,57 @@ It costs 0.004s
800
798
```
801
799
802
800
803
-
* SHOW LATEST TIMESERIES
801
+
***`SHOW LATEST TIMESERIES`**: the returned timeseries are sorted in descending order of the last insertion timestamp. Note that when the queried path does not exist, the system will return 0 timeseries.
802
+
803
+
***`SHOW INVALID TIMESERIES`**: Since V2.0.8, this SQL statement is supported to show the invalidated timeseries after a full path rename succeeds.
Note: The last column `NewPath` in the result shows the new timeseries corresponding to the invalidated one, which serves scenarios such as view construction and cluster migration (Load + rename).
818
+
819
+
***`SHOW TIMESERIES ORDER BY TIMESERIES (ASC | DESC)`**: Since V2.0.11, the query results can be sorted by timeseries name.
820
+
821
+
```sql
822
+
-- Sort by timeseries name in descending order
823
+
show timeseries root.ln.**order by timeseries desc
0 commit comments