跳转至

关键字

关键字在 nGQL 中有重要意义,分为保留关键字和非保留关键字。

非保留关键字作为标识符时可以不使用引号。保留关键字作为标识符时,需要用反引号(`)将它们括起来,例如 `AND`。

Note

关键字不区分大小写。

nebula> CREATE TAG TAG(name string);
[ERROR (-7)]: SyntaxError: syntax error near `TAG'

nebula> CREATE TAG `TAG` (name string);
Execution succeeded

nebula> CREATE TAG SPACE(name string);
Execution succeeded
  • TAG是保留关键字,要将TAG作为标识符,用户必须使用反引号(`)括起来。
  • SPACE是非保留关键字,可以直接作为标识符使用。

保留关键字

GO
AS
TO
OR
AND
XOR
USE
SET
FROM
WHERE
MATCH
INSERT
YIELD
RETURN
DESCRIBE
DESC
VERTEX
VERTICES
EDGE
EDGES
UPDATE
UPSERT
WHEN
DELETE
FIND
LOOKUP
ALTER
STEPS
STEP
OVER
UPTO
REVERSELY
INDEX
INDEXES
REBUILD
BOOL
INT8
INT16
INT32
INT64
INT
FLOAT
DOUBLE
STRING
FIXED_STRING
TIMESTAMP
DATE
TIME
DATETIME
TAG
TAGS
UNION
INTERSECT
MINUS
NO
OVERWRITE
SHOW
ADD
CREATE
DROP
REMOVE
IF
NOT
EXISTS
WITH
CHANGE
GRANT
REVOKE
ON
BY
IN
NOT_IN
DOWNLOAD
GET
OF
ORDER
INGEST
COMPACT
FLUSH
SUBMIT
ASC
ASCENDING
DESCENDING
DISTINCT
FETCH
PROP
BALANCE
STOP
LIMIT
OFFSET
IS
NULL
RECOVER
EXPLAIN
PROFILE
FORMAT
CASE

非保留关键字

HOST
HOSTS
SPACE
SPACES
VALUE
VALUES
USER
USERS
PASSWORD
ROLE
ROLES
GOD
ADMIN
DBA
GUEST
GROUP
PARTITION_NUM
REPLICA_FACTOR
VID_TYPE
CHARSET
COLLATE
COLLATION
ATOMIC_EDGE
ALL
ANY
SINGLE
NONE
REDUCE
LEADER
UUID
DATA
SNAPSHOT
SNAPSHOTS
ACCOUNT
JOBS
JOB
PATH
BIDIRECT
STATS
STATUS
FORCE
PART
PARTS
DEFAULT
HDFS
CONFIGS
TTL_DURATION
TTL_COL
GRAPH
META
STORAGE
SHORTEST
NOLOOP
OUT
BOTH
SUBGRAPH
CONTAINS
NOT_CONTAINS
STARTS
STARTS_WITH
NOT_STARTS_WITH
ENDS
ENDS_WITH
NOT_ENDS_WITH
IS_NULL
IS_NOT_NULL
IS_EMPTY
IS_NOT_EMPTY
UNWIND
SKIP
OPTIONAL
THEN
ELSE
END
GROUPS
ZONE
ZONES
INTO
LISTENER
ELASTICSEARCH
FULLTEXT
AUTO
FUZZY
PREFIX
REGEXP
WILDCARD
TEXT
SEARCH
CLIENTS
SIGN
SERVICE
TEXT_SEARCH
RESET
PLAN
COMMENT
SESSIONS
SESSION
SAMPLE
QUERIES
QUERY
KILL
TOP
TRUE
FALSE

最后更新: March 7, 2023