-
Notifications
You must be signed in to change notification settings - Fork 82
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]keywords migrate #17
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it is enough to add reserved words here.
No need to add non-reserved words because it changes dynamically.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's here for reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think so.
Because non-reserved words and ordinary characters, there is no difference for users.
So the user knows that reserved words are enough.
In other words, you want the user to know which non-reserved words, what special usage does the non-reserved word have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although nGQL is case insensitive, we encourage to use the keywords in UPPERCASE, that's why I bother myself to add the non-reserved list. Thanks for your kind suggestion.