Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc]on-call #18

Merged
merged 4 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/manual-CN/1.overview/1.concepts/1.data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ G = < V, E, P<sub>V</sub>, P<sub>E</sub> >,

## 属性

属性为点和边内部的键值对。本例中,节点 **player** 拥有属性 `id`, `name` 和 `age`,边 _**like** 则拥有属性 `likeness`。
属性为点和边内部的键值对。本例中,节点 **player** 拥有属性 `id`, `name` 和 `age`,边 **like** 则拥有属性 `likeness`。

## Schema

Expand Down
2 changes: 1 addition & 1 deletion docs/manual-CN/1.overview/2.quick-start/2.FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ nebula> SHOW CONFIGS;

### 单机先后加入两个不同集群

同一台主机先后用于单机测试和集群测试,storaged 服务无法正常启动(终端上显示的 storaged 服务的监听端口是红色的)。查看 storged 服务的日志(/usr/local/nebula/nebula-storaged.ERROR),若发现 "wrong cluster" 的报错信息,则可能的出错原因是单机测试和集群测试时的 Nebula Graph 生成的 cluster id 不一致,需要删除 Nebula Graph 安装目录(/usr/local/nebula)下的 cluster.id 文件和 data 目录后,重启服务。
同一台主机先后用于单机测试和集群测试,storaged 服务无法正常启动(终端上显示的 storaged 服务的监听端口是红色的)。查看 storaged 服务的日志(/usr/local/nebula/nebula-storaged.ERROR),若发现 "wrong cluster" 的报错信息,则可能的出错原因是单机测试和集群测试时的 Nebula Graph 生成的 cluster id 不一致,需要删除 Nebula Graph 安装目录(/usr/local/nebula)下的 cluster.id 文件和 data 目录后,重启服务。

[[↑] 回到顶部](#常见问题)

Expand Down
12 changes: 6 additions & 6 deletions docs/manual-CN/2.query-language/1.data-types/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

### 整型

整型的关键字为 `int`,为 64 位*有符号*整型,范围是 `[-9223372036854775808, 9223372036854775807]`,且在基于 int64 的计算中不存在溢出。整型常量支持多种格式:
整型的关键字为 `int`,为 64 位**有符号**整型,范围是 `[-9223372036854775808, 9223372036854775807]`。整型常量支持多种格式:

1. 十进制,例如 `123456`
1. 十六进制,例如 `0xdeadbeaf`
1. 八进制,例如 `01234567`
2. 十六进制,例如 `0xdeadbeaf`
3. 八进制,例如 `01234567`

<!-- ### 浮点型

单精度浮点数的关键字为 `float`,且 `float` 仅对 Schema 定义及存储字节数有意义,浮点型字面常量在语法解析以及运算过程中,均被当做双精度浮点数看待。
单精度浮点数的关键字为 `float`,且 `float` 仅对 Schema 定义及存储字节数有意义,浮点型字面常量在语法解析以及运算过程中,均被当做双精度浮点数看待。 -->

### 双浮点型

双精度浮点数的关键字为 `double`,且没有上限和下限。 -->
双精度浮点数的关键字为 `double`,且没有上限和下限。

## 布尔型

Expand All @@ -39,7 +39,7 @@
- 调用函数 now()
- 时间字符串,例如:"2019-10-01 10:00:00"
- 直接输入时间戳,即从 1970-01-01 00:00:00 开始的秒数
- 做数据存储的时候,会先将时间转化为 **UTC 时间**,读取的时候会将存储的 **UTC 时间**转换为**本地时间**给用户
- 做数据存储的时候,会先将时间转化为 **UTC 时间**,读取的时候 console 会将存储的 **UTC 时间**转换为**本地时间**给用户
- 底层存储数据类型为: **int64**

## 示例
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ double ceil(double x) | 返回大于参数的最小整数(向上取整)  |
double round(double x) | 对参数取整,如果参数位于中间位置,则返回远离 0 的数字 |
double sqrt(double x) | 返回参数的平方根 |
double cbrt(double x) | 返回参数的立方根 |
double hypot(double x, double x) | 返回一个正三角形的斜边 |
double hypot(double x, double y) | 返回一个直角三角形的斜边 |
double pow(double x, double y) | 返回 x 的 y 次幂 |
double exp(double x) | 计算 e 的 x 次幂 |
double exp2(double x) | 返回 2 的指定次方 |
double exp2(double x) | 返回 2 的指定次幂 |
double log(double x) | 返回参数的自然对数 |
double log2(double x) | 返回底数为 2 的对数 |
double log10(double x) | 返回底数为 10 的对数 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ nebula> YIELD 2 >= 2;

```ngql
nebula> YIELD 2.0 < 1.9;
=======================
| (2.000000<1.900000) |
=======================
| false |
-----------------------
=========================================
| (2.000000000000000<1.900000000000000) |
=========================================
| false |
-----------------------------------------
```

* &le;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 聚合函数 (Group By)
# 分组 (Group By)

`GROUP BY` 函数类似于 SQL。 只能与 `YIELD` 语句一起使用。
`GROUP BY` 类似于 SQL。 只能与 `YIELD` 语句一起使用。

|名称 | 描述 |
|:----|:----:|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
下面的列表展示了 nGQL 运算符的优先级(降序)。同一行的运算符拥有一致的优先级。

```c
- (负数)
!
- (减法)
*, /, %
-, +
== , >=, >, <=, <, <>, !=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Nebula Graph** 支持四种注释方式:

* 在行末加 #
* 在行末加 --
* 在行末加 --,使用 '--' 作注释时,需在其后加空格,即 '-- '。
* 在行末加 //,与 C 语言类似
* 添加 `/* */` 符号,其开始和结束序列无需在同一行,因此此类注释方式支持换行。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CREATE SPACE [IF NOT EXISTS] <space_name>

## 自定义图空间选项

在创建图空间的时候,可以传入如下两个自定义选项
在创建图空间的时候,可以传入如下四个自定义选项

* _partition_num_

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DROP SPACE [IF EXISTS] <space_name>

仅支持有 DROP 权限的用户进行此操作。

DROP SPACE 将删除指定 space 内的所有点和边
DROP SPACE 将删除指定 space 内的所有点和边及索引
Amber1990Zhang marked this conversation as resolved.
Show resolved Hide resolved

删除图空间可使用 `IF EXISTS` 关键字,这个关键字会自动检测对应的图空间是否存在,如果存在则删除,如果不存在则直接返回。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ SHOW CONFIGS [graph|meta|storage]
例如:

```ngql
nebula> SHOW CONFIGS meta;
============================================================================================================================
| module | name | type | mode | value |
============================================================================================================================
| META | v | INT64 | IMMUTABLE | 4 |
----------------------------------------------------------------------------------------------------------------------------
| META | help | BOOL | IMMUTABLE | False |
----------------------------------------------------------------------------------------------------------------------------
| META | port | INT64 | IMMUTABLE | 45500 |
----------------------------------------------------------------------------------------------------------------------------
nebula> SHOW CONFIGS graph;
==============================================================
| module | name | type | mode | value |
==============================================================
| GRAPH | v | INT64 | MUTABLE | 0 |
--------------------------------------------------------------
| GRAPH | minloglevel | INT64 | MUTABLE | 2 |
--------------------------------------------------------------
| GRAPH | slow_op_threshhold_ms | INT64 | MUTABLE | 50 |
--------------------------------------------------------------
| GRAPH | heartbeat_interval_secs | INT64 | MUTABLE | 3 |
--------------------------------------------------------------
| GRAPH | meta_client_retry_times | INT64 | MUTABLE | 3 |
--------------------------------------------------------------
```

更多关于 `SHOW CONFIGS [graph|meta|storage]` 的信息,参见 [configs syntax](../../../../3.build-develop-and-administration/3.configurations/2.configs-syntax.md)。
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ nebula> SHOW CREATE SPACE NBA;
=========================================================================================================
| Space | Create Space |
=========================================================================================================
| gods | CREATE SPACE gods (partition_num = 1, replica_factor = 1, charset = utf8, collate = utf8_bin) |
| NBA | CREATE SPACE gods (partition_num = 1, replica_factor = 1, charset = utf8, collate = utf8_bin) |
---------------------------------------------------------------------------------------------------------
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,18 @@ SHOW {TAG | EDGE} INDEXES
```

`SHOW INDEXES` 用于列出已创建完成的标签或边类型的索引信息。`SHOW INDEXES` 返回以下字段:索引 ID 和 索引名称。

例如:

```ngql
nebula> SHOW TAG INDEXES;
=============================
| Index ID | Index Name |
=============================
| 6 | player_index_1 |
-----------------------------
| 7 | player_index_0 |
-----------------------------
```

如何创建索引请参考 [索引](../../1.data-definition-statements/index.md) 文档。
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
SHOW PARTS <part_id>
```

`SHOW PARTS` 列出指定 partition 的信息。
`SHOW PARTS` 列出指定 partition 的信息。`<part_id>` 为可选,如果不指定则返回所有 part 信息。

```ngql
nebula> SHOW PARTS 1;
Expand All @@ -20,4 +20,4 @@ nebula> SHOW PARTS 1;
- Partition ID
- Leader
- Peers
- Losts
- Losts
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# SHOW ROLES 语法

```ngql
SHOW ROLES IN <space_name>>
SHOW ROLES IN <space_name>
```

`SHOW ROLES` 语句显示分配给用户账户的角色。`SHOW ROLES` 输出以下列:用户账户和角色类型。

如果是 `GOD` 或 `ADMIN` 类型的用户, **Nebula Graph** 返回其权限内的所有用户角色。
如果是 `DBA`、 `USER` 或 `GUEST` 类型的用户, **Nebula Graph** 仅返回其自身角色。

例如:

```ngql
nebula> SHOW ROLES in NBA;
=======================
| Account | Role Type |
=======================
| userA | ADMIN |
-----------------------
```

参考 [Create User](../../../../3.build-develop-and-administration/4.account-management-statements/create-user-syntax.md) 创建用户,参考 [Grant Role](../../../../3.build-develop-and-administration/4.account-management-statements/grant-role-syntax.md) 为用户授予角色。
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,20 @@ SHOW SNAPSHOTS
```

`SHOW SNAPSHOTS` 语句返回所有快照。

例如:

```ngql
nebula> SHOW SNAPSHOTS;
===========================================================
| Name | Status | Hosts |
===========================================================
| SNAPSHOT_2019_12_04_10_54_36 | VALID | 127.0.0.1:77833 |
-----------------------------------------------------------
| SNAPSHOT_2019_12_04_10_54_42 | VALID | 127.0.0.1:77833 |
-----------------------------------------------------------
| SNAPSHOT_2019_12_04_10_54_44 | VALID | 127.0.0.1:77833 |
-----------------------------------------------------------
```

参考 [这里](../../../../3.build-develop-and-administration/5.storage-service-administration/cluster-snapshot.md) 创建集群快照。
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,16 @@ SHOW SPACES
```

`SHOW SPACES` 列出 **Nebula Graph** 集群中的所有图空间。

例如:

```ngql
nebula> SHOW SPACES;
========
| Name |
========
| NBA |
--------
```

参考[这里](../../1.data-definition-statements/create-space-syntax.md)创建图空间。
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ nav:
- 位运算: manual-CN/2.query-language/2.functions-and-operators/bitwise-operators.md
- 内置函数: manual-CN/2.query-language/2.functions-and-operators/built-in-functions.md
- 比较运算: manual-CN/2.query-language/2.functions-and-operators/comparison-functions-and-operators.md
- 聚合运算 GROUP BY: manual-CN/2.query-language/2.functions-and-operators/group-by-function.md
- 分组 GROUP BY: manual-CN/2.query-language/2.functions-and-operators/group-by-function.md
- LIMIT 语法: manual-CN/2.query-language/2.functions-and-operators/limit-syntax.md
- 逻辑运算: manual-CN/2.query-language/2.functions-and-operators/logical-operators.md
- 运算符优先级: manual-CN/2.query-language/2.functions-and-operators/operator-precedence.md
Expand Down