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

Schema support mixed Chinese and English #1005

Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Keywords have significance in nGQL. It can be classified into reserved keywords and non-reserved keywords.

Non-reserved keywords are permitted as identifiers without quoting. To use reserved keywords as identifiers, quote them with backticks such as `AND`.
Non-reserved keywords are permitted as identifiers without quoting. To use special characters or reserved keywords as identifiers, quote them with backticks such as `AND`.

!!! Note

Expand All @@ -20,11 +20,10 @@ Execution succeeded

nebula> CREATE TAG 中文(简体 string);
Execution succeeded
```

- `TAG` is a reserved keyword. To use `TAG` as an identifier, you must quote it with backticks.

- `SPACE` is a non-reserved keyword. You can use it as an identifier without quoting it.
nebula> CREATE TAG `¥%special characters&*+-*/` (`q~!()= wer` string);
Execution succeeded
```

## Reserved keywords

Expand Down
2 changes: 1 addition & 1 deletion docs-2.0/3.ngql-guide/10.tag-statements/1.create-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CREATE TAG [IF NOT EXISTS] <tag_name>
|Parameter|Description|
|:---|:---|
|`IF NOT EXISTS`|Detects if the tag that you want to create exists. If it does not exist, a new one will be created. The tag existence detection here only compares the tag names (excluding properties).|
|`<tag_name>`|The tag name must be **unique** in a graph space. Once the tag name is set, it can not be altered. The name of the tag supports 1 to 4 bytes UTF-8 encoded characters, such as English letters (case-sensitive), digits, and Chinese characters, but does not support special characters except underscores. For more information, see [Keywords and reserved words](../../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md).|
|`<tag_name>`|The tag name must be **unique** in a graph space. Once the tag name is set, it can not be altered. The name of the tag supports 1 to 4 bytes UTF-8 encoded characters, such as English letters (case-sensitive), digits, and Chinese characters, but does not support special characters except underscores. To use special characters or reserved keywords as identifiers, quote them with backticks. For more information, see [Keywords and reserved words](../../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md).|
|`<prop_name>`|The name of the property. It must be unique for each tag. The rules for permitted property names are the same as those for tag names.|
|`<data_type>`|Shows the data type of each property. For a full description of the property data types, see [Data types](../3.data-types/1.numeric.md) and [Boolean](../3.data-types/2.boolean.md).|
|`NULL \| NOT NULL`|Specifies if the property supports `NULL | NOT NULL`. The default value is `NULL`.|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CREATE EDGE [IF NOT EXISTS] <edge_type_name>
|Parameter|Description|
|:---|:---|
|`IF NOT EXISTS`|Detects if the edge type that you want to create exists. If it does not exist, a new one will be created. The edge type existence detection here only compares the edge type names (excluding properties).|
|`<edge_type_name>`|The edge type name must be **unique** in a graph space. Once the edge type name is set, it can not be altered. The name of the edge type supports 1 to 4 bytes UTF-8 encoded characters, such as English letters (case-sensitive), digits, and Chinese characters, but does not support special characters except underscores. For more information, see [Keywords and reserved words](../../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md).|
|`<edge_type_name>`|The edge type name must be **unique** in a graph space. Once the edge type name is set, it can not be altered. The name of the edge type supports 1 to 4 bytes UTF-8 encoded characters, such as English letters (case-sensitive), digits, and Chinese characters, but does not support special characters except underscores. To use special characters or reserved keywords as identifiers, quote them with backticks. For more information, see [Keywords and reserved words](../../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md).|
|`<prop_name>`|The name of the property. It must be unique for each edge type. The rules for permitted property names are the same as those for edge type names.|
|`<data_type>`|Shows the data type of each property. For a full description of the property data types, see [Data types](../3.data-types/1.numeric.md) and [Boolean](../3.data-types/2.boolean.md).|
|`NULL \| NOT NULL`|Specifies if the property supports `NULL | NOT NULL`. The default value is `NULL`.|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ CREATE {TAG | EDGE} INDEX [IF NOT EXISTS] <index_name> ON {<tag_name> | <edge_na
|:---|:---|
|`TAG \| EDGE`|Specifies the index type that you want to create.|
|`IF NOT EXISTS`|Detects if the index that you want to create exists. If it does not exist, a new one will be created.|
|`<index_name>`|The name of the index. It must be unique in a graph space. A recommended way of naming is `i_tagName_propName`. The name of the index supports 1 to 4 bytes UTF-8 encoded characters, such as English letters (case-sensitive), digits, and Chinese characters, but does not support special characters except underscores. For more information, see [Keywords and reserved words](../../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md).|
|`<index_name>`|The name of the index. It must be unique in a graph space. A recommended way of naming is `i_tagName_propName`. The name of the index supports 1 to 4 bytes UTF-8 encoded characters, such as English letters (case-sensitive), digits, and Chinese characters, but does not support special characters except underscores. To use special characters or reserved keywords as identifiers, quote them with backticks. For more information, see [Keywords and reserved words](../../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md).|
|`<tag_name> \| <edge_name>`|Specifies the name of the tag or edge associated with the index.|
|`<prop_name_list>`|To index a **variable-length** string property, you must use `prop_name(length)` to specify the index length. To index a tag or an edge type, ignore the `prop_name_list`.|
|`COMMENT`|The remarks of the index. The maximum length is 256 bytes. By default, there will be no comments on an index.|
Expand Down
2 changes: 1 addition & 1 deletion docs-2.0/3.ngql-guide/9.space-statements/1.create-space.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CREATE SPACE [IF NOT EXISTS] <graph_space_name> (
|Parameter|Description|
|:---|:---|
|`IF NOT EXISTS`|Detects if the related graph space exists. If it does not exist, a new one will be created. The graph space existence detection here only compares the graph space name (excluding properties).|
|`<graph_space_name>`|Uniquely identifies a graph space in a Nebula Graph instance. The name of the graph space supports 1 to 4 bytes UTF-8 encoded characters, such as English letters (case-sensitive), digits, and Chinese characters, but does not support special characters except underscores. For more information, see [Keywords and reserved words](../../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md).|
|`<graph_space_name>`|Uniquely identifies a graph space in a Nebula Graph instance. The name of the graph space supports 1 to 4 bytes UTF-8 encoded characters, such as English letters (case-sensitive), digits, and Chinese characters, but does not support special characters except underscores. To use special characters or reserved keywords as identifiers, quote them with backticks. For more information, see [Keywords and reserved words](../../3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md).|
|`partition_num`|Specifies the number of partitions in each replica. The suggested number is five times the number of the hard disks in the cluster. For example, if you have 3 hard disks in the cluster, we recommend that you set 15 partitions. The default value is 100.|
|`replica_factor`|Specifies the number of replicas in the cluster. The suggested number is 3 in a production environment and 1 in a test environment. The replica number must be an **odd number** for the need of quorum-based voting. The default value is 1.|
|`vid_type`|A required parameter. Specifies the VID type in a graph space. Available values are `FIXED_STRING(N)` and `INT64`. `INT` equals to `INT64`. `FIXED_STRING(<N>)` specifies the VID as a string, while `INT64` specifies it as an integer. `N` represents the maximum length of the VIDs. If you set a VID that is longer than `N` characters, Nebula Graph throws an error.|
Expand Down