-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[use manual] add more manuals (#742)
* 1. add group_by 2. add property reference 3. mv nebula 127 ..> to nebula> * address judy & amber's comments * add fetch * add order by
- Loading branch information
Showing
27 changed files
with
290 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/manual_doc/Functions_and_Operators/Functions_and_Operator_Reference.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
docs/manual_doc/Functions_and_Operators/Group_By_Function.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
# Aggregate (Group by) function | ||
|
||
The `GROUP BY` functions are similar with SQL. It can only be applied in the `YIELD`-syntax. | ||
|
||
|Name | Description | | ||
|:----|:----:| | ||
| AVG() | Return the average value of the argument | | ||
| COUNT() | Return the number of records | | ||
| COUNT(DISTINCT) | Return the number of different values | | ||
| MAX() | Return the maximum value | | ||
| MIN() | Return the minimum value | | ||
| STD() | Return the population standard deviation | | ||
| SUM() | Return the sum | | ||
|
||
All the functions above can only applies for int64 and double. | ||
|
||
### example | ||
|
||
``` | ||
nebula> GO FROM 1 OVER e1 | YIELD $-.id AS fid, COUNT(*) AS cnt GROUP BY fid | ||
-- for each fid, return the occurrence count. | ||
nebula> GO FROM 1 YIELD e1._dst AS fid, e1.prop1 AS prop1 | YIELD fid, SUM(prop1) GROUP BY fid | ||
-- for each fid, return the sum of prop1. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
docs/manual_doc/Functions_and_Operators/Order_By_Function.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Order By Function | ||
|
||
Similar with SQL, `ORDER BY` can be used to sort in ascending (`ASC`) or descending (`DESC`) order for return results. | ||
And it can only be used in the `PIEP`-syntax ("|") | ||
|
||
``` | ||
| ORDER BY <prop> ASC | DESC [, <prop> ASC | DESC ...] | ||
``` | ||
By default, `ORDER BY` sorts in ascending order if no ASC or DESC is given. | ||
|
||
### Example | ||
|
||
``` | ||
nebula> FETCH PROP ON player 1,2,3,4 YIELD player.age AS age, player.weight as weight | ORDER BY $-.age, $-.weight DESC | ||
-- get four of vertices and sort by their age begin with the youngest one, and for those with the same age, sort by their weight. | ||
``` | ||
(see `FETCH` for the usage) | ||
|
||
``` | ||
nebula> GO FROM 1 OVER edge2 YIELD $^.t1.prop1 AS s1_p1, edge2.prop2 AS e2_p2, $$.t3.prop3 AS d3_p3 | ORDER BY s1_p1 ASC, e2_p2 DESC, d3_p3 ASC | ||
``` | ||
For a group of returned tuples <s1_p1, e2_p2, d3_p3>, first sort in ascending order of s1_p1, then in descending order of e2_p2, finally ascending order of d3_p3. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
<!--- | ||
Not supported yet | ||
---> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
2 changes: 1 addition & 1 deletion
2
docs/manual_doc/Language_Structure/Literal_Values/Boolean_Literals.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/manual_doc/Language_Structure/Literal_Values/NULL_Values.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!--- | ||
>NOTICE: NULL and NOT NULL are NOT FULLY SUPPORTED YET! | ||
The NULL value means “no data.” NULL can be written in any lettercase. Be aware that the NULL value is different from values such as 0 for interges or empty string. | ||
The NULL value means “no data.” NULL can be written in any letter cases. Be aware that the NULL value is different from values such as 0 for interges or empty string. | ||
---> |
Oops, something went wrong.