-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
350 additions
and
6 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
...manual-CN/2.query-language/3.language-structure/.keywords-and-reserved-words.md
This file was deleted.
Oops, something went wrong.
173 changes: 173 additions & 0 deletions
173
.../manual-CN/2.query-language/3.language-structure/keywords-and-reserved-words.md
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 |
---|---|---|
@@ -0,0 +1,173 @@ | ||
# 关键字和保留字 | ||
|
||
关键字是在 nGQL 中具有重要意义的单词。保留关键字需引用方可使用。 | ||
|
||
非保留关键字无需引用可直接使用,且所有非保留字都会自动转换成小写,所以非保留字是不区分大小写。保留关键字需使用反引号标注方可使用,例如 \`AND\`。 | ||
|
||
```ngql | ||
nebula> CREATE TAG TAG(name string); | ||
[ERROR (-7)]: SyntaxError: syntax error near `TAG' | ||
nebula> CREATE TAG SPACE(name string); -- SPACE 为非保留关键字 | ||
Execution succeeded | ||
nebula> SHOW TAGS; -- 所有非保留字都会自动转换成小写 | ||
============= | ||
| ID | Name | | ||
============= | ||
| 25 | space| | ||
------------- | ||
``` | ||
|
||
`TAG` 为保留字使用时必须使用反引号。 `SPACE` 为非保留字使用时无需加反引号。 | ||
|
||
```ngql | ||
nebula> CREATE TAG `TAG` (name string); -- 此处 TAG 为保留字 | ||
Execution succeeded | ||
``` | ||
|
||
## 保留字 | ||
|
||
以下列表为 nGQL 中的保留字。 | ||
|
||
```ngql | ||
ADD | ||
ALTER | ||
AND | ||
AS | ||
ASC | ||
BALANCE | ||
BIGINT | ||
BOOL | ||
BY | ||
CHANGE | ||
COMPACT | ||
CREATE | ||
DELETE | ||
DESC | ||
DESCRIBE | ||
DISTINCT | ||
DOUBLE | ||
DOWNLOAD | ||
DROP | ||
EDGE | ||
EDGES | ||
EXISTS | ||
FETCH | ||
FIND | ||
FLUSH | ||
FROM | ||
GET | ||
GO | ||
GRANT | ||
IF | ||
IN | ||
INDEX | ||
INDEXES | ||
INGEST | ||
INSERT | ||
INT | ||
INTERSECT | ||
IS | ||
LIMIT | ||
LOOKUP | ||
MATCH | ||
MINUS | ||
NO | ||
NOT | ||
NULL | ||
OF | ||
OFFSET | ||
ON | ||
OR | ||
ORDER | ||
OVER | ||
OVERWRITE | ||
PROP | ||
REBUILD | ||
RECOVER | ||
REMOVE | ||
RETURN | ||
REVERSELY | ||
REVOKE | ||
SET | ||
SHOW | ||
STEPS | ||
STOP | ||
STRING | ||
SUBMIT | ||
TAG | ||
TAGS | ||
TIMESTAMP | ||
TO | ||
UNION | ||
UPDATE | ||
UPSERT | ||
UPTO | ||
USE | ||
VERTEX | ||
WHEN | ||
WHERE | ||
WITH | ||
XOR | ||
YIELD | ||
``` | ||
|
||
## 非保留关键字 | ||
|
||
```ngql | ||
ACCOUNT | ||
ADMIN | ||
ALL | ||
AVG | ||
BIDIRECT | ||
BIT_AND | ||
BIT_OR | ||
BIT_XOR | ||
CHARSET | ||
COLLATE | ||
COLLATION | ||
CONFIGS | ||
COUNT | ||
COUNT_DISTINCT | ||
DATA | ||
DBA | ||
DEFAULT | ||
FORCE | ||
GOD | ||
GRAPH | ||
GROUP | ||
GUEST | ||
HDFS | ||
HOSTS | ||
JOB | ||
JOBS | ||
LEADER | ||
MAX | ||
META | ||
MIN | ||
OFFLINE | ||
PART | ||
PARTITION_NUM | ||
PARTS | ||
PASSWORD | ||
PATH | ||
REPLICA_FACTOR | ||
ROLE | ||
ROLES | ||
SHORTEST | ||
SNAPSHOT | ||
SNAPSHOTS | ||
SPACE | ||
SPACES | ||
STATUS | ||
STD | ||
STORAGE | ||
SUM | ||
TTL_COL | ||
TTL_DURATION | ||
USER | ||
USERS | ||
UUID | ||
VALUES | ||
``` |
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
1 change: 0 additions & 1 deletion
1
...manual-EN/2.query-language/3.language-structure/.keywords-and-reserved-words.md
This file was deleted.
Oops, something went wrong.
173 changes: 173 additions & 0 deletions
173
.../manual-EN/2.query-language/3.language-structure/keywords-and-reserved-words.md
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 |
---|---|---|
@@ -0,0 +1,173 @@ | ||
# Keywords and Reserved Words | ||
|
||
Keywords are words that have significance in nGQL. Certain keywords are reserved and require special treatment for use as identifiers. | ||
|
||
Non-reserved keywords are permitted as identifiers without quoting. All the non-reserved keywords are automatically converted to lower case. Non-reserved keywords are non case-sensitive. Reserved words are permitted as identifiers if you quote them with single or double quotes such as \`AND\`. | ||
|
||
```ngql | ||
nebula> CREATE TAG TAG(name string); | ||
[ERROR (-7)]: SyntaxError: syntax error near `TAG' | ||
nebula> CREATE TAG SPACE(name string); -- SPACE is an unreserved KEY WORD | ||
Execution succeeded | ||
nebula> SHOW TAGS; -- All the non-reserved keywords are automatically converted to lower case. | ||
============= | ||
| ID | Name | | ||
============= | ||
| 25 | space| | ||
------------- | ||
``` | ||
|
||
`TAG` is a reserved keyword and must be quoted with backtick to be used as an identifier. `SPACE` is keyword but not reserved, so its use as identifiers does not require quoting. | ||
|
||
```ngql | ||
nebula> CREATE TAG `TAG` (name string); -- TAG is a reserved word here | ||
Execution succeeded | ||
``` | ||
|
||
## Reserved Words | ||
|
||
The following list shows reserved words in nGQL. | ||
|
||
```ngql | ||
ADD | ||
ALTER | ||
AND | ||
AS | ||
ASC | ||
BALANCE | ||
BIGINT | ||
BOOL | ||
BY | ||
CHANGE | ||
COMPACT | ||
CREATE | ||
DELETE | ||
DESC | ||
DESCRIBE | ||
DISTINCT | ||
DOUBLE | ||
DOWNLOAD | ||
DROP | ||
EDGE | ||
EDGES | ||
EXISTS | ||
FETCH | ||
FIND | ||
FLUSH | ||
FROM | ||
GET | ||
GO | ||
GRANT | ||
IF | ||
IN | ||
INDEX | ||
INDEXES | ||
INGEST | ||
INSERT | ||
INT | ||
INTERSECT | ||
IS | ||
LIMIT | ||
LOOKUP | ||
MATCH | ||
MINUS | ||
NO | ||
NOT | ||
NULL | ||
OF | ||
OFFSET | ||
ON | ||
OR | ||
ORDER | ||
OVER | ||
OVERWRITE | ||
PROP | ||
REBUILD | ||
RECOVER | ||
REMOVE | ||
RETURN | ||
REVERSELY | ||
REVOKE | ||
SET | ||
SHOW | ||
STEPS | ||
STOP | ||
STRING | ||
SUBMIT | ||
TAG | ||
TAGS | ||
TIMESTAMP | ||
TO | ||
UNION | ||
UPDATE | ||
UPSERT | ||
UPTO | ||
USE | ||
VERTEX | ||
WHEN | ||
WHERE | ||
WITH | ||
XOR | ||
YIELD | ||
``` | ||
|
||
## Non-Reserved Keywords | ||
|
||
```ngql | ||
ACCOUNT | ||
ADMIN | ||
ALL | ||
AVG | ||
BIDIRECT | ||
BIT_AND | ||
BIT_OR | ||
BIT_XOR | ||
CHARSET | ||
COLLATE | ||
COLLATION | ||
CONFIGS | ||
COUNT | ||
COUNT_DISTINCT | ||
DATA | ||
DBA | ||
DEFAULT | ||
FORCE | ||
GOD | ||
GRAPH | ||
GROUP | ||
GUEST | ||
HDFS | ||
HOSTS | ||
JOB | ||
JOBS | ||
LEADER | ||
MAX | ||
META | ||
MIN | ||
OFFLINE | ||
PART | ||
PARTITION_NUM | ||
PARTS | ||
PASSWORD | ||
PATH | ||
REPLICA_FACTOR | ||
ROLE | ||
ROLES | ||
SHORTEST | ||
SNAPSHOT | ||
SNAPSHOTS | ||
SPACE | ||
SPACES | ||
STATUS | ||
STD | ||
STORAGE | ||
SUM | ||
TTL_COL | ||
TTL_DURATION | ||
USER | ||
USERS | ||
UUID | ||
VALUES | ||
``` |
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