Skip to content

Commit 537fc41

Browse files
committed
The requirement to query the latest data point with other filtering conditions can be implemented through function composition
1 parent 3a3f4b5 commit 537fc41

File tree

8 files changed

+112
-1
lines changed

8 files changed

+112
-1
lines changed

src/UserGuide/Master/Tree/Basic-Concept/Query-Data.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,19 @@ Total line number = 2
427427
It costs 0.002s
428428
```
429429

430+
**Note:** The requirement to query the latest data point with other filtering conditions can be implemented through function composition. For example:
431+
432+
```
433+
IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device
434+
+-----------------+---------------------+----------------+-----------------------+------------------+
435+
| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)|
436+
+-----------------+---------------------+----------------+-----------------------+------------------+
437+
|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false|
438+
+-----------------+---------------------+----------------+-----------------------+------------------+
439+
Total line number = 1
440+
It costs 0.021s
441+
```
442+
430443
## 3. `WHERE` CLAUSE
431444

432445
In IoTDB query statements, two filter conditions, **time filter** and **value filter**, are supported.

src/UserGuide/V1.3.x/Basic-Concept/Query-Data.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,20 @@ Total line number = 2
427427
It costs 0.002s
428428
```
429429

430+
**Note:** The requirement to query the latest data point with other filtering conditions can be implemented through function composition. For example:
431+
432+
```
433+
IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device
434+
+-----------------+---------------------+----------------+-----------------------+------------------+
435+
| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)|
436+
+-----------------+---------------------+----------------+-----------------------+------------------+
437+
|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false|
438+
+-----------------+---------------------+----------------+-----------------------+------------------+
439+
Total line number = 1
440+
It costs 0.021s
441+
```
442+
443+
430444
## `WHERE` CLAUSE
431445

432446
In IoTDB query statements, two filter conditions, **time filter** and **value filter**, are supported.

src/UserGuide/dev-1.3/Basic-Concept/Query-Data.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,20 @@ Total line number = 2
427427
It costs 0.002s
428428
```
429429

430+
**Note:** The requirement to query the latest data point with other filtering conditions can be implemented through function composition. For example:
431+
432+
```
433+
IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device
434+
+-----------------+---------------------+----------------+-----------------------+------------------+
435+
| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)|
436+
+-----------------+---------------------+----------------+-----------------------+------------------+
437+
|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false|
438+
+-----------------+---------------------+----------------+-----------------------+------------------+
439+
Total line number = 1
440+
It costs 0.021s
441+
```
442+
443+
430444
## `WHERE` CLAUSE
431445

432446
In IoTDB query statements, two filter conditions, **time filter** and **value filter**, are supported.

src/UserGuide/latest/Basic-Concept/Query-Data.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,20 @@ Total line number = 2
427427
It costs 0.002s
428428
```
429429

430+
**Note:** The requirement to query the latest data point with other filtering conditions can be implemented through function composition. For example:
431+
432+
```
433+
IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device
434+
+-----------------+---------------------+----------------+-----------------------+------------------+
435+
| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)|
436+
+-----------------+---------------------+----------------+-----------------------+------------------+
437+
|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false|
438+
+-----------------+---------------------+----------------+-----------------------+------------------+
439+
Total line number = 1
440+
It costs 0.021s
441+
```
442+
443+
430444
## 3. `WHERE` CLAUSE
431445

432446
In IoTDB query statements, two filter conditions, **time filter** and **value filter**, are supported.

src/zh/UserGuide/Master/Tree/Basic-Concept/Query-Data.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,20 @@ Total line number = 2
680680
It costs 0.002s
681681
```
682682
683+
**注意:** 可以通过函数组合方式实现其他过滤条件查询最新点的需求,例如
684+
685+
```
686+
IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device
687+
+-----------------+---------------------+----------------+-----------------------+------------------+
688+
| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)|
689+
+-----------------+---------------------+----------------+-----------------------+------------------+
690+
|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false|
691+
+-----------------+---------------------+----------------+-----------------------+------------------+
692+
Total line number = 1
693+
It costs 0.021s
694+
```
695+
696+
683697
## 3. 查询过滤条件(WHERE 子句)
684698
685699
`WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。

src/zh/UserGuide/V1.3.x/Basic-Concept/Query-Data.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,20 @@ Total line number = 2
680680
It costs 0.002s
681681
```
682682
683+
**注意:** 可以通过函数组合方式实现其他过滤条件查询最新点的需求,例如
684+
685+
```
686+
IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device
687+
+-----------------+---------------------+----------------+-----------------------+------------------+
688+
| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)|
689+
+-----------------+---------------------+----------------+-----------------------+------------------+
690+
|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false|
691+
+-----------------+---------------------+----------------+-----------------------+------------------+
692+
Total line number = 1
693+
It costs 0.021s
694+
```
695+
696+
683697
## 查询过滤条件(WHERE 子句)
684698
685699
`WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。

src/zh/UserGuide/dev-1.3/Basic-Concept/Query-Data.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ select last <Path> [COMMA <Path>]* from < PrefixPath > [COMMA < PrefixPath >]* <
613613

614614
其含义是: 查询时间序列 prefixPath.path 中最近时间戳的数据。
615615

616-
- `whereClause` 中当前只支持时间过滤条件,任何其他过滤条件都将会返回异常。当缓存的最新点不满足过滤条件时,IoTDB 需要从存储中获取结果,此时性能将会有所下降。
616+
- `whereClause` 中当前**只支持时间过滤条件**,任何其他过滤条件都将会返回异常。当缓存的最新点不满足过滤条件时,IoTDB 需要从存储中获取结果,此时性能将会有所下降。
617617

618618
- 结果集为四列的结构:
619619

@@ -680,6 +680,20 @@ Total line number = 2
680680
It costs 0.002s
681681
```
682682
683+
**注意:** 可以通过函数组合方式实现其他过滤条件查询最新点的需求,例如
684+
685+
```
686+
IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device
687+
+-----------------+---------------------+----------------+-----------------------+------------------+
688+
| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)|
689+
+-----------------+---------------------+----------------+-----------------------+------------------+
690+
|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false|
691+
+-----------------+---------------------+----------------+-----------------------+------------------+
692+
Total line number = 1
693+
It costs 0.021s
694+
```
695+
696+
683697
## 查询过滤条件(WHERE 子句)
684698
685699
`WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。

src/zh/UserGuide/latest/Basic-Concept/Query-Data.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,20 @@ Total line number = 2
680680
It costs 0.002s
681681
```
682682
683+
**注意:** 可以通过函数组合方式实现其他过滤条件查询最新点的需求,例如
684+
685+
```
686+
IoTDB> select max_time(*), last_value(*) from root.ln.wf01.wt01 where time >= 2017-11-07T23:50:00 and status = false align by device
687+
+-----------------+---------------------+----------------+-----------------------+------------------+
688+
| Device|max_time(temperature)|max_time(status)|last_value(temperature)|last_value(status)|
689+
+-----------------+---------------------+----------------+-----------------------+------------------+
690+
|root.ln.wf01.wt01| 1510077540000| 1510077540000| 21.067368| false|
691+
+-----------------+---------------------+----------------+-----------------------+------------------+
692+
Total line number = 1
693+
It costs 0.021s
694+
```
695+
696+
683697
## 3. 查询过滤条件(WHERE 子句)
684698
685699
`WHERE` 子句指定了对数据行的筛选条件,由一个 `whereCondition` 组成。

0 commit comments

Comments
 (0)