Skip to content

Commit

Permalink
[IOTDB-552] Restrictions of predicates in ALIGN_BY_DEVICE statements …
Browse files Browse the repository at this point in the history
…are not well stated (#898)
  • Loading branch information
Alima777 committed Mar 11, 2020
1 parent 7a24d65 commit 16d1570
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,12 +396,19 @@ root.sg1.d0.s0 is INT32 while root.sg2.d3.s0 is FLOAT.
7. 在Select子句中重复写列名是生效的。例如, "select s0,s0,s1 from root.sg.* align by device" 不等于 "select s0,s1 from root.sg.* align by device".
8. 更多正例:
8. 在Where子句中时间过滤条件和值过滤条件均可以使用,值过滤条件可以使用叶子节点 path,或以 root 开头的整个 path,不允许存在通配符。例如,
- select * from root.sg.* where time = 1 align by device
- select * from root.sg.* where s0 < 100 align by device
- select * from root.sg.* where time < 20 AND s0 > 50 align by device
- select * from root.sg.d0 where root.sg.d0.s0 = 15 align by device
9. 更多正例:
- select * from root.vehicle align by device
- select s0,s0,s1 from root.vehicle.* align by device
- select s0,s1 from root.vehicle.* limit 10 offset 1 align by device
- select * from root.vehicle slimit 10 soffset 2 align by device
- select * from root.vehicle where time > 10 align by device
- select * from root.vehicle.* where time < 10 AND s0 > 25 align by device
- select * from root.vehicle where root.vehicle.d0.s0>0 align by device
- select count(*) from root.vehicle align by device
- select sum(*) from root.vehicle GROUP BY (20ms,0,[2,50]) align by device
Expand Down Expand Up @@ -882,4 +889,3 @@ eg. root.ln.wf01.wt01.*
eg. *.wt01.*
eg. *
```

Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ Rules:
Correct example: select * from root.sg1 align by device
Correct example: select * from root.sg1 ALIGN BY DEVICE
2. GroupbyDeviceClause can only be used at the end of a query statement.
2. AlignbyDeviceClause can only be used at the end of a query statement.
Correct example: select * from root.sg1 where time > 10 align by device
Wrong example: select * from root.sg1 align by device where time > 10
Expand Down Expand Up @@ -406,12 +406,19 @@ For example. "select s0,s1 from root.sg.*,root.sg.d0 align by device" is equal t
7. The duplicated measurements in the suffix paths are not neglected.
For example, "select s0,s0,s1 from root.sg.* align by device" is not equal to "select s0,s1 from root.sg.* align by device".
8. More correct examples:
8. Both time predicates and value predicates are allowed in Where Clause. The paths of the value predicates can be the leaf node or full path started with ROOT. And wildcard is not allowed here. For example:
- select * from root.sg.* where time = 1 align by device
- select * from root.sg.* where s0 < 100 align by device
- select * from root.sg.* where time < 20 AND s0 > 50 align by device
- select * from root.sg.d0 where root.sg.d0.s0 = 15 align by device
9. More correct examples:
- select * from root.vehicle align by device
- select s0,s0,s1 from root.vehicle.* align by device
- select s0,s1 from root.vehicle.* limit 10 offset 1 align by device
- select * from root.vehicle slimit 10 soffset 2 align by device
- select * from root.vehicle where time > 10 align by device
- select * from root.vehicle.* where time < 10 AND s0 > 25 align by device
- select * from root.vehicle where root.vehicle.d0.s0>0 align by device
- select count(*) from root.vehicle align by device
- select sum(*) from root.vehicle GROUP BY (20ms,0,[2,50]) align by device
Expand Down

0 comments on commit 16d1570

Please sign in to comment.