-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated studio docs * Create st-ug-limitations.md * Delete st-ug-limitations.md * Revert "Delete st-ug-limitations.md" This reverts commit 16dacaf. * Delete docs-2.0/nebula-docs directory * keep consistency * Updated studio docs * Create st-ug-limitations.md * Delete st-ug-limitations.md * Revert "Delete st-ug-limitations.md" This reverts commit 16dacaf. * Delete docs-2.0/nebula-docs directory * keep consistency * Updated studio docs * Create st-ug-limitations.md * Delete st-ug-limitations.md * Revert "Delete st-ug-limitations.md" This reverts commit 16dacaf. * Delete docs-2.0/nebula-docs directory * keep consistency * Update data type docs
- Loading branch information
1 parent
2b96054
commit 57b2d2b
Showing
4 changed files
with
81 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,54 @@ | ||
# 数值类型 | ||
# 数值 | ||
|
||
## int | ||
nGQL支持整数和浮点数。 | ||
|
||
Nebula Graph使用关键字`int`声明64位带符号整数,支持的范围是[-9223372036854775808, 9223372036854775807]。整数支持多种进制表示: | ||
## 整数 | ||
|
||
nGQL支持带符号的64位整数(INT64)、32位整数(INT32)、16位整数(INT16)和8位整数(INT8)。 | ||
|
||
| 类型 | 声明关键字 | 范围 | | ||
|-|-|-| | ||
| INT64 | `INT64`或`INT` | -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 | | ||
| INT32 | `INT32` | -2,147,483,648 ~ 2,147,483,647 | | ||
| INT16 | `INT16` | -32,768 ~ 32,767 | | ||
| INT8 | `INT8` | -128 ~ 127 | | ||
|
||
## 浮点数 | ||
|
||
nGQL支持单精度浮点(FLOAT)和双精度浮点(DOUBLE)。 | ||
|
||
| 类型 | 声明关键字 | 范围 | 精度 | | ||
|-|-|-|-| | ||
| FLOAT | `FLOAT` | 3.4E +/- 38 | 6~7位 | | ||
| DOUBLE | `DOUBLE` | 1.7E +/- 308 | 15~16位 | | ||
|
||
nGQL支持科学计数法,例如`1e2`、`1.1e2`、`.3e4`、`1.e4`、`-1234E-10`。 | ||
|
||
!!! note | ||
|
||
不支持MySQL中的DECIMAL数据类型。 | ||
|
||
## 数值的读写 | ||
|
||
在写入和读取不同类型的数据时,nGQL的行为遵守以下规则: | ||
|
||
| 数值类型 | 设置为VID | 设置为属性类型 | 读取该类型的属性值得到的类型 | | ||
|-|-|-|-| | ||
| INT64 | 支持 | 支持 | INT64 | | ||
| INT32 | 不支持 | 支持 | INT64 | | ||
| INT16 | 不支持 | 支持 | INT64 | | ||
| INT8 | 不支持 | 支持 | INT64 | | ||
| FLOAT | 不支持 | 支持 | DOUBLE | | ||
| DOUBLE | 不支持 | 支持 | DOUBLE | | ||
|
||
例如,nGQL不支持设置INT8类型的[VID](../../1.introduction/3.vid.md),但支持将[TAG](../10.tag-statements/1.create-tag.md)或[Edge type](../11.edge-type-statements/1.create-edge.md)的某个属性类型设置为INT8。当使用nGQL语句读取INT8类型的属性时,获取到的值的类型为INT64。 | ||
|
||
同时,Nebula Graph支持写入多种进制的数值: | ||
|
||
- 十进制,例如`123456`。 | ||
- 十六进制,例如`0x1e240`。 | ||
- 八进制,例如`0361100`。 | ||
|
||
## double | ||
|
||
Nebula Graph使用关键字`double`声明双精度浮点数,例如`1.2`、`-3.0000001`。同时支持科学计数法,例如`1e2`、`1.1e2`、`.3e4`、`1.e4`、`-1234E-10`。 | ||
但Nebula Graph会将写入的非十进制数值解析为十进制的值保存。读取到的值为十进制。 | ||
|
||
例如,属性`score`的类型为`INT`,通过INSERT语句为其赋值`0xb`,使用FETCH等语句查询该属性值获取到的结果是`11`,即将十六进制的`0xb`转换为十进制后的值。 |
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,3 +1,8 @@ | ||
# 布尔 | ||
|
||
Nebula Graph使用关键字`bool`声明布尔数据类型,可选值为`true`或`false`。 | ||
Nebula Graph使用关键字`BOOL`声明布尔数据类型,可选值为`true`或`false`。 | ||
|
||
nGQL支持以如下方式使用布尔值: | ||
|
||
* 将属性值的数据类型定义为布尔。 | ||
* 在`WHERE`子句中用布尔值作为判断条件。 |
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