Skip to content

Commit

Permalink
Merge branch 'master' into updata-tools'-commit-id
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-lzy authored Oct 27, 2021
2 parents e9b2d85 + 9919be1 commit fda7ba1
Show file tree
Hide file tree
Showing 78 changed files with 164 additions and 597 deletions.
32 changes: 10 additions & 22 deletions docs-2.0/2.quick-start/4.nebula-graph-crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ nebula> SHOW HOSTS;
| Host | Port | Status | Leader count | Leader distribution | Partition distribution |
+-------------+-----------+-----------+--------------+----------------------+------------------------+
| "storaged0" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
+-------------+-----------+-----------+--------------+----------------------+------------------------+
| "storaged1" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
+-------------+-----------+-----------+--------------+----------------------+------------------------+
| "storaged2" | 9779 | "ONLINE" | 0 | "No valid partition" | "No valid partition" |
+-------------+-----------+-----------+--------------+----------------------+------------------------+
| "Total" | __EMPTY__ | __EMPTY__ | 0 | __EMPTY__ | __EMPTY__ |
+-------------+-----------+-----------+--------------+----------------------+------------------------+
Got 4 rows (time spent 1061/2251 us)
Expand All @@ -51,7 +48,7 @@ Got 4 rows (time spent 1061/2251 us)

### 异步实现创建和修改

!!! caution
!!! caution

Nebula Graph中执行如下创建和修改操作,是异步实现的。要在**下一个**心跳周期之后才能生效;否则访问会报错。

Expand Down Expand Up @@ -81,7 +78,7 @@ Got 4 rows (time spent 1061/2251 us)

```ngql
CREATE SPACE [IF NOT EXISTS] <graph_space_name> (
[partition_num = <partition_number>,]
[partition_num = <partition_number>,]
[replica_factor = <replica_number>,]
vid_type = {FIXED_STRING(<N>) | INT64}
)
Expand Down Expand Up @@ -124,11 +121,8 @@ Got 4 rows (time spent 1061/2251 us)
| Host | Port | Status | Leader count | Leader distribution | Partition distribution |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+
| "storaged0" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+
| "storaged1" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+
| "storaged2" | 9779 | "ONLINE" | 5 | "basketballplayer:5" | "basketballplayer:5" |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+
| "Total" | | | 15 | "basketballplayer:15" | "basketballplayer:15" |
+-------------+-----------+-----------+--------------+----------------------------------+------------------------+
Got 4 rows (time spent 1633/2867 us)
Expand Down Expand Up @@ -283,9 +277,9 @@ Execution succeeded (time spent 5858/6870 us)
- 查询Tag属性

```ngql
FETCH PROP ON {<tag_name>[, tag_name ...] | *}
<vid> [, vid ...]
[YIELD <return_list> [AS <alias>]];
FETCH PROP ON {<tag_name>[, tag_name ...] | *}
<vid> [, vid ...]
[YIELD <return_list> [AS <alias>]];
```

- 查询边属性
Expand All @@ -298,8 +292,8 @@ Execution succeeded (time spent 5858/6870 us)
- `LOOKUP`

```ngql
LOOKUP ON {<vertex_tag> | <edge_type>}
[WHERE <expression> [AND <expression> ...]]
LOOKUP ON {<vertex_tag> | <edge_type>}
[WHERE <expression> [AND <expression> ...]]
[YIELD <return_list> [AS <alias>]];
```

Expand All @@ -319,7 +313,6 @@ Execution succeeded (time spent 5858/6870 us)
| follow._dst |
+-------------+
| "player101" |
+-------------+
| "player125" |
+-------------+
Got 2 rows (time spent 12097/14220 us)
Expand All @@ -334,7 +327,6 @@ Execution succeeded (time spent 5858/6870 us)
| Teammate | Age |
+-----------------+-----+
| "Tony Parker" | 36 |
+-----------------+-----+
| "Manu Ginobili" | 41 |
+-----------------+-----+
```
Expand All @@ -357,13 +349,11 @@ Execution succeeded (time spent 5858/6870 us)
| Team | Player |
+-----------+-----------------+
| "Spurs" | "Tony Parker" |
+-----------+-----------------+
| "Hornets" | "Tony Parker" |
+-----------+-----------------+
| "Spurs" | "Manu Ginobili" |
+-----------+-----------------+
```

|子句/符号|说明|
|:---|:---|
| `$^` |表示边的起点。|
Expand All @@ -384,9 +374,7 @@ Execution succeeded (time spent 5858/6870 us)
| Team | Player |
+-----------+-----------------+
| "Spurs" | "Tony Parker" |
+-----------+-----------------+
| "Hornets" | "Tony Parker" |
+-----------+-----------------+
| "Spurs" | "Manu Ginobili" |
+-----------+-----------------+
```
Expand Down Expand Up @@ -540,7 +528,7 @@ nebula> FETCH PROP ON player "player100";
- 创建索引

```ngql
CREATE {TAG | EDGE} INDEX [IF NOT EXISTS] <index_name>
CREATE {TAG | EDGE} INDEX [IF NOT EXISTS] <index_name>
ON {<tag_name> | <edge_name>} ([<prop_name_list>]) [COMMENT = '<comment>'];
```

Expand All @@ -560,7 +548,7 @@ nebula> REBUILD TAG INDEX player_index_0;
```

!!! Note

为没有指定长度的变量属性创建索引时,需要指定索引长度。在utf-8编码中,一个中文字符占3字节,请根据变量属性长度设置合适的索引长度。例如10个中文字符,索引长度需要为30。详情请参见[创建索引](../3.ngql-guide/14.native-index-statements/1.create-native-index.md#_6)。

### 基于索引的`LOOKUP``MATCH`示例
Expand Down
4 changes: 4 additions & 0 deletions docs-2.0/20.appendix/0.FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Nebula Graph一直在持续开发,功能或操作的行为可能会有变化

## 关于执行

### 为什么Nebula Graph 2.6.0的返回结果每行之间没有横线分隔了?

这是Nebula Console 2.6.0版本的变动造成的,不是Nebula Graph内核的变更,不影响返回数据本身的内容。

### 关于悬挂边

悬挂边 (Dangling edge) 是指一条边的起点或者终点在数据库中不存在。
Expand Down
6 changes: 3 additions & 3 deletions docs-2.0/20.appendix/6.eco-tool-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ Docker Compose可以快速部署Nebula Graph集群。如何使用请参见[Docke

|Nebula Graph版本| 语言(commit id) |
|:---| :--- |
| {{ nebula.release }}| [C++](https://github.com/vesoft-inc/nebula-cpp)(00e2625) |
| {{ nebula.release }}| [C++](https://github.com/vesoft-inc/nebula-cpp/tree/{{cpp.branch}})(00e2625) |
| {{ nebula.release }}| [Go](https://github.com/vesoft-inc/nebula-go/tree/{{go.branch}})(02eb246) |
| {{ nebula.release }}| [Python](https://github.com/vesoft-inc/nebula-python)(6e467a9) |
| {{ nebula.release }}| [Java Client](https://github.com/vesoft-inc/nebula-java/tree/{{java.branch}})(8e171e4) |
| {{ nebula.release }}| [Python](https://github.com/vesoft-inc/nebula-python/tree/{{python.branch}})(6e467a9) |
| {{ nebula.release }}| [Java](https://github.com/vesoft-inc/nebula-java/tree/{{java.branch}})(8e171e4) |

## 未发布

Expand Down
3 changes: 1 addition & 2 deletions docs-2.0/3.ngql-guide/10.tag-statements/4.show-tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ nebula> SHOW TAGS;
| Name |
+----------+
| "player" |
+----------+
| "team" |
+----------+
```
```
1 change: 0 additions & 1 deletion docs-2.0/3.ngql-guide/10.tag-statements/5.describe-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ nebula> DESCRIBE TAG player;
| Field | Type | Null | Default | Comment |
+--------+----------+-------+---------+---------+
| "name" | "string" | "YES" | | |
+--------+----------+-------+---------+---------+
| "age" | "int64" | "YES" | | |
+--------+----------+-------+---------+---------+
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ nebula> SHOW EDGES;
| Name |
+----------+
| "follow" |
+----------+
| "serve" |
+----------+
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ nebula> SHOW TAG INDEXES;
| Index Name | By Tag | Columns |
+------------------+--------------+-----------------+
| "fix" | "fix_string" | ["p1"] |
+------------------+--------------+-----------------+
| "player_index_0" | "player" | ["name"] |
+------------------+--------------+-----------------+
| "player_index_1" | "player" | ["name", "age"] |
+------------------+--------------+-----------------+
| "var" | "var_string" | ["p1"] |
+------------------+--------------+-----------------+
Expand All @@ -35,4 +32,4 @@ nebula> SHOW EDGE INDEXES;

!!! Compatibility "历史版本兼容性"

Nebula Graph 2.0.1中, `SHOW TAG/EDGE INDEXES` 语句仅返回 `Names`。
Nebula Graph 2.0.1中, `SHOW TAG/EDGE INDEXES` 语句仅返回 `Names`。
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ nebula> DESCRIBE TAG INDEX player_index_1;
| Field | Type |
+--------+--------------------+
| "name" | "fixed_string(10)" |
+--------+--------------------+
| "age" | "int64" |
+--------+--------------------+
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ nebula> SHOW JOB 31;
| Job Id(TaskId) | Command(Dest) | Status | Start Time | Stop Time |
+----------------+---------------------+------------+-------------------------+-------------------------+
| 31 | "REBUILD_TAG_INDEX" | "FINISHED" | 2021-07-07T09:04:24.000 | 2021-07-07T09:04:24.000 |
+----------------+---------------------+------------+-------------------------+-------------------------+
| 0 | "storaged1" | "FINISHED" | 2021-07-07T09:04:24.000 | 2021-07-07T09:04:28.000 |
+----------------+---------------------+------------+-------------------------+-------------------------+
| 1 | "storaged2" | "FINISHED" | 2021-07-07T09:04:24.000 | 2021-07-07T09:04:28.000 |
+----------------+---------------------+------------+-------------------------+-------------------------+
| 2 | "storaged0" | "FINISHED" | 2021-07-07T09:04:24.000 | 2021-07-07T09:04:28.000 |
+----------------+---------------------+------------+-------------------------+-------------------------+
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ nebula> SHOW TAG INDEX STATUS;
| Name | Index Status |
+----------------------+--------------+
| "player_index_0" | "FINISHED" |
+----------------------+--------------+
| "player_index_1" | "FINISHED" |
+----------------------+--------------+
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ LOOKUP ON {<tag> | <edge_type>} WHERE <expression> [YIELD <return_list>];
- `fuzziness`:可选项。允许匹配的最大编辑距离。默认值为`AUTO`。查看其他可选值和更多信息,请参见[Elasticsearch官方文档](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/common-options.html#fuzziness)

- `operator`:可选项。解释文本的布尔逻辑。可选值为`OR`(默认)和`and`

- `row_limit`:可选项。指定要返回的行数。默认值为`100`

- `timeout`:可选项。指定超时时间。单位:毫秒(ms)。默认值为`200`
Expand Down Expand Up @@ -128,9 +128,7 @@ nebula> LOOKUP ON player WHERE PREFIX(player.name, "B");
| _vid |
+-----------------+
| "Boris Diaw" |
+-----------------+
| "Ben Simmons" |
+-----------------+
| "Blake Griffin" |
+-----------------+
Expand All @@ -139,9 +137,7 @@ nebula> LOOKUP ON player WHERE WILDCARD(player.name, "*ri*") YIELD player.name,
| _vid | name | age |
+-----------------+-----------------+-----+
| "Chris Paul" | "Chris Paul" | 33 |
+-----------------+-----------------+-----+
| "Boris Diaw" | "Boris Diaw" | 36 |
+-----------------+-----------------+-----+
| "Blake Griffin" | "Blake Griffin" | 30 |
+-----------------+-----------------+-----+
Expand All @@ -164,9 +160,7 @@ nebula> LOOKUP ON player WHERE REGEXP(player.name, ".*");
| _vid |
+---------------------+
| "Danny Green" |
+---------------------+
| "David West" |
+---------------------+
| "Russell Westbrook" |
+---------------------+
...
Expand Down
4 changes: 0 additions & 4 deletions docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ GET SUBGRAPH [WITH PROP] [<step_count> STEPS] FROM {<vid>, <vid>...}
| nodes | relationships |
+-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| [("player100" :player{})] | [[:follow "player100"->"player101" @0 {}], [:follow "player100"->"player102" @0 {}], [:serve "player100"->"team200" @0 {}]] |
+-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| [("player101" :player{}), ("player102" :player{}), ("team200" :team{})] | [[:follow "player102"->"player101" @0 {}]] |
+-------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
```
Expand All @@ -55,7 +54,6 @@ GET SUBGRAPH [WITH PROP] [<step_count> STEPS] FROM {<vid>, <vid>...}
| nodes | relationships |
+---------------------------+---------------+
| [("player100" :player{})] | [] |
+---------------------------+---------------+
| [] | [] |
+---------------------------+---------------+
```
Expand All @@ -70,7 +68,6 @@ GET SUBGRAPH [WITH PROP] [<step_count> STEPS] FROM {<vid>, <vid>...}
| nodes | relationships |
+------------------------------------------------------+-------------------------------------------------------------------------+
| [("player100" :player{age: 42, name: "Tim Duncan"})] | [[:serve "player100"->"team200" @0 {end_year: 2016, start_year: 1997}]] |
+------------------------------------------------------+-------------------------------------------------------------------------+
| [("team200" :team{name: "Warriors"})] | [] |
+------------------------------------------------------+-------------------------------------------------------------------------+
```
Expand Down Expand Up @@ -108,7 +105,6 @@ nebula> GET SUBGRAPH 100 STEPS FROM "player141" OUT follow YIELD VERTICES AS nod
| nodes | relationships |
+---------------------------+--------------------------------------------+
| [("player141" :player{})] | [[:follow "player141"->"player124" @0 {}]] |
+---------------------------+--------------------------------------------+
| [("player124" :player{})] | [[:follow "player124"->"player141" @0 {}]] |
+---------------------------+--------------------------------------------+
```
6 changes: 0 additions & 6 deletions docs-2.0/3.ngql-guide/16.subgraph-and-path/2.find-path.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ nebula> FIND ALL PATH FROM "player100" TO "team204" OVER * WHERE follow.degree i
| path |
+------------------------------------------------------------------------------+
| <("player100")-[:serve@0 {}]->("team204")> |
+------------------------------------------------------------------------------+
| <("player100")-[:follow@0 {}]->("player125")-[:serve@0 {}]->("team204")> |
+------------------------------------------------------------------------------+
| <("player100")-[:follow@0 {}]->("player101")-[:serve@0 {}]->("team204")> |
+------------------------------------------------------------------------------+
...
Expand All @@ -88,13 +86,9 @@ nebula> FIND NOLOOP PATH FROM "player100" TO "team204" OVER *;
| path |
+--------------------------------------------------------------------------------------------------------+
| <("player100")-[:serve@0 {}]->("team204")> |
+--------------------------------------------------------------------------------------------------------+
| <("player100")-[:follow@0 {}]->("player125")-[:serve@0 {}]->("team204")> |
+--------------------------------------------------------------------------------------------------------+
| <("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")> |
+--------------------------------------------------------------------------------------------------------+
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
| Name |
+--------+
| player |
+--------+
| team |
+--------+
Got 2 rows (time spent 2038/2728 us)
Expand Down Expand Up @@ -111,4 +110,4 @@ Execution Plan

将上述示例的DOT语言转换为Graphviz图,如下所示。

![Graphviz graph of EXPLAIN SHOW TAGS](https://docs-cdn.nebula-graph.com.cn/docs-2.0/3.ngql-guide/16.query-tuning-statements/explain-show-tags.png)
![Graphviz graph of EXPLAIN SHOW TAGS](https://docs-cdn.nebula-graph.com.cn/docs-2.0/3.ngql-guide/16.query-tuning-statements/explain-show-tags.png)
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,8 @@ 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 |
+----------------+---------------+------------+-------------------------+-------------------------+
```
Expand Down Expand Up @@ -125,11 +122,8 @@ 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 |
+--------+----------------------+------------+-------------------------+-------------------------+
```
Expand Down
Loading

0 comments on commit fda7ba1

Please sign in to comment.