From 14528ac5848a475345f568d7afab6c495f4713d4 Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Mon, 1 Nov 2021 15:39:20 +0800 Subject: [PATCH] verify nGQL --- .../10.tag-statements/6.delete-tag.md | 4 +-- .../12.vertex-statements/1.insert-vertex.md | 2 +- .../12.vertex-statements/3.upsert-vertex.md | 9 ++++- .../2.1.show-create-index.md | 13 +++---- .../16.subgraph-and-path/2.find-path.md | 3 +- .../4.job-statements.md | 35 +++++++++---------- .../8.clauses-and-options/group-by.md | 12 +++---- .../8.clauses-and-options/limit.md | 6 ++-- .../8.clauses-and-options/order-by.md | 28 +++++++-------- .../8.clauses-and-options/return.md | 16 ++++----- .../8.clauses-and-options/where.md | 5 ++- .../8.clauses-and-options/with.md | 34 +++++++++--------- .../9.space-statements/5.drop-space.md | 2 +- 13 files changed, 89 insertions(+), 80 deletions(-) diff --git a/docs-2.0/3.ngql-guide/10.tag-statements/6.delete-tag.md b/docs-2.0/3.ngql-guide/10.tag-statements/6.delete-tag.md index a296d0c234c..ede5aad5df0 100644 --- a/docs-2.0/3.ngql-guide/10.tag-statements/6.delete-tag.md +++ b/docs-2.0/3.ngql-guide/10.tag-statements/6.delete-tag.md @@ -54,5 +54,5 @@ nebula> FETCH PROP ON * "test"; !!! Compatibility - * 在 openCypher 中,可以使用 `REMOVE v:LABEL` 语句来移除该点 `v` 的 `LABEL`; - * 相同语意,但不同语法。在 nGQL 中使用 `DELETE TAG`; + * 在 openCypher 中,可以使用 `REMOVE v:LABEL` 语句来移除该点 `v` 的 `LABEL`。 + * 相同语意,但不同语法。在 nGQL 中使用 `DELETE TAG`。 diff --git a/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md b/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md index 3005755577b..6557c47dd6e 100644 --- a/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md +++ b/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md @@ -92,7 +92,7 @@ nebula> INSERT VERTEX t5(p1, p2, p3) VALUES "001":("Abe", 2, 3); # 插入失败,因为属性p1不能为NULL。 nebula> INSERT VERTEX t5(p1, p2, p3) VALUES "002":(NULL, 4, 5); -[ERROR (-8)]: Storage Error: The not null field cannot be null. +[ERROR (-1005)]: Storage Error: The not null field cannot be null. # 属性p3为默认值NULL。 nebula> INSERT VERTEX t5(p1, p2) VALUES "003":("cd", 5); diff --git a/docs-2.0/3.ngql-guide/12.vertex-statements/3.upsert-vertex.md b/docs-2.0/3.ngql-guide/12.vertex-statements/3.upsert-vertex.md index da394a75b49..e939bb3a7f9 100644 --- a/docs-2.0/3.ngql-guide/12.vertex-statements/3.upsert-vertex.md +++ b/docs-2.0/3.ngql-guide/12.vertex-statements/3.upsert-vertex.md @@ -57,6 +57,10 @@ SET ```ngql // 查看三个点是否存在,结果“Empty set”表示顶点不存在。 nebula> FETCH PROP ON * "player666", "player667", "player668"; ++-----------+ +| vertices_ | ++-----------+ ++-----------+ Empty set nebula> UPSERT VERTEX ON player "player666" \ @@ -69,7 +73,10 @@ nebula> UPSERT VERTEX ON player "player666" \ | __NULL__ | 30 | +----------+----------+ -nebula> UPSERT VERTEX ON player "player666" SET age = 31 WHEN name == "Joe" YIELD name AS Name, age AS Age; +nebula> UPSERT VERTEX ON player "player666" \ + SET age = 31 \ + WHEN name == "Joe" \ + YIELD name AS Name, age AS Age; +----------+-----+ | Name | Age | +----------+-----+ diff --git a/docs-2.0/3.ngql-guide/14.native-index-statements/2.1.show-create-index.md b/docs-2.0/3.ngql-guide/14.native-index-statements/2.1.show-create-index.md index a776c9b2cc2..0df901dd55e 100644 --- a/docs-2.0/3.ngql-guide/14.native-index-statements/2.1.show-create-index.md +++ b/docs-2.0/3.ngql-guide/14.native-index-statements/2.1.show-create-index.md @@ -14,18 +14,19 @@ SHOW CREATE {TAG | EDGE} INDEX ; ```ngql nebula> SHOW TAG INDEXES; -+------------------+--------------+-----------------+ -| "player_index_0" | "player" | ["name"] | -+------------------+--------------+-----------------+ -| "player_index_1" | "player" | ["name", "age"] | -+------------------+--------------+-----------------+ ++------------------+----------+----------+ +| Index Name | By Tag | Columns | ++------------------+----------+----------+ +| "player_index_0" | "player" | [] | +| "player_index_1" | "player" | ["name"] | ++------------------+----------+----------+ nebula> SHOW CREATE TAG INDEX player_index_1; +------------------+--------------------------------------------------+ | Tag Index Name | Create Tag Index | +------------------+--------------------------------------------------+ | "player_index_1" | "CREATE TAG INDEX `player_index_1` ON `player` ( | -| | `name(20)` | +| | `name`(20) | | | )" | +------------------+--------------------------------------------------+ ``` diff --git a/docs-2.0/3.ngql-guide/16.subgraph-and-path/2.find-path.md b/docs-2.0/3.ngql-guide/16.subgraph-and-path/2.find-path.md index 5367c22c847..076c1d14ea5 100644 --- a/docs-2.0/3.ngql-guide/16.subgraph-and-path/2.find-path.md +++ b/docs-2.0/3.ngql-guide/16.subgraph-and-path/2.find-path.md @@ -76,8 +76,8 @@ nebula> FIND ALL PATH FROM "player100" TO "team204" OVER * WHERE follow.degree i | <("player100")-[:serve@0 {}]->("team204")> | | <("player100")-[:follow@0 {}]->("player125")-[:serve@0 {}]->("team204")> | | <("player100")-[:follow@0 {}]->("player101")-[:serve@0 {}]->("team204")> | +| ... | +------------------------------------------------------------------------------+ -... ``` ```ngql @@ -90,6 +90,7 @@ nebula> FIND NOLOOP PATH FROM "player100" TO "team204" OVER *; | <("player100")-[:follow@0 {}]->("player101")-[:serve@0 {}]->("team204")> | | <("player100")-[:follow@0 {}]->("player101")-[:follow@0 {}]->("player125")-[:serve@0 {}]->("team204")> | | <("player100")-[:follow@0 {}]->("player101")-[:follow@0 {}]->("player102")-[:serve@0 {}]->("team204")> | +| ... | +--------------------------------------------------------------------------------------------------------+ ``` diff --git a/docs-2.0/3.ngql-guide/18.operation-and-maintenance-statements/4.job-statements.md b/docs-2.0/3.ngql-guide/18.operation-and-maintenance-statements/4.job-statements.md index 4a1776fb79f..e36283f349b 100644 --- a/docs-2.0/3.ngql-guide/18.operation-and-maintenance-statements/4.job-statements.md +++ b/docs-2.0/3.ngql-guide/18.operation-and-maintenance-statements/4.job-statements.md @@ -53,7 +53,7 @@ nebula> SUBMIT JOB STATS; +------------+ | New Job Id | +------------+ -| 97 | +| 34 | +------------+ ``` @@ -66,15 +66,13 @@ Meta服务将`SUBMIT JOB`请求解析为多个任务,然后分配给进程nebu ### 示例 ```ngql -nebula> SHOW JOB 96; -+----------------+---------------+------------+-------------------------+-------------------------+ -| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time | -+----------------+---------------+------------+-------------------------+-------------------------+ -| 96 | "FLUSH" | "FINISHED" | 2020-11-28T14:14:29.000 | 2020-11-28T14:14:29.000 | -| 0 | "storaged2" | "FINISHED" | 2020-11-28T14:14:29.000 | 2020-11-28T14:14:29.000 | -| 1 | "storaged0" | "FINISHED" | 2020-11-28T14:14:29.000 | 2020-11-28T14:14:29.000 | -| 2 | "storaged1" | "FINISHED" | 2020-11-28T14:14:29.000 | 2020-11-28T14:14:29.000 | -+----------------+---------------+------------+-------------------------+-------------------------+ +nebula> SHOW JOB 34; ++----------------+-----------------+------------+----------------------------+----------------------------+ +| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time | ++----------------+-----------------+------------+----------------------------+----------------------------+ +| 34 | "STATS" | "FINISHED" | 2021-11-01T03:32:27.000000 | 2021-11-01T03:32:27.000000 | +| 0 | "192.168.8.111" | "FINISHED" | 2021-11-01T03:32:27.000000 | 2021-11-01T03:32:41.000000 | ++----------------+-----------------+------------+----------------------------+----------------------------+ ``` |参数|说明| @@ -118,14 +116,15 @@ Queue -- running -- finished -- removed ```ngql nebula> SHOW JOBS; -+--------+----------------------+------------+-------------------------+-------------------------+ -| Job Id | Command | Status | Start Time | Stop Time | -+--------+----------------------+------------+-------------------------+-------------------------+ -| 97 | "STATS" | "FINISHED" | 2020-11-28T14:48:52.000 | 2020-11-28T14:48:52.000 | -| 96 | "FLUSH" | "FINISHED" | 2020-11-28T14:14:29.000 | 2020-11-28T14:14:29.000 | -| 95 | "STATS" | "FINISHED" | 2020-11-28T13:02:11.000 | 2020-11-28T13:02:11.000 | -| 86 | "REBUILD_EDGE_INDEX" | "FINISHED" | 2020-11-26T13:38:24.000 | 2020-11-26T13:38:24.000 | -+--------+----------------------+------------+-------------------------+-------------------------+ ++--------+---------------------+------------+----------------------------+----------------------------+ +| Job Id | Command | Status | Start Time | Stop Time | ++--------+---------------------+------------+----------------------------+----------------------------+ +| 34 | "STATS" | "FINISHED" | 2021-11-01T03:32:27.000000 | 2021-11-01T03:32:27.000000 | +| 33 | "FLUSH" | "FINISHED" | 2021-11-01T03:32:15.000000 | 2021-11-01T03:32:15.000000 | +| 32 | "COMPACT" | "FINISHED" | 2021-11-01T03:32:06.000000 | 2021-11-01T03:32:06.000000 | +| 31 | "REBUILD_TAG_INDEX" | "FINISHED" | 2021-10-29T05:39:16.000000 | 2021-10-29T05:39:17.000000 | +| 10 | "COMPACT" | "FINISHED" | 2021-10-26T02:27:05.000000 | 2021-10-26T02:27:05.000000 | ++--------+---------------------+------------+----------------------------+----------------------------+ ``` ## STOP JOB diff --git a/docs-2.0/3.ngql-guide/8.clauses-and-options/group-by.md b/docs-2.0/3.ngql-guide/8.clauses-and-options/group-by.md index 79ba063bc80..691c00cd875 100644 --- a/docs-2.0/3.ngql-guide/8.clauses-and-options/group-by.md +++ b/docs-2.0/3.ngql-guide/8.clauses-and-options/group-by.md @@ -44,16 +44,16 @@ nebula> GO FROM "player100" OVER follow BIDIRECT \ +---------------------+------------+ | Player | Name_Count | +---------------------+------------+ +| "Shaquille O'Neal" | 1 | | "Tiago Splitter" | 1 | -| "Aron Baynes" | 1 | -| "Boris Diaw" | 1 | | "Manu Ginobili" | 2 | -| "Dejounte Murray" | 1 | -| "Danny Green" | 1 | -| "Tony Parker" | 2 | -| "Shaquille O'Neal" | 1 | +| "Boris Diaw" | 1 | | "LaMarcus Aldridge" | 1 | +| "Tony Parker" | 2 | | "Marco Belinelli" | 1 | +| "Dejounte Murray" | 1 | +| "Danny Green" | 1 | +| "Aron Baynes" | 1 | +---------------------+------------+ ``` diff --git a/docs-2.0/3.ngql-guide/8.clauses-and-options/limit.md b/docs-2.0/3.ngql-guide/8.clauses-and-options/limit.md index 5d5ddf28802..b8b486673dd 100644 --- a/docs-2.0/3.ngql-guide/8.clauses-and-options/limit.md +++ b/docs-2.0/3.ngql-guide/8.clauses-and-options/limit.md @@ -47,9 +47,9 @@ nebula> LOOKUP ON player |\ # 从排序后结果中返回第2行开始的3行数据。 nebula> GO FROM "player100" OVER follow REVERSELY \ - YIELD properties($$).name AS Friend, properties($$).age AS Age \| - ORDER BY $-.Age, $-.Friend \| - LIMIT 1, 3; + YIELD properties($$).name AS Friend, properties($$).age AS Age \ + | ORDER BY $-.Age, $-.Friend \ + | LIMIT 1, 3; +-------------------+-----+ | Friend | Age | +-------------------+-----+ diff --git a/docs-2.0/3.ngql-guide/8.clauses-and-options/order-by.md b/docs-2.0/3.ngql-guide/8.clauses-and-options/order-by.md index a05498adf7a..438c7d80e07 100644 --- a/docs-2.0/3.ngql-guide/8.clauses-and-options/order-by.md +++ b/docs-2.0/3.ngql-guide/8.clauses-and-options/order-by.md @@ -93,22 +93,22 @@ nebula> MATCH (v:player) RETURN v.age AS Age, v.name AS Name \ nebula> MATCH (v:player{name:"Tim Duncan"}) --> (v2) \ RETURN v2.name AS Name, v2.age AS Age \ ORDER BY Age; -+-----------------+----------+ -| Name | Age | -+-----------------+----------+ -| "Tony Parker" | 36 | -| "Manu Ginobili" | 41 | -| "Spurs" | __NULL__ | -+-----------------+----------+ ++-----------------+--------------+ +| Name | Age | ++-----------------+--------------+ +| "Tony Parker" | 36 | +| "Manu Ginobili" | 41 | +| "Spurs" | UNKNOWN_PROP | ++-----------------+--------------+ nebula> MATCH (v:player{name:"Tim Duncan"}) --> (v2) \ RETURN v2.name AS Name, v2.age AS Age \ ORDER BY Age DESC; -+-----------------+----------+ -| Name | Age | -+-----------------+----------+ -| "Spurs" | __NULL__ | -| "Manu Ginobili" | 41 | -| "Tony Parker" | 36 | -+-----------------+----------+ ++-----------------+--------------+ +| Name | Age | ++-----------------+--------------+ +| "Spurs" | UNKNOWN_PROP | +| "Manu Ginobili" | 41 | +| "Tony Parker" | 36 | ++-----------------+--------------+ ``` diff --git a/docs-2.0/3.ngql-guide/8.clauses-and-options/return.md b/docs-2.0/3.ngql-guide/8.clauses-and-options/return.md index d3f516dca19..d24c3474ca3 100644 --- a/docs-2.0/3.ngql-guide/8.clauses-and-options/return.md +++ b/docs-2.0/3.ngql-guide/8.clauses-and-options/return.md @@ -157,13 +157,13 @@ nebula> RETURN "Amber" AS Name; ```ngql nebula> MATCH (v:player{name:"Tim Duncan"})-[e]->(v2) \ RETURN v2.name, type(e), v2.age; -+-----------------+----------+----------+ -| v2.name | type(e) | v2.age | -+-----------------+----------+----------+ -| "Tony Parker" | "follow" | 36 | -| "Manu Ginobili" | "follow" | 41 | -| "Spurs" | "serve" | __NULL__ | -+-----------------+----------+----------+ ++-----------------+----------+--------------+ +| v2.name | type(e) | v2.age | ++-----------------+----------+--------------+ +| "Tony Parker" | "follow" | 36 | +| "Manu Ginobili" | "follow" | 41 | +| "Spurs" | "serve" | UNKNOWN_PROP | ++-----------------+----------+--------------+ ``` ## 返回表达式结果 @@ -195,7 +195,7 @@ nebula> RETURN 3 > 1; | true | +-------+ -RETURN 1+1, rand32(1, 5); +nebula> RETURN 1+1, rand32(1, 5); +-------+-------------+ | (1+1) | rand32(1,5) | +-------+-------------+ diff --git a/docs-2.0/3.ngql-guide/8.clauses-and-options/where.md b/docs-2.0/3.ngql-guide/8.clauses-and-options/where.md index fbce8229bba..0f9c2a9ccc4 100644 --- a/docs-2.0/3.ngql-guide/8.clauses-and-options/where.md +++ b/docs-2.0/3.ngql-guide/8.clauses-and-options/where.md @@ -141,6 +141,7 @@ nebula> MATCH (v:player) \ | "Boris Diaw" | 36 | | "DeAndre Jordan" | 30 | +-------------------------+-------+ +... ``` ### 过滤rank @@ -301,7 +302,9 @@ nebula> MATCH (v:player) \ | "Joel Embiid" | 25 | +-------------------------+-------+ -nebula> LOOKUP ON player WHERE player.age IN [25,28] YIELD properties(vertex).name, properties(vertex).age; +nebula> LOOKUP ON player \ + WHERE player.age IN [25,28] \ + YIELD properties(vertex).name, properties(vertex).age; +-------------+-------------------------+------------------------+ | VertexID | properties(VERTEX).name | properties(VERTEX).age | +-------------+-------------------------+------------------------+ diff --git a/docs-2.0/3.ngql-guide/8.clauses-and-options/with.md b/docs-2.0/3.ngql-guide/8.clauses-and-options/with.md index 8a2c326b891..993713df75f 100644 --- a/docs-2.0/3.ngql-guide/8.clauses-and-options/with.md +++ b/docs-2.0/3.ngql-guide/8.clauses-and-options/with.md @@ -26,22 +26,22 @@ nebula> MATCH p=(v:player{name:"Tim Duncan"})--() \ WITH nodes(p) AS n \ UNWIND n AS n1 \ RETURN DISTINCT n1; -+----------------------------------------------------------------------+ -| n1 | -+----------------------------------------------------------------------+ -| ("player100" :star{} :person{} :player{age: 42, name: "Tim Duncan"}) | -| ("player101" :player{age: 36, name: "Tony Parker"}) | -| ("team204" :team{name: "Spurs"}) | -| ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | -| ("player125" :player{age: 41, name: "Manu Ginobili"}) | -| ("player104" :player{age: 32, name: "Marco Belinelli"}) | -| ("player144" :player{age: 47, name: "Shaquile O'Neal"}) | -| ("player105" :player{age: 31, name: "Danny Green"}) | -| ("player113" :player{age: 29, name: "Dejounte Murray"}) | -| ("player107" :player{age: 32, name: "Aron Baynes"}) | -| ("player109" :player{age: 34, name: "Tiago Splitter"}) | -| ("player108" :player{age: 36, name: "Boris Diaw"}) | -+----------------------------------------------------------------------+ ++-----------------------------------------------------------+ +| n1 | ++-----------------------------------------------------------+ +| ("player100" :player{age: 42, name: "Tim Duncan"}) | +| ("player101" :player{age: 36, name: "Tony Parker"}) | +| ("team204" :team{name: "Spurs"}) | +| ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) | +| ("player125" :player{age: 41, name: "Manu Ginobili"}) | +| ("player104" :player{age: 32, name: "Marco Belinelli"}) | +| ("player144" :player{age: 47, name: "Shaquille O'Neal"}) | +| ("player105" :player{age: 31, name: "Danny Green"}) | +| ("player113" :player{age: 29, name: "Dejounte Murray"}) | +| ("player107" :player{age: 32, name: "Aron Baynes"}) | +| ("player109" :player{age: 34, name: "Tiago Splitter"}) | +| ("player108" :player{age: 36, name: "Boris Diaw"}) | ++-----------------------------------------------------------+ ``` ### 示例2 @@ -60,9 +60,7 @@ nebula> MATCH (v) \ +----------+ | tags_f | +----------+ -| "star" | | "player" | -| "person" | +----------+ ``` diff --git a/docs-2.0/3.ngql-guide/9.space-statements/5.drop-space.md b/docs-2.0/3.ngql-guide/9.space-statements/5.drop-space.md index b2de05aaff8..789028d5327 100644 --- a/docs-2.0/3.ngql-guide/9.space-statements/5.drop-space.md +++ b/docs-2.0/3.ngql-guide/9.space-statements/5.drop-space.md @@ -12,7 +12,7 @@ DROP SPACE [IF EXISTS] ; ``` -`IF NOT EXISTS`关键字可以检测待删除的图空间是否存在,只有存在时,才会删除图空间。 +`IF EXISTS`关键字可以检测待删除的图空间是否存在,只有存在时,才会删除图空间。 `DROP SPACE`语句不会立刻删除硬盘上对应图空间的目录和文件,请使用`USE`语句指定其他任意图空间,然后执行`SUBMIT JOB COMPACT`。