You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2021/10/20 01:38:06 UTC

[iotdb] branch master updated: [IOTDB-1280] Rewrite the Antlr grammar file (#4134)

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 2b70e2a  [IOTDB-1280] Rewrite the Antlr grammar file (#4134)
2b70e2a is described below

commit 2b70e2af458b4fdfb33d5a7cb8c3f23139706c00
Author: liuminghui233 <36...@users.noreply.github.com>
AuthorDate: Wed Oct 20 09:37:37 2021 +0800

    [IOTDB-1280] Rewrite the Antlr grammar file (#4134)
---
 .../org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4    |  987 ++++++
 .../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4   |  856 +++++
 .../antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4   | 1612 ---------
 .../iotdb/cluster/integration/SingleNodeTest.java  |    2 +-
 .../Administration-Management/Administration.md    |    8 +-
 docs/UserGuide/Advanced-Features/Triggers.md       |   12 +-
 .../Advanced-Features/UDF-User-Defined-Function.md |    6 +-
 docs/UserGuide/Appendix/SQL-Reference.md           |   24 +-
 .../DML-Data-Manipulation-Language.md              |    6 +-
 .../UserGuide/System-Tools/Load-External-Tsfile.md |   38 +-
 docs/UserGuide/System-Tools/Watermark-Tool.md      |    2 +-
 .../Administration-Management/Administration.md    |    8 +-
 docs/zh/UserGuide/Advanced-Features/Triggers.md    |   12 +-
 .../Advanced-Features/UDF-User-Defined-Function.md |    6 +-
 docs/zh/UserGuide/Appendix/SQL-Reference.md        |   24 +-
 .../DML-Data-Manipulation-Language.md              |    6 +-
 .../UserGuide/System-Tools/Load-External-Tsfile.md |   38 +-
 docs/zh/UserGuide/System-Tools/Watermark-Tool.md   |    2 +-
 .../iotdb/db/qp/constant/FilterConstant.java       |   20 +-
 .../apache/iotdb/db/qp/executor/PlanExecutor.java  |    6 -
 .../apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java    | 3451 ++++++++++----------
 .../iotdb/db/qp/strategy/LogicalGenerator.java     |   12 +-
 .../org/apache/iotdb/db/integration/IoTDBInIT.java |   24 +-
 ...IoTDBLoadExternalTsFileWithTimePartitionIT.java |    4 +-
 .../db/integration/IoTDBLoadExternalTsfileIT.java  |   51 +-
 .../apache/iotdb/db/integration/IoTDBMergeIT.java  |    2 +-
 .../iotdb/db/integration/IoTDBNestedQueryIT.java   |    6 +-
 .../iotdb/db/integration/IoTDBQueryDemoIT.java     |   20 +-
 .../IoTDBSetSystemReadOnlyWritableIT.java          |   20 +-
 .../iotdb/db/integration/IoTDBTracingIT.java       |    9 +-
 .../db/integration/IoTDBTriggerExecutionIT.java    |  104 +-
 .../db/integration/IoTDBTriggerManagementIT.java   |   58 +-
 .../iotdb/db/integration/IoTDBUDFManagementIT.java |   26 +-
 .../db/integration/IoTDBUDFWindowQueryIT.java      |   20 +-
 .../integration/IoTDBUDTFAlignByTimeQueryIT.java   |   18 +-
 .../db/integration/IoTDBUDTFHybridQueryIT.java     |   10 +-
 .../db/integration/IoTDBUDTFNonAlignQueryIT.java   |    6 +-
 .../db/integration/auth/IoTDBAuthorizationIT.java  |  106 +-
 .../iotdb/db/qp/logical/IndexLogicalPlanTest.java  |  156 -
 .../iotdb/db/qp/other/TSPlanContextAuthorTest.java |    8 +-
 .../physical/IndexSubMatchingPhysicalPlanTest.java |  163 -
 .../IndexWholeMatchingPhysicalPlanTest.java        |  168 -
 .../iotdb/db/qp/physical/PhysicalPlanTest.java     |   30 +-
 .../iotdb/db/qp/sql/IoTDBsqlVisitorTest.java       |   12 +-
 .../query/dataset/UDTFAlignByTimeDataSetTest.java  |    8 +-
 .../iotdb/db/utils/TsFileRewriteToolTest.java      |    4 +-
 .../iotdb/session/IoTDBSessionComplexIT.java       |    4 +-
 .../test/java/org/apache/iotdb/db/sql/Cases.java   |   10 +-
 48 files changed, 3912 insertions(+), 4273 deletions(-)

diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4
new file mode 100644
index 0000000..dc1a8ee
--- /dev/null
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4
@@ -0,0 +1,987 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+lexer grammar IoTDBSqlLexer;
+
+/**
+ * 1. Whitespace
+ */
+
+WS
+    :
+    [ \t\r\n]+ -> skip
+    ;
+
+
+/**
+ * 2. Keywords
+ */
+
+// Common Keywords
+
+ADD
+    : A D D
+    ;
+
+AFTER
+    : A F T E R
+    ;
+
+ALIAS
+    : A L I A S
+    ;
+
+ALIGN
+    : A L I G N
+    ;
+
+ALL
+    : A L L
+    ;
+
+ALTER
+    : A L T E R
+    ;
+
+ANY
+    : A N Y
+    ;
+
+AS
+    : A S
+    ;
+
+ASC
+    : A S C
+    ;
+
+ATTRIBUTES
+    : A T T R I B U T E S
+    ;
+
+AUTOREGISTER
+    : A U T O R E G I S T E R
+    ;
+
+BEFORE
+    : B E F O R E
+    ;
+
+BEGIN
+    : B E G I N
+    ;
+
+BY
+    : B Y
+    ;
+
+CACHE
+    : C A C H E
+    ;
+
+CHILD
+    : C H I L D
+    ;
+
+CLEAR
+    : C L E A R
+    ;
+
+COMPRESSION
+    : C O M P R E S S I O N
+    ;
+
+COMPRESSOR
+    : C O M P R E S S O R
+    ;
+
+CONCAT
+    : C O N C A T
+    ;
+
+CONFIGURATION
+    : C O N F I G U R A T I O N
+    ;
+
+CONTINUOUS
+    : C O N T I N U O U S
+    ;
+
+COUNT
+    : C O U N T
+    ;
+
+CONTAIN
+    : C O N T A I N
+    ;
+
+CQ
+    : C Q
+    ;
+
+CQS
+    : C Q S
+    ;
+
+CREATE
+    : C R E A T E
+    ;
+
+DATATYPE
+    : D A T A T Y P E
+    ;
+
+DEBUG
+    : D E B U G
+    ;
+
+DELETE
+    : D E L E T E
+    ;
+
+DESC
+    : D E S C
+    ;
+
+DESCRIBE
+    : D E S C R I B E
+    ;
+
+DEVICE
+    : D E V I C E
+    ;
+
+DEVICES
+    : D E V I C E S
+    ;
+
+DISABLE
+    : D I S A B L E
+    ;
+
+DROP
+    : D R O P
+    ;
+
+ENCODING
+    : E N C O D I N G
+    ;
+
+END
+    : E N D
+    ;
+
+EVERY
+    : E V E R Y
+    ;
+
+
+EXPLAIN
+    : E X P L A I N
+    ;
+
+FILL
+    : F I L L
+    ;
+
+FLUSH
+    : F L U S H
+    ;
+
+FOR
+    : F O R
+    ;
+
+FROM
+    : F R O M
+    ;
+
+FULL
+    : F U L L
+    ;
+
+FUNCTION
+    : F U N C T I O N
+    ;
+
+FUNCTIONS
+    : F U N C T I O N S
+    ;
+
+GLOBAL
+    : G L O B A L
+    ;
+
+GRANT
+    : G R A N T
+    ;
+
+GROUP
+    : G R O U P
+    ;
+
+INDEX
+    : I N D E X
+    ;
+
+INFO
+    : I N F O
+    ;
+
+INSERT
+    : I N S E R T
+    ;
+
+INTO
+    : I N T O
+    ;
+
+KILL
+    : K I L L
+    ;
+
+LABEL
+    : L A B E L
+    ;
+
+LAST
+    : L A S T
+    ;
+
+LATEST
+    : L A T E S T
+    ;
+
+LEVEL
+    : L E V E L
+    ;
+
+LIKE
+    : L I K E
+    ;
+
+LIMIT
+    : L I M I T
+    ;
+
+LINEAR
+    : L I N E A R
+    ;
+
+LINK
+    : L I N K
+    ;
+
+LIST
+    : L I S T
+    ;
+
+LOAD
+    : L O A D
+    ;
+
+LOCK
+    : L O C K
+    ;
+
+MERGE
+    : M E R G E
+    ;
+
+METADATA
+    : M E T A D A T A
+    ;
+
+NODES
+    : N O D E S
+    ;
+
+NOW
+    : N O W
+    ;
+
+OF
+    : O F
+    ;
+
+OFF
+    : O F F
+    ;
+
+OFFSET
+    : O F F S E T
+    ;
+
+ON
+    : O N
+    ;
+
+ORDER
+    : O R D E R
+    ;
+
+PARTITION
+    : P A R T I T I O N
+    ;
+
+PASSWORD
+    : P A S S W O R D
+    ;
+
+PATHS
+    : P A T H S
+    ;
+
+PREVIOUS
+    : P R E V I O U S
+    ;
+
+PREVIOUSUNTILLAST
+    : P R E V I O U S U N T I L L A S T
+    ;
+
+PRIVILEGES
+    : P R I V I L E G E S
+    ;
+
+PROCESSLIST
+    : P R O C E S S L I S T
+    ;
+
+PROPERTY
+    : P R O P E R T Y
+    ;
+
+QUERIES
+    : Q U E R I E S
+    ;
+
+QUERY
+    : Q U E R Y
+    ;
+
+READONLY
+    : R E A D O N L Y
+    ;
+
+REGEXP
+    : R E G E X P
+    ;
+
+REMOVE
+    : R E M O V E
+    ;
+
+RENAME
+    : R E N A M E
+    ;
+
+RESAMPLE
+    : R E S A M P L E
+    ;
+
+REVOKE
+    : R E V O K E
+    ;
+
+ROLE
+    : R O L E
+    ;
+
+ROOT
+    : R O O T
+    ;
+
+SCHEMA
+    : S C H E M A
+    ;
+
+SELECT
+    : S E L E C T
+    ;
+
+SET
+    : S E T
+    ;
+
+SETTLE
+    : S E T T L E
+    ;
+
+SGLEVEL
+    : S G L E V E L
+    ;
+
+SHOW
+    : S H O W
+    ;
+
+SLIMIT
+    : S L I M I T
+    ;
+
+SNAPSHOT
+    : S N A P S H O T
+    ;
+
+SOFFSET
+    : S O F F S E T
+    ;
+
+STORAGE
+    : S T O R A G E
+    ;
+
+START
+    : S T A R T
+    ;
+
+STOP
+    : S T O P
+    ;
+
+SYSTEM
+    : S Y S T E M
+    ;
+
+TAGS
+    : T A G S
+    ;
+
+TASK
+    : T A S K
+    ;
+
+TIME
+    : T I M E
+    ;
+
+TIMESERIES
+    : T I M E S E R I E S
+    ;
+
+TIMESTAMP
+    : T I M E S T A M P
+    ;
+
+TO
+    : T O
+    ;
+
+TOLERANCE
+    : T O L E R A N C E
+    ;
+
+TOP
+    : T O P
+    ;
+
+TRACING
+    : T R A C I N G
+    ;
+
+TRIGGER
+    : T R I G G E R
+    ;
+
+TRIGGERS
+    : T R I G G E R S
+    ;
+
+TTL
+    : T T L
+    ;
+
+UNLINK
+    : U N L I N K
+    ;
+
+UNLOAD
+    : U N L O A D
+    ;
+
+UNSET
+    : U N S E T
+    ;
+
+UPDATE
+    : U P D A T E
+    ;
+
+UPSERT
+    : U P S E R T
+    ;
+
+USER
+    : U S E R
+    ;
+
+USING
+    : U S I N G
+    ;
+
+VALUES
+    : V A L U E S
+    ;
+
+VERIFY
+    : V E R I F Y
+    ;
+
+VERSION
+    : V E R S I O N
+    ;
+
+WATERMARK_EMBEDDING
+    : W A T E R M A R K '_' E M B E D D I N G
+    ;
+
+WHERE
+    : W H E R E
+    ;
+
+WITH
+    : W I T H
+    ;
+
+WITHOUT
+    : W I T H O U T
+    ;
+
+WRITABLE
+    : W R I T A B L E
+    ;
+
+
+// Data Type Keywords
+
+DATATYPE_VALUE
+    : BOOLEAN | DOUBLE | FLOAT | INT32 | INT64 | TEXT
+    ;
+
+BOOLEAN
+    : B O O L E A N
+    ;
+
+DOUBLE
+    : D O U B L E
+    ;
+
+FLOAT
+    : F L O A T
+    ;
+
+INT32
+    : I N T '3' '2'
+    ;
+
+INT64
+    : I N T '6' '4'
+    ;
+
+TEXT
+    : T E X T
+    ;
+
+
+// Encoding Type Keywords
+
+ENCODING_VALUE
+    : DICTIONARY | DIFF | GORILLA | PLAIN | REGULAR | RLE | TS_2DIFF
+    ;
+
+DICTIONARY
+    : D I C T I O N A R Y
+    ;
+
+DIFF
+    : D I F F
+    ;
+
+GORILLA
+    : G O R I L L A
+    ;
+
+PLAIN
+    : P L A I N
+    ;
+
+REGULAR
+    : R E G U L A R
+    ;
+
+RLE
+    : R L E
+    ;
+
+TS_2DIFF
+    : T S '_' '2' D I F F
+    ;
+
+
+// Compressor Type Keywords
+
+COMPRESSOR_VALUE
+    : GZIP | LZ4 | SNAPPY | UNCOMPRESSED
+    ;
+
+GZIP
+    : G Z I P
+    ;
+
+LZ4
+    : L Z '4'
+    ;
+
+SNAPPY
+    : S N A P P Y
+    ;
+
+UNCOMPRESSED
+    : U N C O M P R E S S E D
+    ;
+
+
+// Privileges Keywords
+
+PRIVILEGE_VALUE
+    : SET_STORAGE_GROUP | CREATE_TIMESERIES | INSERT_TIMESERIES | READ_TIMESERIES | DELETE_TIMESERIES
+    | CREATE_USER | DELETE_USER | MODIFY_PASSWORD | LIST_USER
+    | GRANT_USER_PRIVILEGE | REVOKE_USER_PRIVILEGE | GRANT_USER_ROLE | REVOKE_USER_ROLE
+    | CREATE_ROLE | DELETE_ROLE | LIST_ROLE | GRANT_ROLE_PRIVILEGE | REVOKE_ROLE_PRIVILEGE
+    | CREATE_FUNCTION | DROP_FUNCTION | CREATE_TRIGGER | DROP_TRIGGER | START_TRIGGER | STOP_TRIGGER
+    | CREATE_CONTINUOUS_QUERY | DROP_CONTINUOUS_QUERY
+    ;
+
+SET_STORAGE_GROUP
+    : S E T '_' S T O R A G E '_' G R O U P
+    ;
+
+CREATE_TIMESERIES
+    : C R E A T E '_' T I M E S E R I E S
+    ;
+
+INSERT_TIMESERIES
+    : I N S E R T '_' T I M E S E R I E S
+    ;
+
+READ_TIMESERIES
+    : R E A D '_' T I M E S E R I E S
+    ;
+
+DELETE_TIMESERIES
+    : D E L E T E '_' T I M E S E R I E S
+    ;
+
+CREATE_USER
+    : C R E A T E '_' U S E R
+    ;
+
+DELETE_USER
+    : D E L E T E '_' U S E R
+    ;
+
+MODIFY_PASSWORD
+    : M O D I F Y '_' P A S S W O R D
+    ;
+
+LIST_USER
+    : L I S T '_' U S E R
+    ;
+
+GRANT_USER_PRIVILEGE
+    : G R A N T '_' U S E R '_' P R I V I L E G E
+    ;
+
+REVOKE_USER_PRIVILEGE
+    : R E V O K E '_' U S E R '_' P R I V I L E G E
+    ;
+
+GRANT_USER_ROLE
+    : G R A N T '_' U S E R '_' R O L E
+    ;
+
+REVOKE_USER_ROLE
+    : R E V O K E '_' U S E R '_' R O L E
+    ;
+
+CREATE_ROLE
+    : C R E A T E '_' R O L E
+    ;
+
+DELETE_ROLE
+    : D E L E T E '_' R O L E
+    ;
+
+LIST_ROLE
+    : L I S T '_' R O L E
+    ;
+
+GRANT_ROLE_PRIVILEGE
+    : G R A N T '_' R O L E '_' P R I V I L E G E
+    ;
+
+REVOKE_ROLE_PRIVILEGE
+    : R E V O K E '_' R O L E '_' P R I V I L E G E
+    ;
+
+CREATE_FUNCTION
+    : C R E A T E '_' F U N C T I O N
+    ;
+
+DROP_FUNCTION
+    : D R O P '_' F U N C T I O N
+    ;
+
+CREATE_TRIGGER
+    : C R E A T E '_' T R I G G E R
+    ;
+
+DROP_TRIGGER
+    : D R O P '_' T R I G G E R
+    ;
+
+START_TRIGGER
+    : S T A R T '_' T R I G G E R
+    ;
+
+STOP_TRIGGER
+    : S T O P '_' T R I G G E R
+    ;
+
+CREATE_CONTINUOUS_QUERY
+    : C R E A T E '_' C O N T I N U O U S '_' Q U E R Y
+    ;
+
+DROP_CONTINUOUS_QUERY
+    : D R O P '_' C O N T I N U O U S '_' Q U E R Y
+    ;
+
+
+/**
+ * 3. Operators
+ */
+
+// Operators. Arithmetics
+
+MINUS : '-';
+PLUS : '+';
+DIV : '/';
+MOD : '%';
+
+
+// Operators. Comparation
+
+OPERATOR_EQ : '=' | '==';
+OPERATOR_GT : '>';
+OPERATOR_GTE : '>=';
+OPERATOR_LT : '<';
+OPERATOR_LTE : '<=';
+OPERATOR_NEQ : '!=' | '<>';
+
+OPERATOR_IN : I N;
+
+OPERATOR_AND
+    : A N D
+    | '&'
+    | '&&'
+    ;
+
+OPERATOR_OR
+    : O R
+    | '|'
+    | '||'
+    ;
+
+OPERATOR_NOT
+    : N O T | '!'
+    ;
+
+OPERATOR_CONTAINS
+    : C O N T A I N S
+    ;
+
+
+/**
+ * 4. Constructors Symbols
+ */
+
+DOT : '.';
+COMMA : ',';
+SEMI: ';';
+STAR: '*';
+DOUBLE_STAR: '**';
+LR_BRACKET : '(';
+RR_BRACKET : ')';
+LS_BRACKET : '[';
+RS_BRACKET : ']';
+
+
+/**
+ * 5. Literals
+ */
+
+// String Literal
+
+STRING_LITERAL
+    : SQUOTE_STRING
+    ;
+
+QUOTED_STRING_LITERAL
+    : DQUOTE_STRING
+    | BQUOTE_STRING
+    ;
+
+fragment DQUOTE_STRING
+    : '"' ('\\' . | ~'"' )*? '"'
+    ;
+
+fragment SQUOTE_STRING
+    : '\'' ('\\' . | ~'\'' )*? '\''
+    ;
+
+fragment BQUOTE_STRING
+    : '`' ('\\' . | ~'`' )*? '`'
+    ;
+
+// Date & Time Literal
+
+DURATION_LITERAL
+    : (INTEGER_LITERAL+ (Y|M O|W|D|H|M|S|M S|U S|N S))+
+    ;
+
+DATETIME_LITERAL
+    : INTEGER_LITERAL ('-'|'/') INTEGER_LITERAL ('-'|'/') INTEGER_LITERAL ((T | WS)
+      INTEGER_LITERAL ':' INTEGER_LITERAL ':' INTEGER_LITERAL (DOT INTEGER_LITERAL)?
+      (('+' | '-') INTEGER_LITERAL ':' INTEGER_LITERAL)?)?
+    | NOW LR_BRACKET RR_BRACKET
+    ;
+
+
+// Number Literal
+
+INTEGER_LITERAL
+    : DEC_DIGIT+
+    ;
+
+EXPONENT_NUM_PART
+    : DEC_DIGIT+ ('e'|'E') ('+'|'-')? DEC_DIGIT+
+    ;
+
+fragment DEC_DIGIT
+    : [0-9]
+    ;
+
+
+// Boolean Literal
+
+BOOLEAN_LITERAL
+	: T R U E
+	| F A L S E
+	;
+
+
+// Other Literals
+
+NULL_LITERAL
+    : N U L L
+    ;
+
+NAN_LITERAL
+    : N A N
+    ;
+
+
+/**
+ * 6. Identifier
+ */
+
+ID
+    : FIRST_NAME_CHAR NAME_CHAR*
+    ;
+
+fragment NAME_CHAR
+    :   'A'..'Z'
+    |   'a'..'z'
+    |   '0'..'9'
+    |   '_'
+    |   '-'
+    |   ':'
+    |   '/'
+    |   '@'
+    |   '#'
+    |   '$'
+    |   '%'
+    |   '&'
+    |   '+'
+    |   '{'
+    |   '}'
+    |   CN_CHAR
+    ;
+
+fragment FIRST_NAME_CHAR
+    :   'A'..'Z'
+    |   'a'..'z'
+    |   '0'..'9'
+    |   '_'
+    |   '/'
+    |   '@'
+    |   '#'
+    |   '$'
+    |   '%'
+    |   '&'
+    |   '+'
+    |   '{'
+    |   '}'
+    |   CN_CHAR
+    ;
+
+fragment CN_CHAR
+    : '\u2E80'..'\u9FFF'
+    ;
+
+
+// Characters and write it this way for case sensitivity
+
+fragment A: [aA];
+fragment B: [bB];
+fragment C: [cC];
+fragment D: [dD];
+fragment E: [eE];
+fragment F: [fF];
+fragment G: [gG];
+fragment H: [hH];
+fragment I: [iI];
+fragment J: [jJ];
+fragment K: [kK];
+fragment L: [lL];
+fragment M: [mM];
+fragment N: [nN];
+fragment O: [oO];
+fragment P: [pP];
+fragment Q: [qQ];
+fragment R: [rR];
+fragment S: [sS];
+fragment T: [tT];
+fragment U: [uU];
+fragment V: [vV];
+fragment W: [wW];
+fragment X: [xX];
+fragment Y: [yY];
+fragment Z: [zZ];
\ No newline at end of file
diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
new file mode 100644
index 0000000..fda69f2
--- /dev/null
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
@@ -0,0 +1,856 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+parser grammar IoTDBSqlParser;
+
+options { tokenVocab=IoTDBSqlLexer; }
+
+
+/**
+ * 1. Top Level Description
+ */
+
+singleStatement
+    : DEBUG? statement SEMI? EOF
+    ;
+
+statement
+    : ddlStatement | dmlStatement | dclStatement | utilityStatement
+    ;
+
+ddlStatement
+    : setStorageGroup | createStorageGroup | createTimeseries
+    | createFunction | createTrigger | createContinuousQuery | createSnapshot
+    | alterTimeseries | deleteStorageGroup | deleteTimeseries | deletePartition
+    | dropFunction | dropTrigger | dropContinuousQuery
+    | setTTL | unsetTTL | startTrigger | stopTrigger
+    | showStorageGroup | showDevices | showTimeseries | showChildPaths | showChildNodes
+    | showFunctions | showTriggers | showContinuousQueries | showTTL | showAllTTL
+    | countStorageGroup | countDevices | countTimeseries | countNodes
+    ;
+
+dmlStatement
+    : selectStatement | insertStatement | deleteStatement;
+
+dclStatement
+    : createUser | createRole | alterUser | grantUser | grantRole | grantRoleToUser
+    | revokeUser |  revokeRole | revokeRoleFromUser | dropUser | dropRole
+    | listUser | listRole | listPrivilegesUser | listPrivilegesRole
+    | listUserPrivileges | listRolePrivileges | listAllRoleOfUser | listAllUserOfRole
+    ;
+
+utilityStatement
+    : merge | fullMerge | flush | clearCache | settle
+    | setSystemStatus | showVersion | showFlushInfo | showLockInfo | showMergeInfo
+    | showQueryProcesslist | killQuery | grantWatermarkEmbedding | revokeWatermarkEmbedding
+    | loadConfiguration | loadTimeseries | loadFile | removeFile | unloadFile;
+
+
+/**
+ * 2. Data Definition Language (DDL)
+ */
+
+// Create Storage Group
+setStorageGroup
+    : SET STORAGE GROUP TO prefixPath
+    ;
+
+createStorageGroup
+    : CREATE STORAGE GROUP prefixPath
+    ;
+
+// Create Timeseries
+createTimeseries
+    : CREATE TIMESERIES fullPath alias? WITH attributeClauses
+    ;
+
+alias
+    : LR_BRACKET ID RR_BRACKET
+    ;
+
+attributeClauses
+    : DATATYPE OPERATOR_EQ dataType=DATATYPE_VALUE
+    (COMMA ENCODING OPERATOR_EQ encoding=ENCODING_VALUE)?
+    (COMMA (COMPRESSOR | COMPRESSION) OPERATOR_EQ compressor=COMPRESSOR_VALUE)?
+    (COMMA propertyClause)*
+    tagClause?
+    attributeClause?
+    ;
+
+// Create Function
+createFunction
+    : CREATE FUNCTION udfName=ID AS className=STRING_LITERAL
+    ;
+
+// Create Trigger
+createTrigger
+    : CREATE TRIGGER triggerName=ID triggerEventClause ON fullPath AS className=STRING_LITERAL triggerAttributeClause?
+    ;
+
+triggerEventClause
+    : (BEFORE | AFTER) INSERT
+    ;
+
+triggerAttributeClause
+    : WITH LR_BRACKET triggerAttribute (COMMA triggerAttribute)* RR_BRACKET
+    ;
+
+triggerAttribute
+    : key=STRING_LITERAL OPERATOR_EQ value=STRING_LITERAL
+    ;
+
+// Create Continuous Query
+createContinuousQuery
+    : CREATE (CONTINUOUS QUERY | CQ) continuousQueryName=ID resampleClause? cqSelectIntoClause
+    ;
+
+cqSelectIntoClause
+    : BEGIN selectClause INTO intoPath fromClause cqGroupByTimeClause END
+    ;
+
+cqGroupByTimeClause
+    : GROUP BY TIME LR_BRACKET DURATION_LITERAL RR_BRACKET
+      (COMMA LEVEL OPERATOR_EQ INTEGER_LITERAL (COMMA INTEGER_LITERAL)*)?
+    ;
+
+resampleClause
+    : RESAMPLE (EVERY DURATION_LITERAL)? (FOR DURATION_LITERAL)?;
+
+// Create Snapshot for Schema
+createSnapshot
+    : CREATE SNAPSHOT FOR SCHEMA
+    ;
+
+// Alter Timeseries
+alterTimeseries
+    : ALTER TIMESERIES fullPath alterClause
+    ;
+
+alterClause
+    : RENAME beforeName=ID TO currentName=ID
+    | SET propertyClause (COMMA propertyClause)*
+    | DROP ID (COMMA ID)*
+    | ADD TAGS propertyClause (COMMA propertyClause)*
+    | ADD ATTRIBUTES propertyClause (COMMA propertyClause)*
+    | UPSERT aliasClause? tagClause? attributeClause?
+    ;
+
+aliasClause
+    : ALIAS OPERATOR_EQ ID
+    ;
+
+// Delete Storage Group
+deleteStorageGroup
+    : DELETE STORAGE GROUP prefixPath (COMMA prefixPath)*
+    ;
+
+// Delete Timeseries
+deleteTimeseries
+    : DELETE TIMESERIES prefixPath (COMMA prefixPath)*
+    ;
+
+// Delete Partition
+deletePartition
+    : DELETE PARTITION prefixPath INTEGER_LITERAL(COMMA INTEGER_LITERAL)*
+    ;
+
+// Drop Function
+dropFunction
+    : DROP FUNCTION udfName=ID
+    ;
+
+// Drop Trigger
+dropTrigger
+    : DROP TRIGGER triggerName=ID
+    ;
+
+// Drop Continuous Query
+dropContinuousQuery
+    : DROP (CONTINUOUS QUERY|CQ) continuousQueryName=ID
+    ;
+
+// Set TTL
+setTTL
+    : SET TTL TO path=prefixPath time=INTEGER_LITERAL
+    ;
+
+// Unset TTL
+unsetTTL
+    : UNSET TTL TO path=prefixPath
+    ;
+
+// Start Trigger
+startTrigger
+    : START TRIGGER triggerName=ID
+    ;
+
+// Stop Trigger
+stopTrigger
+    : STOP TRIGGER triggerName=ID
+    ;
+
+// Show Storage Group
+showStorageGroup
+    : SHOW STORAGE GROUP prefixPath?
+    ;
+
+// Show Devices
+showDevices
+    : SHOW DEVICES prefixPath? (WITH STORAGE GROUP)? limitClause?
+    ;
+
+// Show Timeseries
+showTimeseries
+    : SHOW LATEST? TIMESERIES prefixPath? showWhereClause? limitClause?
+    ;
+
+showWhereClause
+    : WHERE (propertyClause | containsExpression)
+    ;
+
+// Show Child Paths
+showChildPaths
+    : SHOW CHILD PATHS prefixPath?
+    ;
+
+// Show Child Nodes
+showChildNodes
+    : SHOW CHILD NODES prefixPath?
+    ;
+
+// Show Functions
+showFunctions
+    : SHOW FUNCTIONS
+    ;
+
+// Show Triggers
+showTriggers
+    : SHOW TRIGGERS
+    ;
+
+// Show Continuous Queries
+showContinuousQueries
+    : SHOW (CONTINUOUS QUERIES | CQS)
+    ;
+
+// Show TTL
+showTTL
+    : SHOW TTL ON prefixPath (COMMA prefixPath)*
+    ;
+
+// Show All TTL
+showAllTTL
+    : SHOW ALL TTL
+    ;
+
+// Count Storage Group
+countStorageGroup
+    : COUNT STORAGE GROUP prefixPath?
+    ;
+
+// Count Devices
+countDevices
+    : COUNT DEVICES prefixPath?
+    ;
+
+// Count Timeseries
+countTimeseries
+    : COUNT TIMESERIES prefixPath? (GROUP BY LEVEL OPERATOR_EQ INTEGER_LITERAL)?
+    ;
+
+// Count Nodes
+countNodes
+    : COUNT NODES prefixPath LEVEL OPERATOR_EQ INTEGER_LITERAL
+    ;
+
+
+/**
+ * 3. Data Manipulation Language (DML)
+ */
+
+// Select Statement
+selectStatement
+    : TRACING? selectClause intoClause? fromClause whereClause? specialClause?
+    ;
+
+intoClause
+    : INTO intoPath (COMMA intoPath)*
+    ;
+
+intoPath
+    : fullPath
+    | nodeNameWithoutWildcard (DOT nodeNameWithoutWildcard)*
+    ;
+
+specialClause
+    : specialLimit #specialLimitStatement
+    | orderByTimeClause specialLimit? #orderByTimeStatement
+    | groupByTimeClause orderByTimeClause? specialLimit? #groupByTimeStatement
+    | groupByFillClause orderByTimeClause? specialLimit? #groupByFillStatement
+    | groupByLevelClause orderByTimeClause? specialLimit? #groupByLevelStatement
+    | fillClause slimitClause? alignByDeviceClauseOrDisableAlign? #fillStatement
+    ;
+
+specialLimit
+    : limitClause slimitClause? alignByDeviceClauseOrDisableAlign? #limitStatement
+    | slimitClause limitClause? alignByDeviceClauseOrDisableAlign? #slimitStatement
+    | withoutNullClause limitClause? slimitClause? alignByDeviceClauseOrDisableAlign? #withoutNullStatement
+    | alignByDeviceClauseOrDisableAlign #alignByDeviceClauseOrDisableAlignStatement
+    ;
+
+alignByDeviceClauseOrDisableAlign
+    : alignByDeviceClause
+    | disableAlign
+    ;
+
+alignByDeviceClause
+    : ALIGN BY DEVICE
+    | GROUP BY DEVICE
+    ;
+
+disableAlign
+    : DISABLE ALIGN
+    ;
+
+orderByTimeClause
+    : ORDER BY TIME (DESC | ASC)?
+    ;
+
+groupByTimeClause
+    : GROUP BY LR_BRACKET timeInterval COMMA DURATION_LITERAL (COMMA DURATION_LITERAL)? RR_BRACKET
+    | GROUP BY LR_BRACKET timeInterval COMMA DURATION_LITERAL (COMMA DURATION_LITERAL)? RR_BRACKET
+    COMMA LEVEL OPERATOR_EQ INTEGER_LITERAL (COMMA INTEGER_LITERAL)*
+    ;
+
+groupByFillClause
+    : GROUP BY LR_BRACKET timeInterval COMMA DURATION_LITERAL  RR_BRACKET
+     FILL LR_BRACKET typeClause (COMMA typeClause)* RR_BRACKET
+    ;
+
+groupByLevelClause
+    : GROUP BY LEVEL OPERATOR_EQ INTEGER_LITERAL (COMMA INTEGER_LITERAL)*
+    ;
+
+fillClause
+    : FILL LR_BRACKET typeClause (COMMA typeClause)* RR_BRACKET
+    ;
+
+withoutNullClause
+    : WITHOUT NULL_LITERAL (ALL | ANY)
+    ;
+
+typeClause
+    : (dataType=DATATYPE_VALUE | ALL) LS_BRACKET linearClause RS_BRACKET
+    | (dataType=DATATYPE_VALUE | ALL) LS_BRACKET previousClause RS_BRACKET
+    | (dataType=DATATYPE_VALUE | ALL) LS_BRACKET specificValueClause RS_BRACKET
+    | (dataType=DATATYPE_VALUE | ALL) LS_BRACKET previousUntilLastClause RS_BRACKET
+    ;
+
+linearClause
+    : LINEAR (COMMA aheadDuration=DURATION_LITERAL COMMA behindDuration=DURATION_LITERAL)?
+    ;
+
+previousClause
+    : PREVIOUS (COMMA DURATION_LITERAL)?
+    ;
+
+specificValueClause
+    : constant?
+    ;
+
+previousUntilLastClause
+    : PREVIOUSUNTILLAST (COMMA DURATION_LITERAL)?
+    ;
+
+timeInterval
+    : LS_BRACKET startTime=datetimeLiteral COMMA endTime=datetimeLiteral RR_BRACKET
+    | LR_BRACKET startTime=datetimeLiteral COMMA endTime=datetimeLiteral RS_BRACKET
+    ;
+
+// Insert Statement
+insertStatement
+    : INSERT INTO prefixPath insertColumnsSpec VALUES insertValuesSpec
+    ;
+
+insertColumnsSpec
+    : LR_BRACKET (TIMESTAMP|TIME)? (COMMA? measurementName)+ RR_BRACKET
+    ;
+
+insertValuesSpec
+    : (COMMA? insertMultiValue)*
+    ;
+
+insertMultiValue
+    : LR_BRACKET DATETIME_LITERAL (COMMA measurementValue)+ RR_BRACKET
+    | LR_BRACKET INTEGER_LITERAL (COMMA measurementValue)+ RR_BRACKET
+    | LR_BRACKET (measurementValue COMMA?)+ RR_BRACKET
+    ;
+
+measurementName
+    : nodeNameWithoutWildcard
+    | LR_BRACKET nodeNameWithoutWildcard (COMMA nodeNameWithoutWildcard)+ RR_BRACKET
+    ;
+
+measurementValue
+    : constant
+    | LR_BRACKET constant (COMMA constant)+ RR_BRACKET
+    ;
+
+// Delete Statement
+deleteStatement
+    : DELETE FROM prefixPath (COMMA prefixPath)* (whereClause)?
+    ;
+
+whereClause
+    : WHERE (orExpression | indexPredicateClause)
+    ;
+
+/**
+ * 4. Data Control Language (DCL)
+ */
+
+// Create User
+createUser
+    : CREATE USER userName=ID password=STRING_LITERAL
+    ;
+
+// Create Role
+createRole
+    : CREATE ROLE roleName=ID
+    ;
+
+// Alter Password
+alterUser
+    : ALTER USER userName=usernameWithRoot SET PASSWORD password=STRING_LITERAL
+    ;
+
+// Grant User Privileges
+grantUser
+    : GRANT USER userName=ID PRIVILEGES privileges ON prefixPath
+    ;
+
+// Grant Role Privileges
+grantRole
+    : GRANT ROLE roleName=ID PRIVILEGES privileges ON prefixPath
+    ;
+
+// Grant User Role
+grantRoleToUser
+    : GRANT roleName=ID TO userName=ID
+    ;
+
+// Revoke User Privileges
+revokeUser
+    : REVOKE USER userName=ID PRIVILEGES privileges ON prefixPath
+    ;
+
+// Revoke Role Privileges
+revokeRole
+    : REVOKE ROLE roleName=ID PRIVILEGES privileges ON prefixPath
+    ;
+
+// Revoke Role From User
+revokeRoleFromUser
+    : REVOKE roleName=ID FROM userName=ID
+    ;
+
+// Drop User
+dropUser
+    : DROP USER userName=ID
+    ;
+
+// Drop Role
+dropRole
+    : DROP ROLE roleName=ID
+    ;
+
+// List Users
+listUser
+    : LIST USER
+    ;
+
+// List Roles
+listRole
+    : LIST ROLE
+    ;
+
+// List Privileges
+listPrivilegesUser
+    : LIST PRIVILEGES USER userName=usernameWithRoot ON prefixPath
+    ;
+
+// List Privileges of Roles On Specific Path
+listPrivilegesRole
+    : LIST PRIVILEGES ROLE roleName=ID ON prefixPath
+    ;
+
+// List Privileges of Users
+listUserPrivileges
+    : LIST USER PRIVILEGES userName=usernameWithRoot
+    ;
+
+// List Privileges of Roles
+listRolePrivileges
+    : LIST ROLE PRIVILEGES roleName=ID
+    ;
+
+// List Roles of Users
+listAllRoleOfUser
+    : LIST ALL ROLE OF USER userName=usernameWithRoot
+    ;
+
+// List Users of Role
+listAllUserOfRole
+    : LIST ALL USER OF ROLE roleName=ID
+    ;
+
+privileges
+    : privilegeValue (COMMA privilegeValue)*
+    ;
+
+privilegeValue
+    : ALL
+    | PRIVILEGE_VALUE
+    ;
+
+usernameWithRoot
+    : ROOT
+    | ID
+    ;
+
+
+/**
+ * 5. Utility Statements
+ */
+
+// Merge
+merge
+    : MERGE
+    ;
+
+// Full Merge
+fullMerge
+    : FULL MERGE
+    ;
+
+// Flush
+flush
+    : FLUSH prefixPath? (COMMA prefixPath)* BOOLEAN_LITERAL?
+    ;
+
+// Clear Cache
+clearCache
+    : CLEAR CACHE
+    ;
+
+// Settle
+settle
+    : SETTLE (prefixPath|tsFilePath=STRING_LITERAL)
+    ;
+
+// Set System To ReadOnly/Writable
+setSystemStatus
+    : SET SYSTEM TO (READONLY|WRITABLE)
+    ;
+
+// Show Version
+showVersion
+    : SHOW VERSION
+    ;
+
+// Show Flush Info
+showFlushInfo
+    : SHOW FLUSH INFO
+    ;
+
+// Show Lock Info
+showLockInfo
+    : SHOW LOCK INFO prefixPath
+    ;
+
+// Show Merge Info
+showMergeInfo
+    : SHOW MERGE INFO
+    ;
+
+// Show Query Processlist
+showQueryProcesslist
+    : SHOW QUERY PROCESSLIST
+    ;
+
+// Kill Query
+killQuery
+    : KILL QUERY INTEGER_LITERAL?
+    ;
+
+// Grant Watermark Embedding
+grantWatermarkEmbedding
+    : GRANT WATERMARK_EMBEDDING TO usernameWithRoot (COMMA usernameWithRoot)*
+    ;
+
+// Revoke Watermark Embedding
+revokeWatermarkEmbedding
+    : REVOKE WATERMARK_EMBEDDING FROM usernameWithRoot (COMMA usernameWithRoot)*
+    ;
+
+// Load Configuration
+loadConfiguration
+    : LOAD CONFIGURATION (MINUS GLOBAL)?
+    ;
+
+// Load Timeseries
+loadTimeseries
+    : LOAD TIMESERIES fileName=STRING_LITERAL prefixPath
+    ;
+
+// Load TsFile
+loadFile
+    : LOAD fileName=STRING_LITERAL loadFilesClause?
+    ;
+
+loadFilesClause
+    : AUTOREGISTER OPERATOR_EQ BOOLEAN_LITERAL (COMMA loadFilesClause)?
+    | SGLEVEL OPERATOR_EQ INTEGER_LITERAL (COMMA loadFilesClause)?
+    | VERIFY OPERATOR_EQ BOOLEAN_LITERAL (COMMA loadFilesClause)?
+    ;
+
+// Remove TsFile
+removeFile
+    : REMOVE fileName=STRING_LITERAL
+    ;
+
+// Unload TsFile
+unloadFile
+    : UNLOAD srcFileName=STRING_LITERAL dstFileDir=STRING_LITERAL
+    ;
+
+
+/**
+ * 6. Common Clauses
+ */
+
+// IoTDB Objects
+
+fullPath
+    : ROOT (DOT nodeNameWithoutWildcard)*
+    ;
+
+prefixPath
+    : ROOT (DOT nodeName)*
+    ;
+
+suffixPath
+    : nodeName (DOT nodeName)*
+    ;
+
+nodeName
+    : ID wildcard?
+    | wildcard
+    | (ID | OPERATOR_IN)? LS_BRACKET INTEGER_LITERAL? ID? RS_BRACKET? ID?
+    | literalCanBeNodeName
+    | keywordsCanBeNodeName
+    ;
+
+nodeNameWithoutWildcard
+    : ID
+    | (ID | OPERATOR_IN)? LS_BRACKET INTEGER_LITERAL? ID? RS_BRACKET? ID?
+    | literalCanBeNodeName
+    | keywordsCanBeNodeName
+    ;
+
+wildcard
+    : STAR
+    | DOUBLE_STAR
+    ;
+
+literalCanBeNodeName
+    : QUOTED_STRING_LITERAL
+    | datetimeLiteral
+    | DURATION_LITERAL
+    | (MINUS|PLUS)? INTEGER_LITERAL
+    | (MINUS|PLUS)? EXPONENT_NUM_PART
+    | BOOLEAN_LITERAL
+    ;
+
+keywordsCanBeNodeName
+    : DATATYPE_VALUE
+    | ENCODING_VALUE
+    | COMPRESSOR_VALUE
+    | ASC
+    | DESC
+    | DEVICE
+    ;
+
+
+// Constant & Literal
+
+constant
+    : STRING_LITERAL
+    | dateExpression
+    | (MINUS|PLUS)? INTEGER_LITERAL
+    | (MINUS|PLUS)? realLiteral
+    | BOOLEAN_LITERAL
+    | NULL_LITERAL
+    | NAN_LITERAL
+    ;
+
+realLiteral
+    : INTEGER_LITERAL DOT (INTEGER_LITERAL|EXPONENT_NUM_PART)?
+    | DOT (INTEGER_LITERAL|EXPONENT_NUM_PART)
+    | EXPONENT_NUM_PART
+    ;
+
+datetimeLiteral
+    : DATETIME_LITERAL
+    | dateExpression
+    | INTEGER_LITERAL
+    ;
+
+
+// Expression & Predicate
+
+dateExpression
+    : DATETIME_LITERAL ((PLUS | MINUS) DURATION_LITERAL)*
+    ;
+
+expression
+    : LR_BRACKET unaryInBracket=expression RR_BRACKET
+    | (PLUS | MINUS) unaryAfterSign=expression
+    | leftExpression=expression (STAR | DIV | MOD) rightExpression=expression
+    | leftExpression=expression (PLUS | MINUS) rightExpression=expression
+    | functionName LR_BRACKET expression (COMMA expression)* functionAttribute* RR_BRACKET
+    | suffixPath
+    | literal=STRING_LITERAL
+    ;
+
+functionName
+    : ID
+    | COUNT
+    ;
+
+functionAttribute
+    : COMMA functionAttributeKey=STRING_LITERAL OPERATOR_EQ functionAttributeValue=STRING_LITERAL
+    ;
+
+containsExpression
+    : name=ID OPERATOR_CONTAINS value=propertyValue
+    ;
+
+orExpression
+    : andExpression (OPERATOR_OR andExpression)*
+    ;
+
+andExpression
+    : predicate (OPERATOR_AND predicate)*
+    ;
+
+predicate
+    : (TIME | TIMESTAMP | suffixPath | fullPath) comparisonOperator constant
+    | (TIME | TIMESTAMP | suffixPath | fullPath) inClause
+    | OPERATOR_NOT? LR_BRACKET orExpression RR_BRACKET
+    | (suffixPath | fullPath) (REGEXP | LIKE) STRING_LITERAL
+    ;
+
+comparisonOperator
+    : type = OPERATOR_GT
+    | type = OPERATOR_GTE
+    | type = OPERATOR_LT
+    | type = OPERATOR_LTE
+    | type = OPERATOR_EQ
+    | type = OPERATOR_NEQ
+    ;
+
+inClause
+    : OPERATOR_NOT? OPERATOR_IN LR_BRACKET constant (COMMA constant)* RR_BRACKET
+    ;
+
+indexPredicateClause
+    : (suffixPath | fullPath) LIKE sequenceClause
+    | (suffixPath | fullPath) CONTAIN sequenceClause
+    WITH TOLERANCE constant (CONCAT sequenceClause WITH TOLERANCE constant)*
+    ;
+
+sequenceClause
+    : LR_BRACKET constant (COMMA constant)* RR_BRACKET
+    ;
+
+
+// Select Clause
+
+selectClause
+    : SELECT (LAST | topClause)? resultColumn (COMMA resultColumn)*
+    ;
+
+topClause
+    : TOP INTEGER_LITERAL
+    ;
+
+resultColumn
+    : expression (AS ID)?
+    ;
+
+
+// From Clause
+
+fromClause
+    : FROM prefixPath (COMMA prefixPath)*
+    ;
+
+
+// Tag & Property Clause
+
+tagClause
+    : TAGS LR_BRACKET propertyClause (COMMA propertyClause)* RR_BRACKET
+    ;
+
+propertyClause
+    : name=ID OPERATOR_EQ value=propertyValue
+    ;
+
+propertyValue
+    : INTEGER_LITERAL
+    | ID
+    | STRING_LITERAL
+    | constant
+    ;
+
+attributeClause
+    : ATTRIBUTES LR_BRACKET propertyClause (COMMA propertyClause)* RR_BRACKET
+    ;
+
+
+// Limit & Offset Clause
+
+limitClause
+    : LIMIT INTEGER_LITERAL offsetClause?
+    | offsetClause? LIMIT INTEGER_LITERAL
+    ;
+
+offsetClause
+    : OFFSET INTEGER_LITERAL
+    ;
+
+slimitClause
+    : SLIMIT INTEGER_LITERAL soffsetClause?
+    | soffsetClause? SLIMIT INTEGER_LITERAL
+    ;
+
+soffsetClause
+    : SOFFSET INTEGER_LITERAL
+    ;
\ No newline at end of file
diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4
deleted file mode 100644
index 7787942..0000000
--- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4
+++ /dev/null
@@ -1,1612 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-grammar SqlBase;
-
-singleStatement
-    : DEBUG? statement (';')? EOF
-    ;
-
-/*
- * According to The Definitive ANTLR 4 Reference, 11. Altering the Parse with Semantic Predicates, Altering the Parse with Semantic Predicates.
- * "It s a good idea to avoid embedding predicates in the parser when possible for efficiency and clarity reasons."
- * So if unnecessary, don't use embedding predicates.
- */
-
-statement
-    : CREATE TIMESERIES fullPath alias? WITH attributeClauses #createTimeseries
-    | DELETE TIMESERIES prefixPath (COMMA prefixPath)* #deleteTimeseries
-    | ALTER TIMESERIES fullPath alterClause #alterTimeseries
-    | INSERT INTO prefixPath insertColumnsSpec VALUES insertValuesSpec #insertStatement
-    | UPDATE prefixPath setClause whereClause? #updateStatement
-    | DELETE FROM prefixPath (COMMA prefixPath)* (whereClause)? #deleteStatement
-    | SET STORAGE GROUP TO prefixPath #setStorageGroup
-    | CREATE STORAGE GROUP prefixPath #createStorageGroup
-    | DELETE STORAGE GROUP prefixPath (COMMA prefixPath)* #deleteStorageGroup
-    | SHOW METADATA #showMetadata // not support yet
-    | DESCRIBE prefixPath #describePath // not support yet
-    | CREATE INDEX ON prefixPath whereClause? indexWithClause #createIndex //not support yet
-    | DROP INDEX indexName=ID ON prefixPath #dropIndex //not support yet
-    | MERGE #merge
-    | FLUSH prefixPath? (COMMA prefixPath)* (booleanClause)?#flush
-    | SETTLE pathOrString #settle
-    | FULL MERGE #fullMerge
-    | CLEAR CACHE #clearcache
-    | CREATE USER userName=ID password= stringLiteral#createUser
-    | ALTER USER userName=(ROOT|ID) SET PASSWORD password=stringLiteral #alterUser
-    | DROP USER userName=ID #dropUser
-    | CREATE ROLE roleName=ID #createRole
-    | DROP ROLE roleName=ID #dropRole
-    | GRANT USER userName=ID PRIVILEGES privileges ON prefixPath #grantUser
-    | GRANT ROLE roleName=ID PRIVILEGES privileges ON prefixPath #grantRole
-    | REVOKE USER userName=ID PRIVILEGES privileges ON prefixPath #revokeUser
-    | REVOKE ROLE roleName=ID PRIVILEGES privileges ON prefixPath #revokeRole
-    | GRANT roleName=ID TO userName=ID #grantRoleToUser
-    | REVOKE roleName = ID FROM userName = ID #revokeRoleFromUser
-    | LOAD TIMESERIES (fileName=stringLiteral) prefixPath#loadStatement
-    | GRANT WATERMARK_EMBEDDING TO rootOrId (COMMA rootOrId)* #grantWatermarkEmbedding
-    | REVOKE WATERMARK_EMBEDDING FROM rootOrId (COMMA rootOrId)* #revokeWatermarkEmbedding
-    | LIST USER #listUser
-    | LIST ROLE #listRole
-    | LIST PRIVILEGES USER username=rootOrId ON prefixPath #listPrivilegesUser
-    | LIST PRIVILEGES ROLE roleName=ID ON prefixPath #listPrivilegesRole
-    | LIST USER PRIVILEGES username =rootOrId #listUserPrivileges
-    | LIST ROLE PRIVILEGES roleName = ID #listRolePrivileges
-    | LIST ALL ROLE OF USER username = rootOrId #listAllRoleOfUser
-    | LIST ALL USER OF ROLE roleName = ID #listAllUserOfRole
-    | SET TTL TO path=prefixPath time=INT #setTTLStatement
-    | UNSET TTL TO path=prefixPath #unsetTTLStatement
-    | SHOW TTL ON prefixPath (COMMA prefixPath)* #showTTLStatement
-    | SHOW ALL TTL #showAllTTLStatement
-    | SHOW FLUSH TASK INFO #showFlushTaskInfo
-    | SHOW VERSION #showVersion
-    | SHOW LATEST? TIMESERIES prefixPath? showWhereClause? limitClause? #showTimeseries
-    | SHOW STORAGE GROUP prefixPath? #showStorageGroup
-    | SHOW LOCK INFO prefixPath? #showLockInfo
-    | SHOW CHILD PATHS prefixPath? #showChildPaths
-    | SHOW CHILD NODES prefixPath? #showChildNodes
-    | SHOW DEVICES prefixPath? (WITH STORAGE GROUP)? limitClause? #showDevices
-    | SHOW MERGE #showMergeStatus
-    | SHOW QUERY PROCESSLIST #showQueryProcesslist
-    | KILL QUERY INT? #killQuery
-    | TRACING ON #tracingOn // not support yet
-    | TRACING OFF #tracingOff // not support yet
-    | SET SYSTEM TO READONLY #setSystemToReadOnly
-    | SET SYSTEM TO WRITABLE #setSystemToWritable
-    | COUNT TIMESERIES prefixPath? (GROUP BY LEVEL OPERATOR_EQ INT)? #countTimeseries
-    | COUNT DEVICES prefixPath? #countDevices
-    | COUNT STORAGE GROUP prefixPath? #countStorageGroup
-    | COUNT NODES prefixPath LEVEL OPERATOR_EQ INT #countNodes
-    | LOAD CONFIGURATION (MINUS GLOBAL)? #loadConfigurationStatement
-    | LOAD stringLiteral loadFilesClause?#loadFiles
-    | REMOVE stringLiteral #removeFile
-    | UNLOAD stringLiteral stringLiteral #unloadFile
-    | DELETE PARTITION prefixPath INT(COMMA INT)* #deletePartition
-    | CREATE SNAPSHOT FOR SCHEMA #createSnapshot
-    | CREATE FUNCTION udfName=ID AS className=stringLiteral #createFunction
-    | DROP FUNCTION udfName=ID #dropFunction
-    | SHOW FUNCTIONS #showFunctions
-    | CREATE TRIGGER triggerName=ID triggerEventClause ON fullPath
-      AS className=stringLiteral triggerAttributeClause? #createTrigger
-    | DROP TRIGGER triggerName=ID #dropTrigger
-    | START TRIGGER triggerName=ID #startTrigger
-    | STOP TRIGGER triggerName=ID #stopTrigger
-    | SHOW TRIGGERS #showTriggers
-    | TRACING? selectClause intoClause? fromClause whereClause? specialClause? #selectStatement
-    | CREATE (CONTINUOUS QUERY | CQ) continuousQueryName=ID
-      resampleClause?
-      cqSelectIntoClause #createContinuousQueryStatement
-    | DROP (CONTINUOUS QUERY | CQ) continuousQueryName=ID #dropContinuousQueryStatement
-    | SHOW (CONTINUOUS QUERIES | CQS) #showContinuousQueriesStatement
-    ;
-
-selectClause
-    : SELECT (LAST | topClause)? resultColumn (COMMA resultColumn)*
-    ;
-
-resultColumn
-    : expression (AS ID)?
-    ;
-
-expression
-    : LR_BRACKET unaryInBracket=expression RR_BRACKET
-    | (PLUS | MINUS) unaryAfterSign=expression
-    | leftExpression=expression (STAR | DIV | MOD) rightExpression=expression
-    | leftExpression=expression (PLUS | MINUS) rightExpression=expression
-    | functionName LR_BRACKET expression (COMMA expression)* functionAttribute* RR_BRACKET
-    | suffixPath
-    | literal=SINGLE_QUOTE_STRING_LITERAL
-    ;
-
-functionName
-    : ID
-    | COUNT
-    ;
-
-functionAttribute
-    : COMMA functionAttributeKey=stringLiteral OPERATOR_EQ functionAttributeValue=stringLiteral
-    ;
-
-intoClause
-    : INTO intoPath (COMMA intoPath)*
-    ;
-
-intoPath
-    : fullPath
-    | nodeNameWithoutStar (DOT nodeNameWithoutStar)*
-    ;
-
-alias
-    : LR_BRACKET ID RR_BRACKET
-    ;
-
-alterClause
-    : RENAME beforeName=ID TO currentName=ID
-    | SET property (COMMA property)*
-    | DROP ID (COMMA ID)*
-    | ADD TAGS property (COMMA property)*
-    | ADD ATTRIBUTES property (COMMA property)*
-    | UPSERT aliasClause? tagClause? attributeClause?
-    ;
-
-aliasClause
-    : ALIAS OPERATOR_EQ ID
-    ;
-
-attributeClauses
-    : DATATYPE OPERATOR_EQ dataType (COMMA ENCODING OPERATOR_EQ encoding)?
-    (COMMA (COMPRESSOR | COMPRESSION) OPERATOR_EQ compressor)?
-    (COMMA property)*
-    tagClause?
-    attributeClause?
-    ;
-
-compressor
-    : UNCOMPRESSED
-    | SNAPPY
-    | LZ4
-    | GZIP
-    ;
-
-attributeClause
-    : ATTRIBUTES LR_BRACKET property (COMMA property)* RR_BRACKET
-    ;
-
-tagClause
-    : TAGS LR_BRACKET property (COMMA property)* RR_BRACKET
-    ;
-
-setClause
-    : SET setCol (COMMA setCol)*
-    ;
-
-whereClause
-    : WHERE (orExpression | indexPredicateClause)
-    ;
-
-showWhereClause
-    : WHERE (property | containsExpression)
-    ;
-containsExpression
-    : name=ID OPERATOR_CONTAINS value=propertyValue
-    ;
-
-orExpression
-    : andExpression (OPERATOR_OR andExpression)*
-    ;
-
-andExpression
-    : predicate (OPERATOR_AND predicate)*
-    ;
-
-predicate
-    : (TIME | TIMESTAMP | suffixPath | fullPath) comparisonOperator constant
-    | (TIME | TIMESTAMP | suffixPath | fullPath) inClause
-    | OPERATOR_NOT? LR_BRACKET orExpression RR_BRACKET
-    | (suffixPath | fullPath) (REGEXP | LIKE) stringLiteral
-    ;
-
-inClause
-    : OPERATOR_NOT? OPERATOR_IN LR_BRACKET constant (COMMA constant)* RR_BRACKET
-    ;
-
-fromClause
-    : FROM prefixPath (COMMA prefixPath)*
-    ;
-
-specialClause
-    : specialLimit #specialLimitStatement
-    | orderByTimeClause specialLimit? #orderByTimeStatement
-    | groupByTimeClause orderByTimeClause? specialLimit? #groupByTimeStatement
-    | groupByFillClause orderByTimeClause? specialLimit? #groupByFillStatement
-    | groupByLevelClause orderByTimeClause? specialLimit? #groupByLevelStatement
-    | fillClause slimitClause? alignByDeviceClauseOrDisableAlign? #fillStatement
-    ;
-
-specialLimit
-    : limitClause slimitClause? alignByDeviceClauseOrDisableAlign? #limitStatement
-    | slimitClause limitClause? alignByDeviceClauseOrDisableAlign? #slimitStatement
-    | withoutNullClause limitClause? slimitClause? alignByDeviceClauseOrDisableAlign? #withoutNullStatement
-    | alignByDeviceClauseOrDisableAlign #alignByDeviceClauseOrDisableAlignStatement
-    ;
-
-withoutNullClause
-    : WITHOUT NULL (ALL | ANY)
-    ;
-
-
-orderByTimeClause
-    : ORDER BY TIME (DESC | ASC)?
-    ;
-
-limitClause
-    : LIMIT INT offsetClause?
-    | offsetClause? LIMIT INT
-    ;
-
-offsetClause
-    : OFFSET INT
-    ;
-
-slimitClause
-    : SLIMIT INT soffsetClause?
-    | soffsetClause? SLIMIT INT
-    ;
-
-soffsetClause
-    : SOFFSET INT
-    ;
-
-alignByDeviceClause
-    : ALIGN BY DEVICE
-    | GROUP BY DEVICE
-    ;
-
-disableAlign
-    : DISABLE ALIGN
-    ;
-
-alignByDeviceClauseOrDisableAlign
-    : alignByDeviceClause
-    | disableAlign
-    ;
-
-fillClause
-    : FILL LR_BRACKET typeClause (COMMA typeClause)* RR_BRACKET
-    ;
-
-groupByTimeClause
-    : GROUP BY LR_BRACKET
-      timeInterval
-      COMMA DURATION
-      (COMMA DURATION)?
-      RR_BRACKET
-    | GROUP BY LR_BRACKET
-            timeInterval
-            COMMA DURATION
-            (COMMA DURATION)?
-            RR_BRACKET
-            COMMA LEVEL OPERATOR_EQ INT (COMMA INT)*
-    ;
-
-groupByFillClause
-    : GROUP BY LR_BRACKET
-      timeInterval
-      COMMA DURATION
-      RR_BRACKET
-      FILL LR_BRACKET typeClause (COMMA typeClause)* RR_BRACKET
-     ;
-
-groupByLevelClause
-    : GROUP BY LEVEL OPERATOR_EQ INT (COMMA INT)*
-    ;
-
-typeClause
-    : (dataType | ALL) LS_BRACKET linearClause RS_BRACKET
-    | (dataType | ALL) LS_BRACKET previousClause RS_BRACKET
-    | (dataType | ALL) LS_BRACKET specificValueClause RS_BRACKET
-    | (dataType | ALL) LS_BRACKET previousUntilLastClause RS_BRACKET
-    ;
-
-linearClause
-    : LINEAR (COMMA aheadDuration=DURATION COMMA behindDuration=DURATION)?
-    ;
-
-previousClause
-    : PREVIOUS (COMMA DURATION)?
-    ;
-
-specificValueClause
-    : constant?
-    ;
-
-previousUntilLastClause
-    : PREVIOUSUNTILLAST (COMMA DURATION)?
-    ;
-
-indexWithClause
-    : WITH INDEX OPERATOR_EQ indexName=ID (COMMA property)*
-    ;
-
-topClause
-    : TOP INT
-    ;
-
-indexPredicateClause
-    : (suffixPath | fullPath) LIKE sequenceClause
-    | (suffixPath | fullPath) CONTAIN sequenceClause WITH TOLERANCE constant (CONCAT sequenceClause WITH TOLERANCE constant)*
-    ;
-
-
-sequenceClause
-    : LR_BRACKET constant (COMMA constant)* RR_BRACKET
-    ;
-
-resampleClause
-    : RESAMPLE (EVERY DURATION)? (FOR DURATION)?;
-
-cqSelectIntoClause
-    : BEGIN selectClause INTO intoPath fromClause cqGroupByTimeClause END
-    ;
-
-cqGroupByTimeClause
-    : GROUP BY TIME LR_BRACKET
-      DURATION
-      RR_BRACKET
-      (COMMA LEVEL OPERATOR_EQ INT (COMMA INT)*)?
-    ;
-
-comparisonOperator
-    : type = OPERATOR_GT
-    | type = OPERATOR_GTE
-    | type = OPERATOR_LT
-    | type = OPERATOR_LTE
-    | type = OPERATOR_EQ
-    | type = OPERATOR_NEQ
-    ;
-
-insertColumnsSpec
-    : LR_BRACKET (TIMESTAMP|TIME)? (COMMA? measurementName)+ RR_BRACKET
-    ;
-measurementName
-    : nodeNameWithoutStar
-    | LR_BRACKET nodeNameWithoutStar (COMMA nodeNameWithoutStar)+ RR_BRACKET
-    ;
-
-insertValuesSpec
-    :(COMMA? insertMultiValue)*
-    ;
-
-insertMultiValue
-    : LR_BRACKET dateFormat (COMMA measurementValue)+ RR_BRACKET
-    | LR_BRACKET INT (COMMA measurementValue)+ RR_BRACKET
-    | LR_BRACKET (measurementValue COMMA?)+ RR_BRACKET
-    ;
-
-measurementValue
-    : constant
-    | LR_BRACKET constant (COMMA constant)+ RR_BRACKET
-    ;
-
-setCol
-    : suffixPath OPERATOR_EQ constant
-    ;
-
-privileges
-    : stringLiteral (COMMA stringLiteral)*
-    ;
-
-rootOrId
-    : ROOT
-    | ID
-    ;
-
-timeInterval
-    : LS_BRACKET startTime=timeValue COMMA endTime=timeValue RR_BRACKET
-    | LR_BRACKET startTime=timeValue COMMA endTime=timeValue RS_BRACKET
-    ;
-
-timeValue
-    : dateFormat
-    | dateExpression
-    | INT
-    ;
-
-propertyValue
-    : INT
-    | ID
-    | stringLiteral
-    | constant
-    ;
-
-fullPath
-    : ROOT (DOT nodeNameWithoutStar)*
-    ;
-
-prefixPath
-    : ROOT (DOT nodeName)*
-    ;
-
-suffixPath
-    : nodeName (DOT nodeName)*
-    ;
-
-nodeName
-    : ID STAR?
-    | STAR
-    | DOUBLE_QUOTE_STRING_LITERAL
-    | DURATION
-    | encoding
-    | dataType
-    | dateExpression
-    | MINUS? (EXPONENT | INT)
-    | booleanClause
-    | CREATE
-    | INSERT
-    | UPDATE
-    | DELETE
-    | SELECT
-    | SHOW
-    | GRANT
-    | INTO
-    | SET
-    | WHERE
-    | FROM
-    | TO
-    | BY
-    | DEVICE
-    | CONFIGURATION
-    | DESCRIBE
-    | SLIMIT
-    | LIMIT
-    | UNLINK
-    | OFFSET
-    | SOFFSET
-    | FILL
-    | LINEAR
-    | PREVIOUS
-    | PREVIOUSUNTILLAST
-    | METADATA
-    | TIMESERIES
-    | TIMESTAMP
-    | PROPERTY
-    | WITH
-    | DATATYPE
-    | COMPRESSOR
-    | STORAGE
-    | GROUP
-    | LABEL
-    | ADD
-    | UPSERT
-    | VALUES
-    | NOW
-    | LINK
-    | INDEX
-    | USING
-    | ON
-    | DROP
-    | MERGE
-    | LIST
-    | USER
-    | PRIVILEGES
-    | ROLE
-    | ALL
-    | OF
-    | ALTER
-    | PASSWORD
-    | REVOKE
-    | LOAD
-    | WATERMARK_EMBEDDING
-    | UNSET
-    | TTL
-    | FLUSH
-    | TASK
-    | INFO
-    | VERSION
-    | REMOVE
-    | UNLOAD
-    | CHILD
-    | PATHS
-    | DEVICES
-    | COUNT
-    | NODES
-    | LEVEL
-    | LAST
-    | DISABLE
-    | ALIGN
-    | COMPRESSION
-    | TIME
-    | ATTRIBUTES
-    | TAGS
-    | RENAME
-    | FULL
-    | CLEAR
-    | CACHE
-    | SNAPSHOT
-    | FOR
-    | SCHEMA
-    | TRACING
-    | OFF
-    | SYSTEM
-    | READONLY
-    | WRITABLE
-    | (ID | OPERATOR_IN)? LS_BRACKET INT? ID? RS_BRACKET? ID?
-    | compressor
-    | GLOBAL
-    | PARTITION
-    | DESC
-    | ASC
-    ;
-
-nodeNameWithoutStar
-    : ID
-    | DOUBLE_QUOTE_STRING_LITERAL
-    | DURATION
-    | encoding
-    | dataType
-    | dateExpression
-    | MINUS? ( EXPONENT | INT)
-    | booleanClause
-    | CREATE
-    | INSERT
-    | UPDATE
-    | DELETE
-    | SELECT
-    | SHOW
-    | GRANT
-    | INTO
-    | SET
-    | WHERE
-    | FROM
-    | TO
-    | BY
-    | DEVICE
-    | CONFIGURATION
-    | DESCRIBE
-    | SLIMIT
-    | LIMIT
-    | UNLINK
-    | OFFSET
-    | SOFFSET
-    | FILL
-    | LINEAR
-    | PREVIOUS
-    | PREVIOUSUNTILLAST
-    | METADATA
-    | TIMESERIES
-    | PROPERTY
-    | WITH
-    | DATATYPE
-    | COMPRESSOR
-    | STORAGE
-    | GROUP
-    | LABEL
-    | ADD
-    | UPSERT
-    | VALUES
-    | NOW
-    | LINK
-    | INDEX
-    | USING
-    | ON
-    | DROP
-    | MERGE
-    | LIST
-    | USER
-    | PRIVILEGES
-    | ROLE
-    | ALL
-    | OF
-    | ALTER
-    | PASSWORD
-    | REVOKE
-    | LOAD
-    | WATERMARK_EMBEDDING
-    | UNSET
-    | TTL
-    | FLUSH
-    | TASK
-    | INFO
-    | VERSION
-    | REMOVE
-    | UNLOAD
-    | CHILD
-    | PATHS
-    | DEVICES
-    | COUNT
-    | NODES
-    | LEVEL
-    | LAST
-    | DISABLE
-    | ALIGN
-    | COMPRESSION
-    | ATTRIBUTES
-    | TAGS
-    | RENAME
-    | FULL
-    | CLEAR
-    | CACHE
-    | SNAPSHOT
-    | FOR
-    | SCHEMA
-    | TRACING
-    | OFF
-    | SYSTEM
-    | READONLY
-    | WRITABLE
-    | (ID | OPERATOR_IN)? LS_BRACKET INT? ID? RS_BRACKET? ID?
-    | compressor
-    | GLOBAL
-    | PARTITION
-    | DESC
-    | ASC
-    | CONTINUOUS
-    | CQ
-    | CQS
-    | BEGIN
-    | END
-    | RESAMPLE
-    | EVERY
-    ;
-
-dataType
-    : INT32 | INT64 | FLOAT | DOUBLE | BOOLEAN | TEXT
-    ;
-
-dateFormat
-    : DATETIME
-    | NOW LR_BRACKET RR_BRACKET
-    ;
-
-constant
-    : dateExpression
-    | NaN
-    | MINUS? realLiteral
-    | MINUS? INT
-    | stringLiteral
-    | booleanClause
-    | NULL
-    ;
-
-booleanClause
-    : TRUE
-    | FALSE
-    ;
-
-dateExpression
-    : dateFormat ((PLUS | MINUS) DURATION)*
-    ;
-
-encoding
-    : PLAIN | DICTIONARY | RLE | DIFF | TS_2DIFF | GORILLA | REGULAR
-    ;
-
-realLiteral
-    :   INT DOT (INT | EXPONENT)?
-    |   DOT  (INT|EXPONENT)
-    |   EXPONENT
-    ;
-
-property
-    : name=ID OPERATOR_EQ value=propertyValue
-    ;
-
-loadFilesClause
-    : AUTOREGISTER OPERATOR_EQ booleanClause (COMMA loadFilesClause)?
-    | SGLEVEL OPERATOR_EQ INT (COMMA loadFilesClause)?
-    | VERIFY OPERATOR_EQ booleanClause (COMMA loadFilesClause)?
-    ;
-
-triggerEventClause
-    : (BEFORE | AFTER) INSERT
-    ;
-
-triggerAttributeClause
-    : WITH LR_BRACKET triggerAttribute (COMMA triggerAttribute)* RR_BRACKET
-    ;
-
-triggerAttribute
-    : key=stringLiteral OPERATOR_EQ value=stringLiteral
-    ;
-
-//============================
-// Start of the keywords list
-//============================
-CREATE
-    : C R E A T E
-    ;
-
-INSERT
-    : I N S E R T
-    ;
-
-UPDATE
-    : U P D A T E
-    ;
-
-DELETE
-    : D E L E T E
-    ;
-
-SELECT
-    : S E L E C T
-    ;
-
-SHOW
-    : S H O W
-    ;
-
-QUERY
-    : Q U E R Y
-    ;
-
-KILL
-    : K I L L
-    ;
-
-PROCESSLIST
-    : P R O C E S S L I S T
-    ;
-
-
-GRANT
-    : G R A N T
-    ;
-
-INTO
-    : I N T O
-    ;
-
-SET
-    : S E T
-    ;
-
-WHERE
-    : W H E R E
-    ;
-
-FROM
-    : F R O M
-    ;
-
-TO
-    : T O
-    ;
-
-ORDER
-    : O R D E R
-    ;
-
-BY
-    : B Y
-    ;
-
-DEVICE
-    : D E V I C E
-    ;
-
-CONFIGURATION
-    : C O N F I G U R A T I O N
-    ;
-
-DESCRIBE
-    : D E S C R I B E
-    ;
-
-SLIMIT
-    : S L I M I T
-    ;
-
-LIMIT
-    : L I M I T
-    ;
-
-UNLINK
-    : U N L I N K
-    ;
-
-OFFSET
-    : O F F S E T
-    ;
-
-SOFFSET
-    : S O F F S E T
-    ;
-
-FILL
-    : F I L L
-    ;
-
-LINEAR
-    : L I N E A R
-    ;
-
-PREVIOUS
-    : P R E V I O U S
-    ;
-
-PREVIOUSUNTILLAST
-    : P R E V I O U S U N T I L L A S T
-    ;
-
-METADATA
-    : M E T A D A T A
-    ;
-
-TIMESERIES
-    : T I M E S E R I E S
-    ;
-
-TIMESTAMP
-    : T I M E S T A M P
-    ;
-
-PROPERTY
-    : P R O P E R T Y
-    ;
-
-WITH
-    : W I T H
-    ;
-
-ROOT
-    : R O O T
-    ;
-
-DATATYPE
-    : D A T A T Y P E
-    ;
-
-COMPRESSOR
-    : C O M P R E S S O R
-    ;
-
-STORAGE
-    : S T O R A G E
-    ;
-
-GROUP
-    : G R O U P
-    ;
-
-LABEL
-    : L A B E L
-    ;
-
-INT32
-    : I N T '3' '2'
-    ;
-
-INT64
-    : I N T '6' '4'
-    ;
-
-FLOAT
-    : F L O A T
-    ;
-
-DOUBLE
-    : D O U B L E
-    ;
-
-BOOLEAN
-    : B O O L E A N
-    ;
-
-TEXT
-    : T E X T
-    ;
-
-ENCODING
-    : E N C O D I N G
-    ;
-
-PLAIN
-    : P L A I N
-    ;
-
-DICTIONARY
-    : D I C T I O N A R Y
-    ;
-
-RLE
-    : R L E
-    ;
-
-DIFF
-    : D I F F
-    ;
-
-TS_2DIFF
-    : T S '_' '2' D I F F
-    ;
-
-GORILLA
-    : G O R I L L A
-    ;
-
-REGULAR
-    : R E G U L A R
-    ;
-
-BITMAP
-    : B I T M A P
-    ;
-
-ADD
-    : A D D
-    ;
-
-UPSERT
-    : U P S E R T
-    ;
-
-ALIAS
-    : A L I A S
-    ;
-
-VALUES
-    : V A L U E S
-    ;
-
-NOW
-    : N O W
-    ;
-
-LINK
-    : L I N K
-    ;
-
-INDEX
-    : I N D E X
-    ;
-
-USING
-    : U S I N G
-    ;
-
-TRACING
-    : T R A C I N G
-    ;
-
-ON
-    : O N
-    ;
-
-OFF
-    : O F F
-    ;
-
-SYSTEM
-    : S Y S T E M
-    ;
-
-READONLY
-    : R E A D O N L Y
-    ;
-
-WRITABLE
-    : W R I T A B L E
-    ;
-
-DROP
-    : D R O P
-    ;
-
-MERGE
-    : M E R G E
-    ;
-
-LIST
-    : L I S T
-    ;
-
-USER
-    : U S E R
-    ;
-
-PRIVILEGES
-    : P R I V I L E G E S
-    ;
-
-ROLE
-    : R O L E
-    ;
-
-ALL
-    : A L L
-    ;
-
-OF
-    : O F
-    ;
-
-ALTER
-    : A L T E R
-    ;
-
-PASSWORD
-    : P A S S W O R D
-    ;
-
-REVOKE
-    : R E V O K E
-    ;
-
-LOAD
-    : L O A D
-    ;
-
-WATERMARK_EMBEDDING
-    : W A T E R M A R K '_' E M B E D D I N G
-    ;
-
-UNSET
-    : U N S E T
-    ;
-
-TTL
-    : T T L
-    ;
-
-FLUSH
-    : F L U S H
-    ;
-
-SETTLE
-    : S E T T L E
-    ;
-
-TASK
-    : T A S K
-    ;
-
-INFO
-    : I N F O
-    ;
-
-VERSION
-    : V E R S I O N
-    ;
-
-REMOVE
-    : R E M O V E
-    ;
-UNLOAD
-    : U N L O A D
-    ;
-
-CHILD
-    : C H I L D
-    ;
-
-PATHS
-    : P A T H S
-    ;
-
-DEVICES
-    : D E V I C E S
-    ;
-
-COUNT
-    : C O U N T
-    ;
-
-NODES
-    : N O D E S
-    ;
-
-LEVEL
-    : L E V E L
-    ;
-
-LAST
-    : L A S T
-    ;
-
-DISABLE
-    : D I S A B L E
-    ;
-
-ALIGN
-    : A L I G N
-    ;
-
-COMPRESSION
-    : C O M P R E S S I O N
-    ;
-
-TIME
-    : T I M E
-    ;
-
-ATTRIBUTES
-    : A T T R I B U T E S
-    ;
-
-TAGS
-    : T A G S
-    ;
-
-RENAME
-    : R E N A M E
-    ;
-
-GLOBAL
-  : G L O B A L
-  | G
-  ;
-
-FULL
-    : F U L L
-    ;
-
-CLEAR
-    : C L E A R
-    ;
-
-CACHE
-    : C A C H E
-    ;
-
-TRUE
-    : T R U E
-    ;
-
-FALSE
-    : F A L S E
-    ;
-
-UNCOMPRESSED
-    : U N C O M P R E S S E D
-    ;
-
-SNAPPY
-    : S N A P P Y
-    ;
-
-GZIP
-    : G Z I P
-    ;
-
-LZO
-    : L Z O
-    ;
-
-PAA
-    : P A A
-    ;
-
-PLA
-   : P L A
-   ;
-
-LZ4
-   : L Z '4'
-   ;
-
-LATEST
-    : L A T E S T
-    ;
-
-PARTITION
-    : P A R T I T I O N
-    ;
-
-SNAPSHOT
-    : S N A P S H O T
-    ;
-
-FOR
-    : F O R
-    ;
-
-SCHEMA
-    : S C H E M A
-    ;
-
-AUTOREGISTER
-    : A U T O R E G I S T E R
-    ;
-
-VERIFY
-    : V E R I F Y
-    ;
-
-SGLEVEL
-    : S G L E V E L
-    ;
-
-FUNCTION
-    : F U N C T I O N
-    ;
-
-FUNCTIONS
-    : F U N C T I O N S
-    ;
-
-AS
-    : A S
-    ;
-
-TRIGGER
-    : T R I G G E R
-    ;
-
-TRIGGERS
-    : T R I G G E R S
-    ;
-
-BEFORE
-    : B E F O R E
-    ;
-
-AFTER
-    : A F T E R
-    ;
-
-START
-    : S T A R T
-    ;
-
-STOP
-    : S T O P
-    ;
-
-DESC
-    : D E S C
-    ;
-ASC
-    : A S C
-    ;
-
-TOP
-    : T O P
-    ;
-
-CONTAIN
-    : C O N T A I N
-    ;
-
-CONCAT
-    : C O N C A T
-    ;
-
-LIKE
-    : L I K E
-    ;
-
-REGEXP
-    : R E G E X P
-    ;
-
-TOLERANCE
-    : T O L E R A N C E
-    ;
-
-EXPLAIN
-    : E X P L A I N
-    ;
-
-CONTINUOUS
-    : C O N T I N U O U S
-    ;
-
-QUERIES
-    : Q U E R I E S
-    ;
-
-CQ
-    : C Q
-    ;
-
-CQS
-    : C Q S
-    ;
-
-BEGIN
-    : B E G I N
-    ;
-
-END
-    : E N D
-    ;
-
-RESAMPLE
-    : R E S A M P L E
-    ;
-
-EVERY
-    : E V E R Y
-    ;
-
-DEBUG
-    : D E B U G
-    ;
-
-NULL
-    : N U L L
-    ;
-
-WITHOUT
-    : W I T H O U T
-    ;
-
-ANY
-    : A N Y
-    ;
-
-LOCK
-    : L O C K
-    ;
-
-//============================
-// End of the keywords list
-//============================
-COMMA : ',';
-
-STAR : '*' | '**';
-
-OPERATOR_EQ : '=' | '==';
-
-OPERATOR_GT : '>';
-
-OPERATOR_GTE : '>=';
-
-OPERATOR_LT : '<';
-
-OPERATOR_LTE : '<=';
-
-OPERATOR_NEQ : '!=' | '<>';
-
-OPERATOR_IN : I N;
-
-OPERATOR_AND
-    : A N D
-    | '&'
-    | '&&'
-    ;
-
-OPERATOR_OR
-    : O R
-    | '|'
-    | '||'
-    ;
-
-OPERATOR_NOT
-    : N O T | '!'
-    ;
-
-OPERATOR_CONTAINS
-    : C O N T A I N S
-    ;
-
-MINUS : '-';
-
-PLUS : '+';
-
-DIV : '/';
-
-MOD : '%';
-
-DOT : '.';
-
-LR_BRACKET : '(';
-
-RR_BRACKET : ')';
-
-LS_BRACKET : '[';
-
-RS_BRACKET : ']';
-
-L_BRACKET : '{';
-
-R_BRACKET : '}';
-
-UNDERLINE : '_';
-
-NaN : 'NaN';
-
-stringLiteral
-   : SINGLE_QUOTE_STRING_LITERAL
-   | DOUBLE_QUOTE_STRING_LITERAL
-   ;
-
-pathOrString
-   : prefixPath
-   | stringLiteral
-   ;
-
-INT : [0-9]+;
-
-EXPONENT : INT ('e'|'E') ('+'|'-')? INT ;
-
-DURATION
-    :
-    (INT+ (Y|M O|W|D|H|M|S|M S|U S|N S))+
-    ;
-
-DATETIME
-    : INT ('-'|'/') INT ('-'|'/') INT
-      ((T | WS)
-      INT ':' INT ':' INT (DOT INT)?
-      (('+' | '-') INT ':' INT)?)?
-    ;
-
-/** Allow unicode rule/token names */
-ID : FIRST_NAME_CHAR NAME_CHAR*;
-
-fragment
-NAME_CHAR
-    :   'A'..'Z'
-    |   'a'..'z'
-    |   '0'..'9'
-    |   '_'
-    |   '-'
-    |   ':'
-    |   '/'
-    |   '@'
-    |   '#'
-    |   '$'
-    |   '%'
-    |   '&'
-    |   '+'
-    |   '{'
-    |   '}'
-    |   CN_CHAR
-    ;
-
-fragment
-FIRST_NAME_CHAR
-    :   'A'..'Z'
-    |   'a'..'z'
-    |   '0'..'9'
-    |   '_'
-    |   '/'
-    |   '@'
-    |   '#'
-    |   '$'
-    |   '%'
-    |   '&'
-    |   '+'
-    |   '{'
-    |   '}'
-    |   CN_CHAR
-    ;
-
-fragment CN_CHAR
-  : '\u2E80'..'\u9FFF'
-  ;
-
-DOUBLE_QUOTE_STRING_LITERAL
-    : '"' ('\\' . | ~'"' )*? '"'
-    ;
-
-SINGLE_QUOTE_STRING_LITERAL
-    : '\'' ('\\' . | ~'\'' )*? '\''
-    ;
-
-//Characters and write it this way for case sensitivity
-fragment A
-    : 'a' | 'A'
-    ;
-
-fragment B
-    : 'b' | 'B'
-    ;
-
-fragment C
-    : 'c' | 'C'
-    ;
-
-fragment D
-    : 'd' | 'D'
-    ;
-
-fragment E
-    : 'e' | 'E'
-    ;
-
-fragment F
-    : 'f' | 'F'
-    ;
-
-fragment G
-    : 'g' | 'G'
-    ;
-
-fragment H
-    : 'h' | 'H'
-    ;
-
-fragment I
-    : 'i' | 'I'
-    ;
-
-fragment J
-    : 'j' | 'J'
-    ;
-
-fragment K
-    : 'k' | 'K'
-    ;
-
-fragment L
-    : 'l' | 'L'
-    ;
-
-fragment M
-    : 'm' | 'M'
-    ;
-
-fragment N
-    : 'n' | 'N'
-    ;
-
-fragment O
-    : 'o' | 'O'
-    ;
-
-fragment P
-    : 'p' | 'P'
-    ;
-
-fragment Q
-    : 'q' | 'Q'
-    ;
-
-fragment R
-    : 'r' | 'R'
-    ;
-
-fragment S
-    : 's' | 'S'
-    ;
-
-fragment T
-    : 't' | 'T'
-    ;
-
-fragment U
-    : 'u' | 'U'
-    ;
-
-fragment V
-    : 'v' | 'V'
-    ;
-
-fragment W
-    : 'w' | 'W'
-    ;
-
-fragment X
-    : 'x' | 'X'
-    ;
-
-fragment Y
-    : 'y' | 'Y'
-    ;
-
-fragment Z
-    : 'z' | 'Z'
-    ;
-
-WS
-    : [ \r\n\t]+ -> channel(HIDDEN)
-    ;
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/integration/SingleNodeTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/integration/SingleNodeTest.java
index 690dd48..fefa722 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/integration/SingleNodeTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/integration/SingleNodeTest.java
@@ -107,7 +107,7 @@ public class SingleNodeTest extends BaseSingleNodeTest {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create user user1 \"1234\"");
+      statement.execute("create user user1 '1234'");
       try (Connection connection1 =
               DriverManager.getConnection(
                   Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "user1", "1234");
diff --git a/docs/UserGuide/Administration-Management/Administration.md b/docs/UserGuide/Administration-Management/Administration.md
index 392b6ed..25a0405 100644
--- a/docs/UserGuide/Administration-Management/Administration.md
+++ b/docs/UserGuide/Administration-Management/Administration.md
@@ -91,16 +91,16 @@ Msg: 602: No permissions for this operation INSERT
 Now, we grant the two users write privileges to the corresponding storage groups, and try to write data again. The SQL statement is:
 
 ```
-GRANT USER ln_write_user PRIVILEGES 'INSERT_TIMESERIES' on root.ln
-GRANT USER sgcc_write_user PRIVILEGES 'INSERT_TIMESERIES' on root.sgcc
+GRANT USER ln_write_user PRIVILEGES INSERT_TIMESERIES on root.ln
+GRANT USER sgcc_write_user PRIVILEGES INSERT_TIMESERIES on root.sgcc
 INSERT INTO root.ln.wf01.wt01(timestamp, status) values(1509465600000, true)
 ```
 The execution result is as follows:
 
 ```
-IoTDB> GRANT USER ln_write_user PRIVILEGES 'INSERT_TIMESERIES' on root.ln
+IoTDB> GRANT USER ln_write_user PRIVILEGES INSERT_TIMESERIES on root.ln
 Msg: The statement is executed successfully.
-IoTDB> GRANT USER sgcc_write_user PRIVILEGES 'INSERT_TIMESERIES' on root.sgcc
+IoTDB> GRANT USER sgcc_write_user PRIVILEGES INSERT_TIMESERIES on root.sgcc
 Msg: The statement is executed successfully.
 IoTDB> INSERT INTO root.ln.wf01.wt01(timestamp, status) values(1509465600000, true)
 Msg: The statement is executed successfully.
diff --git a/docs/UserGuide/Advanced-Features/Triggers.md b/docs/UserGuide/Advanced-Features/Triggers.md
index 3dffb17..0dcd98a 100644
--- a/docs/UserGuide/Advanced-Features/Triggers.md
+++ b/docs/UserGuide/Advanced-Features/Triggers.md
@@ -173,10 +173,10 @@ Registering a trigger can be carried out as follows:
    CREATE TRIGGER alert-listener-sg1d1s1
    AFTER INSERT
    ON root.sg1.d1.s1
-   AS "org.apache.iotdb.db.engine.trigger.example.AlertListener"
+   AS 'org.apache.iotdb.db.engine.trigger.example.AlertListener'
    WITH (
-     "lo" = "0", 
-     "hi" = "100.0"
+     'lo' = '0', 
+     'hi' = '100.0'
    )
    ```
 
@@ -833,10 +833,10 @@ You can try this trigger by following the steps below:
   CREATE TRIGGER window-avg-alerter
   AFTER INSERT
   ON root.sg1.d1.s1
-  AS "org.apache.iotdb.trigger.TriggerExample"
+  AS 'org.apache.iotdb.trigger.TriggerExample'
   WITH (
-    "lo" = "0",
-    "hi" = "10.0"
+    'lo' = '0',
+    'hi' = '10.0'
   )
   ```
 
diff --git a/docs/UserGuide/Advanced-Features/UDF-User-Defined-Function.md b/docs/UserGuide/Advanced-Features/UDF-User-Defined-Function.md
index 62f9d51..21bd6cd 100644
--- a/docs/UserGuide/Advanced-Features/UDF-User-Defined-Function.md
+++ b/docs/UserGuide/Advanced-Features/UDF-User-Defined-Function.md
@@ -403,7 +403,7 @@ CREATE FUNCTION <UDF-NAME> AS <UDF-CLASS-FULL-PATHNAME>
 Here is an example:
 
 ```sql
-CREATE FUNCTION example AS "org.apache.iotdb.udf.ExampleUDTF"
+CREATE FUNCTION example AS 'org.apache.iotdb.udf.ExampleUDTF'
 ```
 
 Since UDF instances are dynamically loaded through reflection technology, you do not need to restart the server during the UDF registration process.
@@ -471,8 +471,8 @@ Then the result set will include the results of  `example(root.sg.d1.s1, root.sg
 You can pass any number of key-value pair parameters to the UDF when constructing a UDF query. The key and value in the key-value pair need to be enclosed in single or double quotes. Note that key-value pair parameters can only be passed in after all time series have been passed in. Here is a set of examples:
 
 ``` sql
-SELECT example(s1, "key1"="value1", "key2"="value2"), example(*, "key3"="value3") FROM root.sg.d1;
-SELECT example(s1, s2, "key1"="value1", "key2"="value2") FROM root.sg.d1;
+SELECT example(s1, 'key1'='value1', 'key2'='value2'), example(*, 'key3'='value3') FROM root.sg.d1;
+SELECT example(s1, s2, 'key1'='value1', 'key2'='value2') FROM root.sg.d1;
 ```
 
 
diff --git a/docs/UserGuide/Appendix/SQL-Reference.md b/docs/UserGuide/Appendix/SQL-Reference.md
index 9c1a0b9..5eb35a2 100644
--- a/docs/UserGuide/Appendix/SQL-Reference.md
+++ b/docs/UserGuide/Appendix/SQL-Reference.md
@@ -236,8 +236,8 @@ Note: This statement can be used in IoTDB Client and JDBC.
 * Show Merge Status Statement
 
 ```
-SHOW MERGE
-Eg: IoTDB > SHOW MERGE
+SHOW MERGE INFO
+Eg: IoTDB > SHOW MERGE INFO
 Note: This statement can be used in IoTDB Client and JDBC.
 ```
 
@@ -798,7 +798,7 @@ GRANT USER <userName> PRIVILEGES <privileges> ON <nodeName>;
 userName:=identifier  
 nodeName:=identifier (DOT identifier)*  
 privileges:= string (COMMA string)*
-Eg: IoTDB > GRANT USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root.ln;
+Eg: IoTDB > GRANT USER tempuser PRIVILEGES DELETE_TIMESERIES on root.ln;
 ```
 
 * Grant Role Privileges
@@ -808,7 +808,7 @@ GRANT ROLE <roleName> PRIVILEGES <privileges> ON <nodeName>;
 privileges:= string (COMMA string)*  
 roleName:=identifier  
 nodeName:=identifier (DOT identifier)*
-Eg: IoTDB > GRANT ROLE temprole PRIVILEGES 'DELETE_TIMESERIES' ON root.ln;
+Eg: IoTDB > GRANT ROLE temprole PRIVILEGES DELETE_TIMESERIES ON root.ln;
 ```
 
 * Grant User Role
@@ -827,7 +827,7 @@ REVOKE USER <userName> PRIVILEGES <privileges> ON <nodeName>;
 privileges:= string (COMMA string)*  
 userName:=identifier  
 nodeName:=identifier (DOT identifier)*
-Eg: IoTDB > REVOKE USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root.ln;
+Eg: IoTDB > REVOKE USER tempuser PRIVILEGES DELETE_TIMESERIES on root.ln;
 ```
 
 * Revoke Role Privileges
@@ -837,7 +837,7 @@ REVOKE ROLE <roleName> PRIVILEGES <privileges> ON <nodeName>;
 privileges:= string (COMMA string)*  
 roleName:= identifier  
 nodeName:=identifier (DOT identifier)*
-Eg: IoTDB > REVOKE ROLE temprole PRIVILEGES 'DELETE_TIMESERIES' ON root.ln;
+Eg: IoTDB > REVOKE ROLE temprole PRIVILEGES DELETE_TIMESERIES ON root.ln;
 ```
 
 * Revoke Role From User
@@ -1091,15 +1091,6 @@ This example will delete the first 3 time partitions of storage group root.sg1.
 ```
 The partitionId can be found in data folders or converted using `timestamp / partitionInterval`.
 
-## Performance Tracing
-
-IoTDB supports tracking the execution of query statements by using `TRACING` statements. The number of tsfile files and chunks accessed by the query etc are output through the log file. The default output location is in `./data/tracing`. The performance tracing function is turned off by default. Users can use the TRACING ON/OFF command to turn this function on/off.
-
-```
-TRACING ON    // Open performance tracing
-TRACING OFF   // Close performance tracing
-```
-
 ## Kill query
 
 - Show the list of queries in progress
@@ -1155,8 +1146,7 @@ Boolean := TRUE | FALSE | 0 | 1 (case insensitive)
 ```
 
 ```
-StringLiteral := ( '\'' ( ~('\'') )* '\'' | '\"' ( ~('\"') )* '\"');
-eg. 'abc'
+StringLiteral := ( '\'' ( ~('\'') )* '\'';
 eg. 'abc'
 ```
 
diff --git a/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md b/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
index 06cdc46..8b095e1 100644
--- a/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
+++ b/docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
@@ -36,7 +36,7 @@ In the scenario of this section, take two timeseries `root.ln.wf02.wt02.status`
 The sample code for single column data insertion is as follows:
 ```
 IoTDB > insert into root.ln.wf02.wt02(timestamp,status) values(1,true)
-IoTDB > insert into root.ln.wf02.wt02(timestamp,hardware) values(1, "v1")
+IoTDB > insert into root.ln.wf02.wt02(timestamp,hardware) values(1, 'v1')
 ```
 
 The above example code inserts the long integer timestamp and the value "true" into the timeseries `root.ln.wf02.wt02.status` and inserts the long integer timestamp and the value "v1" into the timeseries `root.ln.wf02.wt02.hardware`. When the execution is successful, cost time is shown to indicate that the data insertion has been completed.
@@ -341,7 +341,7 @@ Currently, IoTDB supports the following string processing functions:
 Example:
 
 ```   sql
-select s1, string_contains(s1, "s"="warn"), string_matches(s1, "regex"="[^\\s]+37229") from root.sg1.d4;
+select s1, string_contains(s1, 's'='warn'), string_matches(s1, 'regex'='[^\\s]+37229') from root.sg1.d4;
 ```
 
 Result:
@@ -370,7 +370,7 @@ Currently, IoTDB supports the following selector functions:
 Example:
 
 ```   sql
-select s1, top_k(s1, "k"="2"), bottom_k(s1, "k"="2") from root.sg1.d2 where time > 2020-12-10T20:36:15.530+08:00;
+select s1, top_k(s1, 'k'='2'), bottom_k(s1, 'k'='2') from root.sg1.d2 where time > 2020-12-10T20:36:15.530+08:00;
 ```
 
 Result:
diff --git a/docs/UserGuide/System-Tools/Load-External-Tsfile.md b/docs/UserGuide/System-Tools/Load-External-Tsfile.md
index 4978330..408d81d 100644
--- a/docs/UserGuide/System-Tools/Load-External-Tsfile.md
+++ b/docs/UserGuide/System-Tools/Load-External-Tsfile.md
@@ -31,7 +31,7 @@ The user sends specified commands to the Apache IoTDB system through the Cli too
 
 #### load tsfiles
 
-The command to load tsfiles is `load "<path/dir>" [autoregister=true/false][,sglevel=int][,verify=true/false]`.
+The command to load tsfiles is `load <path/dir> [autoregister=true/false][,sglevel=int][,verify=true/false]`.
 
 This command has two usages:
 
@@ -49,15 +49,15 @@ If the `.resource` file corresponding to the file exists, it will be loaded into
 
 Examples:
 
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile"`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" autoregister=false`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" autoregister=true`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" sglevel=1`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" verify=true`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" autoregister=true,sglevel=1`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" verify=false,sglevel=1`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" autoregister=false,verify=true`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" autoregister=false,sglevel=1,verify=true`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile'`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' autoregister=false`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' autoregister=true`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' sglevel=1`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' verify=true`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' autoregister=true,sglevel=1`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' verify=false,sglevel=1`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' autoregister=false,verify=true`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' autoregister=false,sglevel=1,verify=true`
 
 2. Load a batch of files by specifying a folder path (absolute path). 
 
@@ -65,11 +65,11 @@ The second parameter indicates the path of the tsfile to be loaded and the name
 
 Examples:
 
-* `load "/Users/Desktop/data"`
-* `load "/Users/Desktop/data" autoregister=false`
-* `load "/Users/Desktop/data" autoregister=true`
-* `load "/Users/Desktop/data" autoregister=true,sglevel=1`
-* `load "/Users/Desktop/data" autoregister=false,sglevel=1,verify=true`
+* `load '/Users/Desktop/data'`
+* `load '/Users/Desktop/data' autoregister=false`
+* `load '/Users/Desktop/data' autoregister=true`
+* `load '/Users/Desktop/data' autoregister=true,sglevel=1`
+* `load '/Users/Desktop/data' autoregister=false,sglevel=1,verify=true`
 
 #### remove a tsfile
 
@@ -79,8 +79,8 @@ This command deletes a tsfile by specifying the file path. The specific implemen
 
 Examples:
 
-* `remove "root.vehicle/1575028885956-101-0.tsfile"` 
-* `remove "1575028885956-101-0.tsfile"`
+* `remove 'root.vehicle/1575028885956-101-0.tsfile'`
+* `remove '1575028885956-101-0.tsfile'`
 
 #### unload a tsfile and move it to a target directory
 
@@ -90,5 +90,5 @@ This command unload a tsfile and move it to a target directory by specifying tsf
 
 Examples:
 
-* `unload "root.vehicle/1575029224130-101-0.tsfile" "/data/data/tmp"`
-* `unload "1575029224130-101-0.tsfile" "/data/data/tmp"`
\ No newline at end of file
+* `unload 'root.vehicle/1575029224130-101-0.tsfile' '/data/data/tmp'`
+* `unload '1575029224130-101-0.tsfile' '/data/data/tmp'`
\ No newline at end of file
diff --git a/docs/UserGuide/System-Tools/Watermark-Tool.md b/docs/UserGuide/System-Tools/Watermark-Tool.md
index 905ee8d..e530435 100644
--- a/docs/UserGuide/System-Tools/Watermark-Tool.md
+++ b/docs/UserGuide/System-Tools/Watermark-Tool.md
@@ -54,7 +54,7 @@ A newly created user doesn't use watermark by default. So the query result is th
 ```
 .\start-cli.bat -u root -pw root
 create user Alice 1234
-grant user Alice privileges 'READ_TIMESERIES' on root.vehicle
+grant user Alice privileges READ_TIMESERIES on root.vehicle
 exit
 
 .\start-cli.bat -u Alice -pw 1234
diff --git a/docs/zh/UserGuide/Administration-Management/Administration.md b/docs/zh/UserGuide/Administration-Management/Administration.md
index 7505463..863682c 100644
--- a/docs/zh/UserGuide/Administration-Management/Administration.md
+++ b/docs/zh/UserGuide/Administration-Management/Administration.md
@@ -96,16 +96,16 @@ Msg: 602: No permissions for this operation INSERT
 
 现在,我们分别赋予他们向对应存储组数据的写入权限,并再次尝试向对应的存储组进行数据写入。SQL 语句为:
 ```
-GRANT USER ln_write_user PRIVILEGES 'INSERT_TIMESERIES' on root.ln
-GRANT USER sgcc_write_user PRIVILEGES 'INSERT_TIMESERIES' on root.sgcc
+GRANT USER ln_write_user PRIVILEGES INSERT_TIMESERIES on root.ln
+GRANT USER sgcc_write_user PRIVILEGES INSERT_TIMESERIES on root.sgcc
 INSERT INTO root.ln.wf01.wt01(timestamp, status) values(1509465600000, true)
 ```
 执行状态如下所示:
 
 ```
-IoTDB> GRANT USER ln_write_user PRIVILEGES 'INSERT_TIMESERIES' on root.ln
+IoTDB> GRANT USER ln_write_user PRIVILEGES INSERT_TIMESERIES on root.ln
 Msg: The statement is executed successfully.
-IoTDB> GRANT USER sgcc_write_user PRIVILEGES 'INSERT_TIMESERIES' on root.sgcc
+IoTDB> GRANT USER sgcc_write_user PRIVILEGES INSERT_TIMESERIES on root.sgcc
 Msg: The statement is executed successfully.
 IoTDB> INSERT INTO root.ln.wf01.wt01(timestamp, status) values(1509465600000, true)
 Msg: The statement is executed successfully.
diff --git a/docs/zh/UserGuide/Advanced-Features/Triggers.md b/docs/zh/UserGuide/Advanced-Features/Triggers.md
index d2a5126..f3df705 100644
--- a/docs/zh/UserGuide/Advanced-Features/Triggers.md
+++ b/docs/zh/UserGuide/Advanced-Features/Triggers.md
@@ -153,10 +153,10 @@ default int[] fire(long[] timestamps, int[] values) throws Exception {
    CREATE TRIGGER alert-listener-sg1d1s1
    AFTER INSERT
    ON root.sg1.d1.s1
-   AS "org.apache.iotdb.db.engine.trigger.example.AlertListener"
+   AS 'org.apache.iotdb.db.engine.trigger.example.AlertListener'
    WITH (
-     "lo" = "0", 
-     "hi" = "100.0"
+     'lo' = '0', 
+     'hi' = '100.0'
    )
    ```
 
@@ -766,10 +766,10 @@ public class TriggerExample implements Trigger {
   CREATE TRIGGER window-avg-alerter
   AFTER INSERT
   ON root.sg1.d1.s1
-  AS "org.apache.iotdb.trigger.TriggerExample"
+  AS 'org.apache.iotdb.trigger.TriggerExample'
   WITH (
-    "lo" = "0", 
-    "hi" = "10.0"
+    'lo' = '0', 
+    'hi' = '10.0'
   )
   ```
 
diff --git a/docs/zh/UserGuide/Advanced-Features/UDF-User-Defined-Function.md b/docs/zh/UserGuide/Advanced-Features/UDF-User-Defined-Function.md
index e710846..1ea763b 100644
--- a/docs/zh/UserGuide/Advanced-Features/UDF-User-Defined-Function.md
+++ b/docs/zh/UserGuide/Advanced-Features/UDF-User-Defined-Function.md
@@ -364,7 +364,7 @@ CREATE FUNCTION <UDF-NAME> AS <UDF-CLASS-FULL-PATHNAME>
 例子中注册 UDF 的 SQL 语句如下:
 
 ```sql
-CREATE FUNCTION example AS "org.apache.iotdb.udf.UDTFExample"
+CREATE FUNCTION example AS 'org.apache.iotdb.udf.UDTFExample'
 ```
 
 由于 IoTDB 的 UDF 是通过反射技术动态装载的,因此您在装载过程中无需启停服务器。
@@ -422,8 +422,8 @@ UDF 的使用方法与普通内建函数的类似。
 您可以在进行 UDF 查询的时候,向 UDF 传入任意数量的键值对参数。键值对中的键和值都需要被单引号或者双引号引起来。注意,键值对参数只能在所有时间序列后传入。下面是一组例子:
 
 ``` sql
-SELECT example(s1, "key1"="value1", "key2"="value2"), example(*, "key3"="value3") FROM root.sg.d1;
-SELECT example(s1, s2, "key1"="value1", "key2"="value2") FROM root.sg.d1;
+SELECT example(s1, 'key1'='value1', 'key2'='value2'), example(*, 'key3'='value3') FROM root.sg.d1;
+SELECT example(s1, s2, 'key1'='value1', 'key2'='value2') FROM root.sg.d1;
 ```
 
 ### 与其他查询的嵌套查询
diff --git a/docs/zh/UserGuide/Appendix/SQL-Reference.md b/docs/zh/UserGuide/Appendix/SQL-Reference.md
index 286b7ea..c130fc5 100644
--- a/docs/zh/UserGuide/Appendix/SQL-Reference.md
+++ b/docs/zh/UserGuide/Appendix/SQL-Reference.md
@@ -226,8 +226,8 @@ Note: This statement can be used in IoTDB Client and JDBC.
 * 显示 Merge 状态语句
 
 ```
-SHOW MERGE
-Eg: IoTDB > SHOW MERGE
+SHOW MERGE INFO
+Eg: IoTDB > SHOW MERGE INFO
 Note: This statement can be used in IoTDB Client and JDBC.
 ```
 
@@ -789,7 +789,7 @@ GRANT USER <userName> PRIVILEGES <privileges> ON <nodeName>;
 userName:=identifier  
 nodeName:=identifier (DOT identifier)*  
 privileges:= string (COMMA string)*
-Eg: IoTDB > GRANT USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root.ln;
+Eg: IoTDB > GRANT USER tempuser PRIVILEGES DELETE_TIMESERIES on root.ln;
 ```
 
 * 赋予角色权限
@@ -799,7 +799,7 @@ GRANT ROLE <roleName> PRIVILEGES <privileges> ON <nodeName>;
 privileges:= string (COMMA string)*  
 roleName:=identifier  
 nodeName:=identifier (DOT identifier)*
-Eg: IoTDB > GRANT ROLE temprole PRIVILEGES 'DELETE_TIMESERIES' ON root.ln;
+Eg: IoTDB > GRANT ROLE temprole PRIVILEGES DELETE_TIMESERIES ON root.ln;
 ```
 
 * 赋予用户角色
@@ -818,7 +818,7 @@ REVOKE USER <userName> PRIVILEGES <privileges> ON <nodeName>;
 privileges:= string (COMMA string)*  
 userName:=identifier  
 nodeName:=identifier (DOT identifier)*
-Eg: IoTDB > REVOKE USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root.ln;
+Eg: IoTDB > REVOKE USER tempuser PRIVILEGES DELETE_TIMESERIES on root.ln;
 ```
 
 * 撤销角色权限
@@ -828,7 +828,7 @@ REVOKE ROLE <roleName> PRIVILEGES <privileges> ON <nodeName>;
 privileges:= string (COMMA string)*  
 roleName:= identifier  
 nodeName:=identifier (DOT identifier)*
-Eg: IoTDB > REVOKE ROLE temprole PRIVILEGES 'DELETE_TIMESERIES' ON root.ln;
+Eg: IoTDB > REVOKE ROLE temprole PRIVILEGES DELETE_TIMESERIES ON root.ln;
 ```
 
 * 撤销用户角色
@@ -1057,15 +1057,6 @@ Eg DELETE PARTITION root.sg1 0,1,2
 ```
 partitionId 可以通过查看数据文件夹获取,或者是计算 `timestamp / partitionInterval`得到。 
 
-## 性能追踪
-
-IoTDB 支持使用 `TRACING` 语句来追踪查询语句的执行,通过日志文件输出该查询访问的 Tsfile 文件数,chunk 数等信息,默认输出位置位于 `./data/tracing`. 性能追踪功能默认处于关闭状态,用户可以使用 TRACING ON/OFF 命令来打开/关闭该功能。
-
-```
-TRACING ON    //打开性能追踪
-TRACING OFF   //关闭性能追踪
-```
-
 ## 中止查询
 
 - 显示正在执行的查询列表
@@ -1121,9 +1112,8 @@ Boolean := TRUE | FALSE | 0 | 1 (case insensitive)
 ```
 
 ```
-StringLiteral := ( '\'' ( ~('\'') )* '\'' | '\"' ( ~('\"') )* '\"');
+StringLiteral := ( '\'' ( ~('\'') )* '\'';
 eg. 'abc'
-eg. "abc"
 ```
 
 ```
diff --git a/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md b/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
index d1444ce..f86af13 100644
--- a/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
+++ b/docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
@@ -37,7 +37,7 @@ IoTDB 为用户提供多种插入实时数据的方式,例如在 [Cli/Shell 
 
 ```sql
 IoTDB > insert into root.ln.wf02.wt02(timestamp,status) values(1,true)
-IoTDB > insert into root.ln.wf02.wt02(timestamp,hardware) values(1, "v1")
+IoTDB > insert into root.ln.wf02.wt02(timestamp,hardware) values(1, 'v1')
 ```
 
 以上示例代码将长整型的 timestamp 以及值为 true 的数据插入到时间序列`root.ln.wf02.wt02.status`中和将长整型的 timestamp 以及值为”v1”的数据插入到时间序列`root.ln.wf02.wt02.hardware`中。执行成功后会返回执行时间,代表数据插入已完成。 
@@ -350,7 +350,7 @@ It costs 0.008s
 例如:
 
 ```   sql
-select s1, string_contains(s1, "s"="warn"), string_matches(s1, "regex"="[^\\s]+37229") from root.sg1.d4;
+select s1, string_contains(s1, 's'='warn'), string_matches(s1, 'regex'='[^\\s]+37229') from root.sg1.d4;
 ```
 
 结果:
@@ -379,7 +379,7 @@ It costs 0.007s
 例如:
 
 ```   sql
-select s1, top_k(s1, "k"="2"), bottom_k(s1, "k"="2") from root.sg1.d2 where time > 2020-12-10T20:36:15.530+08:00;
+select s1, top_k(s1, 'k'='2'), bottom_k(s1, 'k'='2') from root.sg1.d2 where time > 2020-12-10T20:36:15.530+08:00;
 ```
 
 结果:
diff --git a/docs/zh/UserGuide/System-Tools/Load-External-Tsfile.md b/docs/zh/UserGuide/System-Tools/Load-External-Tsfile.md
index ab75512..b0a975f 100644
--- a/docs/zh/UserGuide/System-Tools/Load-External-Tsfile.md
+++ b/docs/zh/UserGuide/System-Tools/Load-External-Tsfile.md
@@ -31,7 +31,7 @@
 
 #### 加载 tsfile 文件
 
-加载 tsfile 文件的指令为:`load "<path/dir>" [autoregister=true/false][,sglevel=int][,verify=true/false]`
+加载 tsfile 文件的指令为:`load <path/dir> [autoregister=true/false][,sglevel=int][,verify=true/false]`
 
 该指令有两种用法:
 
@@ -49,15 +49,15 @@ VERIFY 选项表示是否对载入的 tsfile 中的所有时间序列进行元
 
 示例:
 
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile"`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" autoregister=false`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" autoregister=true`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" sglevel=1`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" verify=true`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" autoregister=true,sglevel=1`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" verify=false,sglevel=1`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" autoregister=false,verify=true`
-* `load "/Users/Desktop/data/1575028885956-101-0.tsfile" autoregister=false,sglevel=1,verify=true`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile'`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' autoregister=false`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' autoregister=true`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' sglevel=1`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' verify=true`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' autoregister=true,sglevel=1`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' verify=false,sglevel=1`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' autoregister=false,verify=true`
+* `load '/Users/Desktop/data/1575028885956-101-0.tsfile' autoregister=false,sglevel=1,verify=true`
 
 
 2. 通过指定文件夹路径(绝对路径)批量加载文件。
@@ -66,11 +66,11 @@ VERIFY 选项表示是否对载入的 tsfile 中的所有时间序列进行元
 
 示例:
 
-* `load "/Users/Desktop/data"`
-* `load "/Users/Desktop/data" autoregister=false`
-* `load "/Users/Desktop/data" autoregister=true`
-* `load "/Users/Desktop/data" autoregister=true,sglevel=1`
-* `load "/Users/Desktop/data" autoregister=false,sglevel=1,verify=true`
+* `load '/Users/Desktop/data'`
+* `load '/Users/Desktop/data' autoregister=false`
+* `load '/Users/Desktop/data' autoregister=true`
+* `load '/Users/Desktop/data' autoregister=true,sglevel=1`
+* `load '/Users/Desktop/data' autoregister=false,sglevel=1,verify=true`
 
 #### 删除 tsfile 文件
 
@@ -80,8 +80,8 @@ VERIFY 选项表示是否对载入的 tsfile 中的所有时间序列进行元
 
 示例:
 
-* `remove "root.vehicle/1575028885956-101-0.tsfile"`
-* `remove "1575028885956-101-0.tsfile"`
+* `remove 'root.vehicle/1575028885956-101-0.tsfile'`
+* `remove '1575028885956-101-0.tsfile'`
 
 #### 卸载 tsfile 文件至指定目录
 
@@ -91,5 +91,5 @@ VERIFY 选项表示是否对载入的 tsfile 中的所有时间序列进行元
 
 示例:
 
-* `unload "root.vehicle/1575029224130-101-0.tsfile" "/data/data/tmp"`
-* `unload "1575029224130-101-0.tsfile" "/data/data/tmp"`
+* `unload 'root.vehicle/1575029224130-101-0.tsfile' '/data/data/tmp'`
+* `unload '1575029224130-101-0.tsfile' '/data/data/tmp'`
diff --git a/docs/zh/UserGuide/System-Tools/Watermark-Tool.md b/docs/zh/UserGuide/System-Tools/Watermark-Tool.md
index 9fb1dd7..b944545 100644
--- a/docs/zh/UserGuide/System-Tools/Watermark-Tool.md
+++ b/docs/zh/UserGuide/System-Tools/Watermark-Tool.md
@@ -54,7 +54,7 @@ IoTDB 默认关闭水印嵌入功能。为了使用这个功能,第一步要
 ```
 .\start-cli.bat -u root -pw root
 create user Alice '1234'
-grant user Alice privileges 'READ_TIMESERIES' on root.vehicle
+grant user Alice privileges READ_TIMESERIES on root.vehicle
 exit
 
 .\start-cli.bat -u Alice -pw 1234
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/constant/FilterConstant.java b/server/src/main/java/org/apache/iotdb/db/qp/constant/FilterConstant.java
index 9c43771..dbc5e57 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/constant/FilterConstant.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/constant/FilterConstant.java
@@ -19,7 +19,7 @@
 
 package org.apache.iotdb.db.qp.constant;
 
-import org.apache.iotdb.db.qp.sql.SqlBaseLexer;
+import org.apache.iotdb.db.qp.sql.IoTDBSqlLexer;
 
 import java.util.EnumMap;
 import java.util.HashMap;
@@ -50,15 +50,15 @@ public class FilterConstant {
   }
 
   static {
-    lexerToFilterType.put(SqlBaseLexer.OPERATOR_EQ, FilterType.EQUAL);
-    lexerToFilterType.put(SqlBaseLexer.OPERATOR_NEQ, FilterType.NOTEQUAL);
-    lexerToFilterType.put(SqlBaseLexer.OPERATOR_LTE, FilterType.LESSTHANOREQUALTO);
-    lexerToFilterType.put(SqlBaseLexer.OPERATOR_LT, FilterType.LESSTHAN);
-    lexerToFilterType.put(SqlBaseLexer.OPERATOR_GTE, FilterType.GREATERTHANOREQUALTO);
-    lexerToFilterType.put(SqlBaseLexer.OPERATOR_GT, FilterType.GREATERTHAN);
-    lexerToFilterType.put(SqlBaseLexer.OPERATOR_IN, FilterType.IN);
-    lexerToFilterType.put(SqlBaseLexer.REGEXP, FilterType.REGEXP);
-    lexerToFilterType.put(SqlBaseLexer.LIKE, FilterType.LIKE);
+    lexerToFilterType.put(IoTDBSqlLexer.OPERATOR_EQ, FilterType.EQUAL);
+    lexerToFilterType.put(IoTDBSqlLexer.OPERATOR_NEQ, FilterType.NOTEQUAL);
+    lexerToFilterType.put(IoTDBSqlLexer.OPERATOR_LTE, FilterType.LESSTHANOREQUALTO);
+    lexerToFilterType.put(IoTDBSqlLexer.OPERATOR_LT, FilterType.LESSTHAN);
+    lexerToFilterType.put(IoTDBSqlLexer.OPERATOR_GTE, FilterType.GREATERTHANOREQUALTO);
+    lexerToFilterType.put(IoTDBSqlLexer.OPERATOR_GT, FilterType.GREATERTHAN);
+    lexerToFilterType.put(IoTDBSqlLexer.OPERATOR_IN, FilterType.IN);
+    lexerToFilterType.put(IoTDBSqlLexer.REGEXP, FilterType.REGEXP);
+    lexerToFilterType.put(IoTDBSqlLexer.LIKE, FilterType.LIKE);
   }
 
   static {
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
index 8076e9b..9aad5bf 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
@@ -321,8 +321,6 @@ public class PlanExecutor implements IPlanExecutor {
       case FULL_MERGE:
         operateMerge((MergePlan) plan);
         return true;
-      case TRACING:
-        throw new QueryProcessException("TRACING ON/OFF hasn't been supported yet");
       case SET_SYSTEM_MODE:
         operateSetSystemMode((SetSystemModePlan) plan);
         return true;
@@ -354,10 +352,6 @@ public class PlanExecutor implements IPlanExecutor {
         return operateStartTrigger((StartTriggerPlan) plan);
       case STOP_TRIGGER:
         return operateStopTrigger((StopTriggerPlan) plan);
-      case CREATE_INDEX:
-        throw new QueryProcessException("Create index hasn't been supported yet");
-      case DROP_INDEX:
-        throw new QueryProcessException("Drop index hasn't been supported yet");
       case KILL:
         try {
           operateKillQuery((KillQueryPlan) plan);
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java b/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
index e12caa1..21a39b5 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
@@ -21,10 +21,8 @@ package org.apache.iotdb.db.qp.sql;
 import org.apache.iotdb.db.conf.IoTDBConstant;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.engine.trigger.executor.TriggerEvent;
-import org.apache.iotdb.db.exception.index.UnsupportedIndexTypeException;
 import org.apache.iotdb.db.exception.runtime.SQLParserException;
 import org.apache.iotdb.db.index.common.IndexType;
-import org.apache.iotdb.db.index.common.IndexUtils;
 import org.apache.iotdb.db.metadata.PartialPath;
 import org.apache.iotdb.db.qp.constant.FilterConstant;
 import org.apache.iotdb.db.qp.constant.FilterConstant.FilterType;
@@ -52,199 +50,10 @@ import org.apache.iotdb.db.qp.logical.crud.SelectIntoOperator;
 import org.apache.iotdb.db.qp.logical.crud.SpecialClauseComponent;
 import org.apache.iotdb.db.qp.logical.crud.UDFQueryOperator;
 import org.apache.iotdb.db.qp.logical.crud.WhereComponent;
-import org.apache.iotdb.db.qp.logical.sys.AlterTimeSeriesOperator;
+import org.apache.iotdb.db.qp.logical.sys.*;
 import org.apache.iotdb.db.qp.logical.sys.AlterTimeSeriesOperator.AlterType;
-import org.apache.iotdb.db.qp.logical.sys.AuthorOperator;
 import org.apache.iotdb.db.qp.logical.sys.AuthorOperator.AuthorType;
-import org.apache.iotdb.db.qp.logical.sys.ClearCacheOperator;
-import org.apache.iotdb.db.qp.logical.sys.CountOperator;
-import org.apache.iotdb.db.qp.logical.sys.CreateContinuousQueryOperator;
-import org.apache.iotdb.db.qp.logical.sys.CreateFunctionOperator;
-import org.apache.iotdb.db.qp.logical.sys.CreateIndexOperator;
-import org.apache.iotdb.db.qp.logical.sys.CreateSnapshotOperator;
-import org.apache.iotdb.db.qp.logical.sys.CreateTimeSeriesOperator;
-import org.apache.iotdb.db.qp.logical.sys.CreateTriggerOperator;
-import org.apache.iotdb.db.qp.logical.sys.DataAuthOperator;
-import org.apache.iotdb.db.qp.logical.sys.DeletePartitionOperator;
-import org.apache.iotdb.db.qp.logical.sys.DeleteStorageGroupOperator;
-import org.apache.iotdb.db.qp.logical.sys.DeleteTimeSeriesOperator;
-import org.apache.iotdb.db.qp.logical.sys.DropContinuousQueryOperator;
-import org.apache.iotdb.db.qp.logical.sys.DropFunctionOperator;
-import org.apache.iotdb.db.qp.logical.sys.DropIndexOperator;
-import org.apache.iotdb.db.qp.logical.sys.DropTriggerOperator;
-import org.apache.iotdb.db.qp.logical.sys.FlushOperator;
-import org.apache.iotdb.db.qp.logical.sys.KillQueryOperator;
-import org.apache.iotdb.db.qp.logical.sys.LoadConfigurationOperator;
 import org.apache.iotdb.db.qp.logical.sys.LoadConfigurationOperator.LoadConfigurationOperatorType;
-import org.apache.iotdb.db.qp.logical.sys.LoadDataOperator;
-import org.apache.iotdb.db.qp.logical.sys.LoadFilesOperator;
-import org.apache.iotdb.db.qp.logical.sys.MergeOperator;
-import org.apache.iotdb.db.qp.logical.sys.RemoveFileOperator;
-import org.apache.iotdb.db.qp.logical.sys.SetStorageGroupOperator;
-import org.apache.iotdb.db.qp.logical.sys.SetSystemModeOperator;
-import org.apache.iotdb.db.qp.logical.sys.SetTTLOperator;
-import org.apache.iotdb.db.qp.logical.sys.SettleOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowChildNodesOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowChildPathsOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowContinuousQueriesOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowDevicesOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowFunctionsOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowLockInfoOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowMergeStatusOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowStorageGroupOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowTTLOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowTimeSeriesOperator;
-import org.apache.iotdb.db.qp.logical.sys.ShowTriggersOperator;
-import org.apache.iotdb.db.qp.logical.sys.StartTriggerOperator;
-import org.apache.iotdb.db.qp.logical.sys.StopTriggerOperator;
-import org.apache.iotdb.db.qp.logical.sys.TracingOperator;
-import org.apache.iotdb.db.qp.logical.sys.UnSetTTLOperator;
-import org.apache.iotdb.db.qp.logical.sys.UnloadFileOperator;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.AliasClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.AlignByDeviceClauseOrDisableAlignContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.AlignByDeviceClauseOrDisableAlignStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.AlterClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.AlterTimeseriesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.AlterUserContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.AndExpressionContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.AttributeClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.AttributeClausesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ClearcacheContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ConstantContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CountDevicesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CountNodesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CountStorageGroupContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CountTimeseriesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CqGroupByTimeClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CqSelectIntoClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CreateContinuousQueryStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CreateFunctionContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CreateIndexContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CreateRoleContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CreateSnapshotContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CreateStorageGroupContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CreateTimeseriesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CreateTriggerContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.CreateUserContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DateExpressionContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DeletePartitionContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DeleteStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DeleteStorageGroupContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DeleteTimeseriesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DropContinuousQueryStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DropFunctionContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DropIndexContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DropRoleContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DropTriggerContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.DropUserContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ExpressionContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.FillClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.FillStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.FlushContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.FromClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.FullMergeContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.FullPathContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.FunctionAttributeContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.GrantRoleContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.GrantRoleToUserContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.GrantUserContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.GrantWatermarkEmbeddingContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.GroupByFillClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.GroupByFillStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.GroupByLevelClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.GroupByLevelStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.GroupByTimeClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.GroupByTimeStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.InClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.IndexPredicateClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.IndexWithClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.InsertColumnsSpecContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.InsertMultiValueContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.InsertStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.InsertValuesSpecContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.IntoPathContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.KillQueryContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.LimitClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.LimitStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ListAllRoleOfUserContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ListAllUserOfRoleContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ListPrivilegesRoleContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ListPrivilegesUserContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ListRoleContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ListRolePrivilegesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ListUserContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ListUserPrivilegesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.LoadConfigurationStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.LoadFilesClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.LoadFilesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.LoadStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.MeasurementNameContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.MeasurementValueContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.MergeContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.NodeNameContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.NodeNameWithoutStarContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.OffsetClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.OrExpressionContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.OrderByTimeClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.OrderByTimeStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.PredicateContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.PrefixPathContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.PrivilegesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.PropertyContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.PropertyValueContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.RemoveFileContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ResampleClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ResultColumnContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.RevokeRoleContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.RevokeRoleFromUserContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.RevokeUserContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.RevokeWatermarkEmbeddingContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.RootOrIdContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SelectClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SelectStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SequenceClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SetStorageGroupContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SetSystemToReadOnlyContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SetSystemToWritableContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SetTTLStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowAllTTLStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowChildNodesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowChildPathsContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowContinuousQueriesStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowDevicesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowFlushTaskInfoContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowFunctionsContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowLockInfoContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowMergeStatusContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowQueryProcesslistContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowStorageGroupContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowTTLStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowTimeseriesContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowTriggersContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowVersionContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.ShowWhereClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SingleStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SlimitClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SlimitStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SoffsetClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SpecialLimitStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.StartTriggerContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.StopTriggerContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.StringLiteralContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.SuffixPathContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.TagClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.TimeIntervalContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.TopClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.TracingOffContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.TracingOnContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.TriggerAttributeContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.TypeClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.UnloadFileContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.UnsetTTLStatementContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.WhereClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.WithoutNullClauseContext;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser.WithoutNullStatementContext;
 import org.apache.iotdb.db.qp.utils.DatetimeUtils;
 import org.apache.iotdb.db.query.executor.fill.IFill;
 import org.apache.iotdb.db.query.executor.fill.LinearFill;
@@ -272,16 +81,7 @@ import org.antlr.v4.runtime.tree.TerminalNode;
 
 import java.io.File;
 import java.time.ZoneId;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -291,7 +91,7 @@ import static org.apache.iotdb.db.index.common.IndexConstant.TOP_K;
 import static org.apache.iotdb.db.qp.constant.SQLConstant.TIME_PATH;
 import static org.apache.iotdb.db.qp.constant.SQLConstant.TOK_KILL_QUERY;
 
-public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
+public class IoTDBSqlVisitor extends IoTDBSqlParserBaseVisitor<Operator> {
 
   private static final String DELETE_RANGE_ERROR_MSG =
       "For delete statement, where clause can only contain atomic expressions like : "
@@ -312,8 +112,9 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     this.zoneId = zoneId;
   }
 
+  /** 1. Top Level Description */
   @Override
-  public Operator visitSingleStatement(SingleStatementContext ctx) {
+  public Operator visitSingleStatement(IoTDBSqlParser.SingleStatementContext ctx) {
     Operator operator = visit(ctx.statement());
     if (ctx.DEBUG() != null) {
       operator.setDebug(true);
@@ -321,72 +122,21 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     return operator;
   }
 
-  @Override
-  public Operator visitCreateTimeseries(CreateTimeseriesContext ctx) {
-    CreateTimeSeriesOperator createTimeSeriesOperator =
-        new CreateTimeSeriesOperator(SQLConstant.TOK_METADATA_CREATE);
-    createTimeSeriesOperator.setPath(parseFullPath(ctx.fullPath()));
-    if (ctx.alias() != null) {
-      createTimeSeriesOperator.setAlias(ctx.alias().ID().getText());
-    }
-    if (ctx.attributeClauses() != null) {
-      parseAttributeClauses(ctx.attributeClauses(), createTimeSeriesOperator);
-    }
-    return createTimeSeriesOperator;
-  }
-
-  @Override
-  public Operator visitDeleteTimeseries(DeleteTimeseriesContext ctx) {
-    List<PartialPath> deletePaths = new ArrayList<>();
-    List<PrefixPathContext> prefixPaths = ctx.prefixPath();
-    for (PrefixPathContext prefixPath : prefixPaths) {
-      deletePaths.add(parsePrefixPath(prefixPath));
-    }
-    DeleteTimeSeriesOperator deleteTimeSeriesOperator =
-        new DeleteTimeSeriesOperator(SQLConstant.TOK_METADATA_DELETE);
-    deleteTimeSeriesOperator.setDeletePathList(deletePaths);
-    return deleteTimeSeriesOperator;
-  }
-
-  @Override
-  public Operator visitAlterTimeseries(AlterTimeseriesContext ctx) {
-    AlterTimeSeriesOperator alterTimeSeriesOperator =
-        new AlterTimeSeriesOperator(SQLConstant.TOK_METADATA_ALTER);
-    alterTimeSeriesOperator.setPath(parseFullPath(ctx.fullPath()));
-    parseAlterClause(ctx.alterClause(), alterTimeSeriesOperator);
-    return alterTimeSeriesOperator;
-  }
+  /** 2. Data Definition Language (DDL) */
 
-  @Override
-  public Operator visitInsertStatement(InsertStatementContext ctx) {
-    InsertOperator insertOp = new InsertOperator(SQLConstant.TOK_INSERT);
-    insertOp.setDevice(parsePrefixPath(ctx.prefixPath()));
-    parseInsertColumnSpec(ctx.insertColumnsSpec(), insertOp);
-    parseInsertValuesSpec(ctx.insertValuesSpec(), insertOp);
-    return insertOp;
-  }
+  // Create Storage Group
 
   @Override
-  public Operator visitDeleteStatement(DeleteStatementContext ctx) {
-    DeleteDataOperator deleteDataOp = new DeleteDataOperator(SQLConstant.TOK_DELETE);
-    List<PrefixPathContext> prefixPaths = ctx.prefixPath();
-    for (PrefixPathContext prefixPath : prefixPaths) {
-      deleteDataOp.addPath(parsePrefixPath(prefixPath));
-    }
-    if (ctx.whereClause() != null) {
-      WhereComponent whereComponent = parseWhereClause(ctx.whereClause());
-      Pair<Long, Long> timeInterval = parseDeleteTimeInterval(whereComponent.getFilterOperator());
-      deleteDataOp.setStartTime(timeInterval.left);
-      deleteDataOp.setEndTime(timeInterval.right);
-    } else {
-      deleteDataOp.setStartTime(Long.MIN_VALUE);
-      deleteDataOp.setEndTime(Long.MAX_VALUE);
-    }
-    return deleteDataOp;
+  public Operator visitSetStorageGroup(IoTDBSqlParser.SetStorageGroupContext ctx) {
+    SetStorageGroupOperator setStorageGroupOperator =
+        new SetStorageGroupOperator(SQLConstant.TOK_METADATA_SET_FILE_LEVEL);
+    PartialPath path = parsePrefixPath(ctx.prefixPath());
+    setStorageGroupOperator.setPath(path);
+    return setStorageGroupOperator;
   }
 
   @Override
-  public Operator visitSetStorageGroup(SetStorageGroupContext ctx) {
+  public Operator visitCreateStorageGroup(IoTDBSqlParser.CreateStorageGroupContext ctx) {
     SetStorageGroupOperator setStorageGroupOperator =
         new SetStorageGroupOperator(SQLConstant.TOK_METADATA_SET_FILE_LEVEL);
     PartialPath path = parsePrefixPath(ctx.prefixPath());
@@ -394,88 +144,76 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     return setStorageGroupOperator;
   }
 
-  @Override
-  public Operator visitDeleteStorageGroup(DeleteStorageGroupContext ctx) {
-    List<PartialPath> deletePaths = new ArrayList<>();
-    List<PrefixPathContext> prefixPaths = ctx.prefixPath();
-    for (PrefixPathContext prefixPath : prefixPaths) {
-      deletePaths.add(parsePrefixPath(prefixPath));
-    }
-    DeleteStorageGroupOperator deleteStorageGroupOperator =
-        new DeleteStorageGroupOperator(SQLConstant.TOK_METADATA_DELETE_FILE_LEVEL);
-    deleteStorageGroupOperator.setDeletePathList(deletePaths);
-    return deleteStorageGroupOperator;
-  }
+  // Create Timeseries
 
   @Override
-  public Operator visitCreateIndex(CreateIndexContext ctx) {
-    CreateIndexOperator createIndexOp = new CreateIndexOperator(SQLConstant.TOK_CREATE_INDEX);
-    List<PrefixPathContext> prefixPaths = Collections.singletonList(ctx.prefixPath());
-    for (PrefixPathContext prefixPath : prefixPaths) {
-      createIndexOp.addPath(parsePrefixPath(prefixPath));
+  public Operator visitCreateTimeseries(IoTDBSqlParser.CreateTimeseriesContext ctx) {
+    CreateTimeSeriesOperator createTimeSeriesOperator =
+        new CreateTimeSeriesOperator(SQLConstant.TOK_METADATA_CREATE);
+    createTimeSeriesOperator.setPath(parseFullPath(ctx.fullPath()));
+    if (ctx.alias() != null) {
+      createTimeSeriesOperator.setAlias(ctx.alias().ID().getText());
     }
-    parseIndexWithClause(ctx.indexWithClause(), createIndexOp);
-    if (ctx.whereClause() != null) {
-      FilterOperator filterOp = parseWhereClause(ctx.whereClause()).getFilterOperator();
-      long indexTime = parseCreateIndexFilter(filterOp);
-      createIndexOp.setTime(indexTime);
+    if (ctx.attributeClauses() != null) {
+      parseAttributeClauses(ctx.attributeClauses(), createTimeSeriesOperator);
     }
-    return createIndexOp;
+    return createTimeSeriesOperator;
   }
 
-  /** for create index command, time should only have an end time. */
-  private long parseCreateIndexFilter(FilterOperator filterOperator) {
-    if (filterOperator.getFilterType() != FilterType.GREATERTHAN
-        && filterOperator.getFilterType() != FilterType.GREATERTHANOREQUALTO) {
-      throw new SQLParserException(
-          "For create index command, where clause must be like : time > XXX or time >= XXX");
-    }
-    long time = Long.parseLong(((BasicFunctionOperator) filterOperator).getValue());
-    if (filterOperator.getFilterType() == FilterType.LESSTHAN) {
-      time = time - 1;
+  public void parseAttributeClauses(
+      IoTDBSqlParser.AttributeClausesContext ctx,
+      CreateTimeSeriesOperator createTimeSeriesOperator) {
+    final String dataType = ctx.dataType.getText().toUpperCase();
+    final TSDataType tsDataType = TSDataType.valueOf(dataType);
+    createTimeSeriesOperator.setDataType(tsDataType);
+
+    final IoTDBDescriptor ioTDBDescriptor = IoTDBDescriptor.getInstance();
+    TSEncoding encoding = ioTDBDescriptor.getDefaultEncodingByType(tsDataType);
+    if (Objects.nonNull(ctx.encoding)) {
+      String encodingString = ctx.encoding.getText().toUpperCase();
+      encoding = TSEncoding.valueOf(encodingString);
     }
-    return time;
-  }
+    createTimeSeriesOperator.setEncoding(encoding);
 
-  public void parseIndexWithClause(IndexWithClauseContext ctx, CreateIndexOperator createIndexOp) {
-    IndexType indexType;
-    try {
-      indexType = IndexType.getIndexType(ctx.indexName.getText());
-    } catch (UnsupportedIndexTypeException e) {
-      throw new SQLParserException(ctx.indexName.getText());
-    }
-
-    List<PropertyContext> properties = ctx.property();
-    Map<String, String> props = new HashMap<>(properties.size(), 1);
-    if (ctx.property(0) != null) {
-      for (PropertyContext property : properties) {
-        String k = property.ID().getText().toUpperCase();
-        String v = property.propertyValue().getText().toUpperCase();
-        v = IndexUtils.removeQuotation(v);
-        props.put(k, v);
+    CompressionType compressor;
+    List<IoTDBSqlParser.PropertyClauseContext> properties = ctx.propertyClause();
+    if (ctx.compressor != null) {
+      compressor = CompressionType.valueOf(ctx.compressor.getText().toUpperCase());
+    } else {
+      compressor = TSFileDescriptor.getInstance().getConfig().getCompressor();
+    }
+    Map<String, String> props = null;
+    if (ctx.propertyClause(0) != null) {
+      props = new HashMap<>(properties.size());
+      for (IoTDBSqlParser.PropertyClauseContext property : properties) {
+        props.put(
+            property.ID().getText().toLowerCase(),
+            property.propertyValue().getText().toLowerCase());
       }
     }
-    createIndexOp.setIndexType(indexType);
-    createIndexOp.setProps(props);
+    createTimeSeriesOperator.setCompressor(compressor);
+    createTimeSeriesOperator.setProps(props);
+    if (ctx.tagClause() != null) {
+      parseTagClause(ctx.tagClause(), createTimeSeriesOperator);
+    }
+    if (ctx.attributeClause() != null) {
+      parseAttributeClause(ctx.attributeClause(), createTimeSeriesOperator);
+    }
   }
 
-  @Override
-  public Operator visitDropIndex(DropIndexContext ctx) {
-    DropIndexOperator dropIndexOperator = new DropIndexOperator(SQLConstant.TOK_DROP_INDEX);
-    List<PrefixPathContext> prefixPaths = Collections.singletonList(ctx.prefixPath());
-    for (PrefixPathContext prefixPath : prefixPaths) {
-      dropIndexOperator.addPath(parsePrefixPath(prefixPath));
-    }
-    try {
-      dropIndexOperator.setIndexType(IndexType.getIndexType(ctx.indexName.getText()));
-    } catch (UnsupportedIndexTypeException e) {
-      throw new SQLParserException(ctx.indexName.getText());
+  public void parseAttributeClause(IoTDBSqlParser.AttributeClauseContext ctx, Operator operator) {
+    Map<String, String> attributes = extractMap(ctx.propertyClause(), ctx.propertyClause(0));
+    if (operator instanceof CreateTimeSeriesOperator) {
+      ((CreateTimeSeriesOperator) operator).setAttributes(attributes);
+    } else if (operator instanceof AlterTimeSeriesOperator) {
+      ((AlterTimeSeriesOperator) operator).setAttributesMap(attributes);
     }
-    return dropIndexOperator;
   }
 
+  // Create Function
+
   @Override
-  public Operator visitCreateFunction(CreateFunctionContext ctx) {
+  public Operator visitCreateFunction(IoTDBSqlParser.CreateFunctionContext ctx) {
     CreateFunctionOperator createFunctionOperator =
         new CreateFunctionOperator(SQLConstant.TOK_FUNCTION_CREATE);
     createFunctionOperator.setUdfName(ctx.udfName.getText());
@@ -483,21 +221,10 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     return createFunctionOperator;
   }
 
-  @Override
-  public Operator visitDropFunction(DropFunctionContext ctx) {
-    DropFunctionOperator dropFunctionOperator =
-        new DropFunctionOperator(SQLConstant.TOK_FUNCTION_DROP);
-    dropFunctionOperator.setUdfName(ctx.udfName.getText());
-    return dropFunctionOperator;
-  }
-
-  @Override
-  public Operator visitShowFunctions(ShowFunctionsContext ctx) {
-    return new ShowFunctionsOperator(SQLConstant.TOK_SHOW_FUNCTIONS);
-  }
+  // Create Trigger
 
   @Override
-  public Operator visitCreateTrigger(CreateTriggerContext ctx) {
+  public Operator visitCreateTrigger(IoTDBSqlParser.CreateTriggerContext ctx) {
     CreateTriggerOperator createTriggerOperator =
         new CreateTriggerOperator(SQLConstant.TOK_TRIGGER_CREATE);
     createTriggerOperator.setTriggerName(ctx.triggerName.getText());
@@ -508,7 +235,7 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     createTriggerOperator.setFullPath(parseFullPath(ctx.fullPath()));
     createTriggerOperator.setClassName(removeStringQuote(ctx.className.getText()));
     if (ctx.triggerAttributeClause() != null) {
-      for (TriggerAttributeContext triggerAttributeContext :
+      for (IoTDBSqlParser.TriggerAttributeContext triggerAttributeContext :
           ctx.triggerAttributeClause().triggerAttribute()) {
         createTriggerOperator.addAttribute(
             removeStringQuote(triggerAttributeContext.key.getText()),
@@ -518,328 +245,361 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     return createTriggerOperator;
   }
 
-  @Override
-  public Operator visitDropTrigger(DropTriggerContext ctx) {
-    DropTriggerOperator dropTriggerOperator = new DropTriggerOperator(SQLConstant.TOK_TRIGGER_DROP);
-    dropTriggerOperator.setTriggerName(ctx.triggerName.getText());
-    return dropTriggerOperator;
-  }
+  // Create Continuous Query
 
   @Override
-  public Operator visitStartTrigger(StartTriggerContext ctx) {
-    StartTriggerOperator startTriggerOperator =
-        new StartTriggerOperator(SQLConstant.TOK_TRIGGER_START);
-    startTriggerOperator.setTriggerName(ctx.triggerName.getText());
-    return startTriggerOperator;
-  }
+  public Operator visitCreateContinuousQuery(IoTDBSqlParser.CreateContinuousQueryContext ctx) {
+    CreateContinuousQueryOperator createContinuousQueryOperator =
+        new CreateContinuousQueryOperator(SQLConstant.TOK_CONTINUOUS_QUERY_CREATE);
 
-  @Override
-  public Operator visitStopTrigger(StopTriggerContext ctx) {
-    StopTriggerOperator stopTriggerOperator = new StopTriggerOperator(SQLConstant.TOK_TRIGGER_STOP);
-    stopTriggerOperator.setTriggerName(ctx.triggerName.getText());
-    return stopTriggerOperator;
-  }
+    createContinuousQueryOperator.setQuerySql(ctx.getText());
 
-  @Override
-  public Operator visitShowTriggers(ShowTriggersContext ctx) {
-    return new ShowTriggersOperator(SQLConstant.TOK_SHOW_TRIGGERS);
-  }
+    createContinuousQueryOperator.setContinuousQueryName(ctx.continuousQueryName.getText());
 
-  @Override
-  public Operator visitMerge(MergeContext ctx) {
-    return new MergeOperator(SQLConstant.TOK_MERGE);
-  }
+    if (ctx.resampleClause() != null) {
+      parseResampleClause(ctx.resampleClause(), createContinuousQueryOperator);
+    }
 
-  @Override
-  public Operator visitFlush(FlushContext ctx) {
-    FlushOperator flushOperator = new FlushOperator(SQLConstant.TOK_FLUSH);
-    if (ctx.booleanClause() != null) {
-      flushOperator.setSeq(Boolean.parseBoolean(ctx.booleanClause().getText()));
+    parseCqSelectIntoClause(ctx.cqSelectIntoClause(), createContinuousQueryOperator);
+
+    StringBuilder sb = new StringBuilder();
+    sb.append("select ");
+    sb.append(ctx.cqSelectIntoClause().selectClause().getText().substring(6));
+    sb.append(" from ");
+    sb.append(ctx.cqSelectIntoClause().fromClause().prefixPath(0).getText());
+
+    sb.append(" group by ([now() - ");
+    String groupByInterval =
+        ctx.cqSelectIntoClause().cqGroupByTimeClause().DURATION_LITERAL().getText();
+    if (createContinuousQueryOperator.getForInterval() == 0) {
+      sb.append(groupByInterval);
+    } else {
+      List<TerminalNode> durations = ctx.resampleClause().DURATION_LITERAL();
+      sb.append(durations.get(durations.size() - 1).getText());
     }
-    if (ctx.prefixPath(0) != null) {
-      List<PartialPath> storageGroups = new ArrayList<>();
-      for (PrefixPathContext prefixPathContext : ctx.prefixPath()) {
-        storageGroups.add(parsePrefixPath(prefixPathContext));
+    sb.append(", now()), ");
+    sb.append(groupByInterval);
+    sb.append(")");
+    if (queryOp.isGroupByLevel()) {
+      sb.append(", level = ");
+      int[] levels = queryOp.getSpecialClauseComponent().getLevels();
+      sb.append(levels[0]);
+      for (int i = 1; i < levels.length; i++) {
+        sb.append(String.format(", %d", levels[i]));
       }
-      flushOperator.setStorageGroupList(storageGroups);
     }
-    return flushOperator;
-  }
+    createContinuousQueryOperator.setQuerySql(sb.toString());
 
-  @Override
-  public Operator visitSettle(SqlBaseParser.SettleContext ctx) {
-    SettleOperator settleOperator = new SettleOperator(SQLConstant.TOK_SETTLE);
-    if (ctx.pathOrString().prefixPath() != null) {
-      PartialPath sgPath = parsePrefixPath(ctx.pathOrString().prefixPath());
-      settleOperator.setSgPath(sgPath);
-      settleOperator.setIsSgPath(true);
-    } else if (!ctx.pathOrString().stringLiteral().getText().equals("")) {
-      String tsFilePath = removeStringQuote(ctx.pathOrString().stringLiteral().getText());
-      settleOperator.setTsFilePath(tsFilePath);
-      settleOperator.setIsSgPath(false);
-    } else {
-      // do nothing
+    if (createContinuousQueryOperator.getEveryInterval() == 0) {
+      createContinuousQueryOperator.setEveryInterval(
+          ((GroupByClauseComponent) queryOp.getSpecialClauseComponent()).getUnit());
     }
 
-    return settleOperator;
-  }
+    if (createContinuousQueryOperator.getEveryInterval()
+        < IoTDBDescriptor.getInstance().getConfig().getContinuousQueryMinimumEveryInterval()) {
+      throw new SQLParserException(
+          "CQ: every interval should not be lower than the minimum value you configured.");
+    }
 
-  @Override
-  public Operator visitFullMerge(FullMergeContext ctx) {
-    return new MergeOperator(SQLConstant.TOK_FULL_MERGE);
-  }
+    if (createContinuousQueryOperator.getForInterval() == 0) {
+      createContinuousQueryOperator.setForInterval(
+          ((GroupByClauseComponent) queryOp.getSpecialClauseComponent()).getUnit());
+    }
 
-  @Override
-  public Operator visitClearcache(ClearcacheContext ctx) {
-    return new ClearCacheOperator(SQLConstant.TOK_CLEAR_CACHE);
+    return createContinuousQueryOperator;
   }
 
-  @Override
-  public Operator visitCreateUser(CreateUserContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(SQLConstant.TOK_AUTHOR_CREATE, AuthorOperator.AuthorType.CREATE_USER);
-    authorOperator.setUserName(ctx.ID().getText());
-    authorOperator.setPassWord(removeStringQuote(ctx.password.getText()));
-    return authorOperator;
-  }
+  public void parseCqSelectIntoClause(
+      IoTDBSqlParser.CqSelectIntoClauseContext ctx,
+      CreateContinuousQueryOperator createContinuousQueryOperator) {
 
-  @Override
-  public Operator visitAlterUser(AlterUserContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(
-            SQLConstant.TOK_AUTHOR_UPDATE_USER, AuthorOperator.AuthorType.UPDATE_USER);
-    if (ctx.ID() != null) {
-      authorOperator.setUserName(ctx.ID().getText());
-    } else {
-      authorOperator.setUserName(ctx.ROOT().getText());
-    }
-    authorOperator.setNewPassword(removeStringQuote(ctx.password.getText()));
-    return authorOperator;
-  }
+    queryOp = new GroupByQueryOperator();
 
-  @Override
-  public Operator visitDropUser(DropUserContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(SQLConstant.TOK_AUTHOR_DROP, AuthorOperator.AuthorType.DROP_USER);
-    authorOperator.setUserName(ctx.ID().getText());
-    return authorOperator;
-  }
+    parseSelectClause(ctx.selectClause());
+    parseFromClause(ctx.fromClause());
 
-  @Override
-  public Operator visitCreateRole(CreateRoleContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(SQLConstant.TOK_AUTHOR_CREATE, AuthorOperator.AuthorType.CREATE_ROLE);
-    authorOperator.setRoleName(ctx.ID().getText());
-    return authorOperator;
-  }
+    if (queryOp.getSelectComponent().getResultColumns().size() > 1) {
+      throw new SQLParserException("CQ: CQ currently does not support multiple result columns.");
+    }
 
-  @Override
-  public Operator visitDropRole(DropRoleContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(SQLConstant.TOK_AUTHOR_DROP, AuthorOperator.AuthorType.DROP_ROLE);
-    authorOperator.setRoleName(ctx.ID().getText());
-    return authorOperator;
-  }
+    if (queryOp.getFromComponent().getPrefixPaths().size() > 1) {
+      throw new SQLParserException("CQ: CQ currently does not support multiple series.");
+    }
 
-  @Override
-  public Operator visitGrantUser(GrantUserContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorOperator.AuthorType.GRANT_USER);
-    authorOperator.setUserName(ctx.ID().getText());
-    authorOperator.setPrivilegeList(parsePrivilege(ctx.privileges()));
-    authorOperator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
-    return authorOperator;
-  }
+    parseCqGroupByTimeClause(ctx.cqGroupByTimeClause());
 
-  @Override
-  public Operator visitGrantRole(GrantRoleContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.GRANT_ROLE);
-    authorOperator.setRoleName(ctx.ID().getText());
-    authorOperator.setPrivilegeList(parsePrivilege(ctx.privileges()));
-    authorOperator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
-    return authorOperator;
+    if (queryOp.isGroupByLevel()) {
+      int[] groupByQueryLevels = queryOp.getSpecialClauseComponent().getLevels();
+      int fromPrefixLevelLimit = queryOp.getFromComponent().getPrefixPaths().get(0).getNodeLength();
+      if (Arrays.stream(groupByQueryLevels).max().getAsInt() >= fromPrefixLevelLimit) {
+        throw new SQLParserException("CQ: Level should not exceed the <from_prefix> length.");
+      }
+    }
+
+    createContinuousQueryOperator.setTargetPath(parseIntoPath(ctx.intoPath()));
+    createContinuousQueryOperator.setQueryOperator(queryOp);
   }
 
-  @Override
-  public Operator visitRevokeUser(RevokeUserContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.REVOKE_USER);
-    authorOperator.setUserName(ctx.ID().getText());
-    authorOperator.setPrivilegeList(parsePrivilege(ctx.privileges()));
-    authorOperator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
-    return authorOperator;
+  public void parseCqGroupByTimeClause(IoTDBSqlParser.CqGroupByTimeClauseContext ctx) {
+
+    GroupByClauseComponent groupByClauseComponent = new GroupByClauseComponent();
+
+    groupByClauseComponent.setUnit(
+        parseTimeUnitOrSlidingStep(ctx.DURATION_LITERAL().getText(), true, groupByClauseComponent));
+
+    groupByClauseComponent.setSlidingStep(groupByClauseComponent.getUnit());
+    groupByClauseComponent.setSlidingStepByMonth(groupByClauseComponent.isIntervalByMonth());
+
+    groupByClauseComponent.setLeftCRightO(true);
+
+    if (ctx.LEVEL() != null && ctx.INTEGER_LITERAL() != null) {
+      int[] levels = new int[ctx.INTEGER_LITERAL().size()];
+      for (int i = 0; i < ctx.INTEGER_LITERAL().size(); i++) {
+        levels[i] = Integer.parseInt(ctx.INTEGER_LITERAL().get(i).getText());
+      }
+      groupByClauseComponent.setLevels(levels);
+    }
+
+    queryOp.setSpecialClauseComponent(groupByClauseComponent);
   }
 
-  @Override
-  public Operator visitRevokeRole(RevokeRoleContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.REVOKE_ROLE);
-    authorOperator.setRoleName(ctx.ID().getText());
-    authorOperator.setPrivilegeList(parsePrivilege(ctx.privileges()));
-    authorOperator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
-    return authorOperator;
+  public void parseResampleClause(
+      IoTDBSqlParser.ResampleClauseContext ctx, CreateContinuousQueryOperator operator) {
+
+    if (ctx.DURATION_LITERAL().size() == 1) {
+      if (ctx.EVERY() != null) {
+        operator.setEveryInterval(
+            DatetimeUtils.convertDurationStrToLong(ctx.DURATION_LITERAL(0).getText()));
+      } else if (ctx.FOR() != null) {
+        operator.setForInterval(
+            DatetimeUtils.convertDurationStrToLong(ctx.DURATION_LITERAL(0).getText()));
+      }
+    } else if (ctx.DURATION_LITERAL().size() == 2) {
+      operator.setEveryInterval(
+          DatetimeUtils.convertDurationStrToLong(ctx.DURATION_LITERAL(0).getText()));
+      operator.setForInterval(
+          DatetimeUtils.convertDurationStrToLong(ctx.DURATION_LITERAL(1).getText()));
+    }
   }
 
+  // Create Snapshot for Schema
+
   @Override
-  public Operator visitGrantRoleToUser(GrantRoleToUserContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(
-            SQLConstant.TOK_AUTHOR_GRANT, AuthorOperator.AuthorType.GRANT_ROLE_TO_USER);
-    authorOperator.setRoleName(ctx.roleName.getText());
-    authorOperator.setUserName(ctx.userName.getText());
-    return authorOperator;
+  public Operator visitCreateSnapshot(IoTDBSqlParser.CreateSnapshotContext ctx) {
+    return new CreateSnapshotOperator(SQLConstant.TOK_CREATE_SCHEMA_SNAPSHOT);
   }
 
+  // Alter Timeseries
+
   @Override
-  public Operator visitRevokeRoleFromUser(RevokeRoleFromUserContext ctx) {
-    AuthorOperator authorOperator =
-        new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.REVOKE_ROLE_FROM_USER);
-    authorOperator.setRoleName(ctx.roleName.getText());
-    authorOperator.setUserName(ctx.userName.getText());
-    return authorOperator;
+  public Operator visitAlterTimeseries(IoTDBSqlParser.AlterTimeseriesContext ctx) {
+    AlterTimeSeriesOperator alterTimeSeriesOperator =
+        new AlterTimeSeriesOperator(SQLConstant.TOK_METADATA_ALTER);
+    alterTimeSeriesOperator.setPath(parseFullPath(ctx.fullPath()));
+    parseAlterClause(ctx.alterClause(), alterTimeSeriesOperator);
+    return alterTimeSeriesOperator;
   }
 
-  @Override
-  public Operator visitLoadStatement(LoadStatementContext ctx) {
-    if (ctx.prefixPath().nodeName().size() < 3) {
-      throw new SQLParserException("data load command: child count < 3\n");
+  private void parseAlterClause(
+      IoTDBSqlParser.AlterClauseContext ctx, AlterTimeSeriesOperator alterTimeSeriesOperator) {
+    Map<String, String> alterMap = new HashMap<>();
+    // rename
+    if (ctx.RENAME() != null) {
+      alterTimeSeriesOperator.setAlterType(AlterType.RENAME);
+      alterMap.put(ctx.beforeName.getText(), ctx.currentName.getText());
+    } else if (ctx.SET() != null) {
+      // set
+      alterTimeSeriesOperator.setAlterType(AlterType.SET);
+      setMap(ctx, alterMap);
+    } else if (ctx.DROP() != null) {
+      // drop
+      alterTimeSeriesOperator.setAlterType(AlterType.DROP);
+      for (TerminalNode dropId : ctx.ID()) {
+        alterMap.put(dropId.getText(), null);
+      }
+    } else if (ctx.TAGS() != null) {
+      // add tag
+      alterTimeSeriesOperator.setAlterType(AlterType.ADD_TAGS);
+      setMap(ctx, alterMap);
+    } else if (ctx.ATTRIBUTES() != null) {
+      // add attribute
+      alterTimeSeriesOperator.setAlterType(AlterType.ADD_ATTRIBUTES);
+      setMap(ctx, alterMap);
+    } else {
+      // upsert
+      alterTimeSeriesOperator.setAlterType(AlterType.UPSERT);
+      if (ctx.aliasClause() != null) {
+        parseAliasClause(ctx.aliasClause(), alterTimeSeriesOperator);
+      }
+      if (ctx.tagClause() != null) {
+        parseTagClause(ctx.tagClause(), alterTimeSeriesOperator);
+      }
+      if (ctx.attributeClause() != null) {
+        parseAttributeClause(ctx.attributeClause(), alterTimeSeriesOperator);
+      }
     }
+    alterTimeSeriesOperator.setAlterMap(alterMap);
+  }
 
-    String csvPath = ctx.stringLiteral().getText();
-    StringContainer sc = new StringContainer(TsFileConstant.PATH_SEPARATOR);
-    List<NodeNameContext> nodeNames = ctx.prefixPath().nodeName();
-    sc.addTail(ctx.prefixPath().ROOT().getText());
-    for (NodeNameContext nodeName : nodeNames) {
-      sc.addTail(nodeName.getText());
+  public void parseAliasClause(
+      IoTDBSqlParser.AliasClauseContext ctx, AlterTimeSeriesOperator alterTimeSeriesOperator) {
+    if (alterTimeSeriesOperator != null && ctx.ID() != null) {
+      alterTimeSeriesOperator.setAlias(ctx.ID().getText());
     }
-    return new LoadDataOperator(
-        SQLConstant.TOK_DATALOAD, removeStringQuote(csvPath), sc.toString());
   }
 
+  // Delete Storage Group
+
   @Override
-  public Operator visitGrantWatermarkEmbedding(GrantWatermarkEmbeddingContext ctx) {
-    List<RootOrIdContext> rootOrIdList = ctx.rootOrId();
-    List<String> users = new ArrayList<>();
-    for (RootOrIdContext rootOrId : rootOrIdList) {
-      users.add(rootOrId.getText());
+  public Operator visitDeleteStorageGroup(IoTDBSqlParser.DeleteStorageGroupContext ctx) {
+    List<PartialPath> deletePaths = new ArrayList<>();
+    List<IoTDBSqlParser.PrefixPathContext> prefixPaths = ctx.prefixPath();
+    for (IoTDBSqlParser.PrefixPathContext prefixPath : prefixPaths) {
+      deletePaths.add(parsePrefixPath(prefixPath));
     }
-    return new DataAuthOperator(SQLConstant.TOK_GRANT_WATERMARK_EMBEDDING, users);
+    DeleteStorageGroupOperator deleteStorageGroupOperator =
+        new DeleteStorageGroupOperator(SQLConstant.TOK_METADATA_DELETE_FILE_LEVEL);
+    deleteStorageGroupOperator.setDeletePathList(deletePaths);
+    return deleteStorageGroupOperator;
   }
 
+  // Delete Timeseries
+
   @Override
-  public Operator visitRevokeWatermarkEmbedding(RevokeWatermarkEmbeddingContext ctx) {
-    List<RootOrIdContext> rootOrIdList = ctx.rootOrId();
-    List<String> users = new ArrayList<>();
-    for (RootOrIdContext rootOrId : rootOrIdList) {
-      users.add(rootOrId.getText());
+  public Operator visitDeleteTimeseries(IoTDBSqlParser.DeleteTimeseriesContext ctx) {
+    List<PartialPath> deletePaths = new ArrayList<>();
+    List<IoTDBSqlParser.PrefixPathContext> prefixPaths = ctx.prefixPath();
+    for (IoTDBSqlParser.PrefixPathContext prefixPath : prefixPaths) {
+      deletePaths.add(parsePrefixPath(prefixPath));
     }
-    return new DataAuthOperator(SQLConstant.TOK_REVOKE_WATERMARK_EMBEDDING, users);
+    DeleteTimeSeriesOperator deleteTimeSeriesOperator =
+        new DeleteTimeSeriesOperator(SQLConstant.TOK_METADATA_DELETE);
+    deleteTimeSeriesOperator.setDeletePathList(deletePaths);
+    return deleteTimeSeriesOperator;
   }
 
-  @Override
-  public Operator visitListUser(ListUserContext ctx) {
-    return new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER);
-  }
+  // Delete Partition
 
   @Override
-  public Operator visitListRole(ListRoleContext ctx) {
-    return new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE);
+  public Operator visitDeletePartition(IoTDBSqlParser.DeletePartitionContext ctx) {
+    DeletePartitionOperator deletePartitionOperator =
+        new DeletePartitionOperator(SQLConstant.TOK_DELETE_PARTITION);
+    deletePartitionOperator.setStorageGroupName(parsePrefixPath(ctx.prefixPath()));
+    Set<Long> idSet = new HashSet<>();
+    for (TerminalNode terminalNode : ctx.INTEGER_LITERAL()) {
+      idSet.add(Long.parseLong(terminalNode.getText()));
+    }
+    deletePartitionOperator.setPartitionIds(idSet);
+    return deletePartitionOperator;
   }
 
-  @Override
-  public Operator visitListPrivilegesUser(ListPrivilegesUserContext ctx) {
-    AuthorOperator operator =
-        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER_PRIVILEGE);
-    operator.setUserName(ctx.rootOrId().getText());
-    operator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
-    return operator;
-  }
+  // Drop Function
 
   @Override
-  public Operator visitListPrivilegesRole(ListPrivilegesRoleContext ctx) {
-    AuthorOperator operator =
-        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE_PRIVILEGE);
-    operator.setRoleName((ctx.ID().getText()));
-    operator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
-    return operator;
+  public Operator visitDropFunction(IoTDBSqlParser.DropFunctionContext ctx) {
+    DropFunctionOperator dropFunctionOperator =
+        new DropFunctionOperator(SQLConstant.TOK_FUNCTION_DROP);
+    dropFunctionOperator.setUdfName(ctx.udfName.getText());
+    return dropFunctionOperator;
   }
 
-  @Override
-  public Operator visitListUserPrivileges(ListUserPrivilegesContext ctx) {
-    AuthorOperator operator =
-        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER_PRIVILEGE);
-    operator.setUserName(ctx.rootOrId().getText());
-    return operator;
-  }
+  // Drop Trigger
 
   @Override
-  public Operator visitListRolePrivileges(ListRolePrivilegesContext ctx) {
-    AuthorOperator operator =
-        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE_PRIVILEGE);
-    operator.setRoleName(ctx.ID().getText());
-    return operator;
+  public Operator visitDropTrigger(IoTDBSqlParser.DropTriggerContext ctx) {
+    DropTriggerOperator dropTriggerOperator = new DropTriggerOperator(SQLConstant.TOK_TRIGGER_DROP);
+    dropTriggerOperator.setTriggerName(ctx.triggerName.getText());
+    return dropTriggerOperator;
   }
 
-  @Override
-  public Operator visitListAllRoleOfUser(ListAllRoleOfUserContext ctx) {
-    AuthorOperator operator =
-        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER_ROLES);
-    operator.setUserName(ctx.rootOrId().getText());
-    return operator;
-  }
+  // Drop Continuous Query
 
   @Override
-  public Operator visitListAllUserOfRole(ListAllUserOfRoleContext ctx) {
-    AuthorOperator operator =
-        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE_USERS);
-    operator.setRoleName((ctx.ID().getText()));
-    return operator;
+  public Operator visitDropContinuousQuery(IoTDBSqlParser.DropContinuousQueryContext ctx) {
+    DropContinuousQueryOperator dropContinuousQueryOperator =
+        new DropContinuousQueryOperator(SQLConstant.TOK_CONTINUOUS_QUERY_DROP);
+    dropContinuousQueryOperator.setContinuousQueryName(ctx.continuousQueryName.getText());
+    return dropContinuousQueryOperator;
   }
 
+  // Set TTL
+
   @Override
-  public Operator visitSetTTLStatement(SetTTLStatementContext ctx) {
+  public Operator visitSetTTL(IoTDBSqlParser.SetTTLContext ctx) {
     SetTTLOperator operator = new SetTTLOperator(SQLConstant.TOK_SET);
     operator.setStorageGroup(parsePrefixPath(ctx.prefixPath()));
-    operator.setDataTTL(Long.parseLong(ctx.INT().getText()));
+    operator.setDataTTL(Long.parseLong(ctx.INTEGER_LITERAL().getText()));
     return operator;
   }
 
+  // Unset TTL
+
   @Override
-  public Operator visitUnsetTTLStatement(UnsetTTLStatementContext ctx) {
+  public Operator visitUnsetTTL(IoTDBSqlParser.UnsetTTLContext ctx) {
     UnSetTTLOperator operator = new UnSetTTLOperator(SQLConstant.TOK_UNSET);
     operator.setStorageGroup(parsePrefixPath(ctx.prefixPath()));
     return operator;
   }
 
+  // Start Trigger
+
   @Override
-  public Operator visitShowTTLStatement(ShowTTLStatementContext ctx) {
-    List<PartialPath> storageGroups = new ArrayList<>();
-    List<PrefixPathContext> prefixPathList = ctx.prefixPath();
-    for (PrefixPathContext prefixPath : prefixPathList) {
-      storageGroups.add(parsePrefixPath(prefixPath));
-    }
-    return new ShowTTLOperator(storageGroups);
+  public Operator visitStartTrigger(IoTDBSqlParser.StartTriggerContext ctx) {
+    StartTriggerOperator startTriggerOperator =
+        new StartTriggerOperator(SQLConstant.TOK_TRIGGER_START);
+    startTriggerOperator.setTriggerName(ctx.triggerName.getText());
+    return startTriggerOperator;
   }
 
+  // Stop Trigger
+
   @Override
-  public Operator visitShowAllTTLStatement(ShowAllTTLStatementContext ctx) {
-    List<PartialPath> storageGroups = new ArrayList<>();
-    return new ShowTTLOperator(storageGroups);
+  public Operator visitStopTrigger(IoTDBSqlParser.StopTriggerContext ctx) {
+    StopTriggerOperator stopTriggerOperator = new StopTriggerOperator(SQLConstant.TOK_TRIGGER_STOP);
+    stopTriggerOperator.setTriggerName(ctx.triggerName.getText());
+    return stopTriggerOperator;
   }
 
+  // Show Storage Group
+
   @Override
-  public Operator visitShowFlushTaskInfo(ShowFlushTaskInfoContext ctx) {
-    return new ShowOperator(SQLConstant.TOK_FLUSH_TASK_INFO);
+  public Operator visitShowStorageGroup(IoTDBSqlParser.ShowStorageGroupContext ctx) {
+    if (ctx.prefixPath() != null) {
+      return new ShowStorageGroupOperator(
+          SQLConstant.TOK_STORAGE_GROUP, parsePrefixPath(ctx.prefixPath()));
+    } else {
+      return new ShowStorageGroupOperator(
+          SQLConstant.TOK_STORAGE_GROUP, new PartialPath(SQLConstant.getSingleRootArray()));
+    }
   }
 
+  // Show Devices
+
   @Override
-  public Operator visitShowVersion(ShowVersionContext ctx) {
-    return new ShowOperator(SQLConstant.TOK_VERSION);
+  public Operator visitShowDevices(IoTDBSqlParser.ShowDevicesContext ctx) {
+    ShowDevicesOperator showDevicesOperator;
+    if (ctx.prefixPath() != null) {
+      showDevicesOperator =
+          new ShowDevicesOperator(SQLConstant.TOK_DEVICES, parsePrefixPath(ctx.prefixPath()));
+    } else {
+      showDevicesOperator =
+          new ShowDevicesOperator(
+              SQLConstant.TOK_DEVICES, new PartialPath(SQLConstant.getSingleRootArray()));
+    }
+    if (ctx.limitClause() != null) {
+      parseLimitClause(ctx.limitClause(), showDevicesOperator);
+    }
+    // show devices wtih storage group
+    if (ctx.WITH() != null) {
+      showDevicesOperator.setSgCol(true);
+    }
+    return showDevicesOperator;
   }
 
+  // Show Timeseries
+
   @Override
-  public Operator visitShowTimeseries(ShowTimeseriesContext ctx) {
+  public Operator visitShowTimeseries(IoTDBSqlParser.ShowTimeseriesContext ctx) {
     boolean orderByHeat = ctx.LATEST() != null;
     ShowTimeSeriesOperator showTimeSeriesOperator;
     if (ctx.prefixPath() != null) {
@@ -862,43 +622,31 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     return showTimeSeriesOperator;
   }
 
-  @Override
-  public Operator visitShowQueryProcesslist(ShowQueryProcesslistContext ctx) {
-    return new ShowOperator(SQLConstant.TOK_QUERY_PROCESSLIST);
-  }
-
-  @Override
-  public Operator visitKillQuery(KillQueryContext ctx) {
-    KillQueryOperator killQueryOperator = new KillQueryOperator(TOK_KILL_QUERY);
-    if (ctx.INT() != null) {
-      killQueryOperator.setQueryId(Integer.parseInt(ctx.INT().getText()));
+  private void parseShowWhereClause(
+      IoTDBSqlParser.ShowWhereClauseContext ctx, ShowTimeSeriesOperator operator) {
+    IoTDBSqlParser.PropertyValueContext propertyValueContext;
+    if (ctx.containsExpression() != null) {
+      operator.setContains(true);
+      propertyValueContext = ctx.containsExpression().propertyValue();
+      operator.setKey(ctx.containsExpression().ID().getText());
+    } else {
+      operator.setContains(false);
+      propertyValueContext = ctx.propertyClause().propertyValue();
+      operator.setKey(ctx.propertyClause().ID().getText());
     }
-    return killQueryOperator;
-  }
-
-  @Override
-  public Operator visitShowStorageGroup(ShowStorageGroupContext ctx) {
-    if (ctx.prefixPath() != null) {
-      return new ShowStorageGroupOperator(
-          SQLConstant.TOK_STORAGE_GROUP, parsePrefixPath(ctx.prefixPath()));
+    String value;
+    if (propertyValueContext.STRING_LITERAL() != null) {
+      value = removeStringQuote(propertyValueContext.getText());
     } else {
-      return new ShowStorageGroupOperator(
-          SQLConstant.TOK_STORAGE_GROUP, new PartialPath(SQLConstant.getSingleRootArray()));
+      value = propertyValueContext.getText();
     }
+    operator.setValue(value);
   }
 
-  @Override
-  public Operator visitShowLockInfo(ShowLockInfoContext ctx) {
-    if (ctx.prefixPath() != null) {
-      return new ShowLockInfoOperator(SQLConstant.TOK_LOCK_INFO, parsePrefixPath(ctx.prefixPath()));
-    } else {
-      return new ShowLockInfoOperator(
-          SQLConstant.TOK_LOCK_INFO, new PartialPath(SQLConstant.getSingleRootArray()));
-    }
-  }
+  // Show Child Paths
 
   @Override
-  public Operator visitShowChildPaths(ShowChildPathsContext ctx) {
+  public Operator visitShowChildPaths(IoTDBSqlParser.ShowChildPathsContext ctx) {
     if (ctx.prefixPath() != null) {
       return new ShowChildPathsOperator(
           SQLConstant.TOK_CHILD_PATHS, parsePrefixPath(ctx.prefixPath()));
@@ -908,8 +656,10 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     }
   }
 
+  // Show Child Nodes
+
   @Override
-  public Operator visitShowChildNodes(ShowChildNodesContext ctx) {
+  public Operator visitShowChildNodes(IoTDBSqlParser.ShowChildNodesContext ctx) {
     if (ctx.prefixPath() != null) {
       return new ShowChildNodesOperator(
           SQLConstant.TOK_CHILD_NODES, parsePrefixPath(ctx.prefixPath()));
@@ -919,70 +669,64 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     }
   }
 
-  @Override
-  public Operator visitShowDevices(ShowDevicesContext ctx) {
-    ShowDevicesOperator showDevicesOperator;
-    if (ctx.prefixPath() != null) {
-      showDevicesOperator =
-          new ShowDevicesOperator(SQLConstant.TOK_DEVICES, parsePrefixPath(ctx.prefixPath()));
-    } else {
-      showDevicesOperator =
-          new ShowDevicesOperator(
-              SQLConstant.TOK_DEVICES, new PartialPath(SQLConstant.getSingleRootArray()));
-    }
-    if (ctx.limitClause() != null) {
-      parseLimitClause(ctx.limitClause(), showDevicesOperator);
-    }
-    // show devices wtih storage group
-    if (ctx.WITH() != null) {
-      showDevicesOperator.setSgCol(true);
-    }
-    return showDevicesOperator;
-  }
+  // Show Functions
 
   @Override
-  public Operator visitShowMergeStatus(ShowMergeStatusContext ctx) {
-    return new ShowMergeStatusOperator(SQLConstant.TOK_SHOW_MERGE_STATUS);
+  public Operator visitShowFunctions(IoTDBSqlParser.ShowFunctionsContext ctx) {
+    return new ShowFunctionsOperator(SQLConstant.TOK_SHOW_FUNCTIONS);
   }
 
+  // Show Triggers
+
   @Override
-  public Operator visitTracingOn(TracingOnContext ctx) {
-    return new TracingOperator(SQLConstant.TOK_TRACING, true);
+  public Operator visitShowTriggers(IoTDBSqlParser.ShowTriggersContext ctx) {
+    return new ShowTriggersOperator(SQLConstant.TOK_SHOW_TRIGGERS);
   }
 
+  // Show Continuous Queries
+
   @Override
-  public Operator visitTracingOff(TracingOffContext ctx) {
-    return new TracingOperator(SQLConstant.TOK_TRACING, false);
+  public Operator visitShowContinuousQueries(IoTDBSqlParser.ShowContinuousQueriesContext ctx) {
+    return new ShowContinuousQueriesOperator(SQLConstant.TOK_SHOW_CONTINUOUS_QUERIES);
   }
 
+  // Show TTL
+
   @Override
-  public Operator visitSetSystemToReadOnly(SetSystemToReadOnlyContext ctx) {
-    return new SetSystemModeOperator(SQLConstant.TOK_SET_SYSTEM_MODE, true);
+  public Operator visitShowTTL(IoTDBSqlParser.ShowTTLContext ctx) {
+    List<PartialPath> storageGroups = new ArrayList<>();
+    List<IoTDBSqlParser.PrefixPathContext> prefixPathList = ctx.prefixPath();
+    for (IoTDBSqlParser.PrefixPathContext prefixPath : prefixPathList) {
+      storageGroups.add(parsePrefixPath(prefixPath));
+    }
+    return new ShowTTLOperator(storageGroups);
   }
 
+  // Show All TTL
+
   @Override
-  public Operator visitSetSystemToWritable(SetSystemToWritableContext ctx) {
-    return new SetSystemModeOperator(SQLConstant.TOK_SET_SYSTEM_MODE, false);
+  public Operator visitShowAllTTL(IoTDBSqlParser.ShowAllTTLContext ctx) {
+    List<PartialPath> storageGroups = new ArrayList<>();
+    return new ShowTTLOperator(storageGroups);
   }
 
+  // countStorageGroup
+
   @Override
-  public Operator visitCountTimeseries(CountTimeseriesContext ctx) {
-    PrefixPathContext pathContext = ctx.prefixPath();
+  public Operator visitCountStorageGroup(IoTDBSqlParser.CountStorageGroupContext ctx) {
+    IoTDBSqlParser.PrefixPathContext pathContext = ctx.prefixPath();
     PartialPath path =
         (pathContext != null
             ? parsePrefixPath(pathContext)
             : new PartialPath(SQLConstant.getSingleRootArray()));
-    if (ctx.INT() != null) {
-      return new CountOperator(
-          SQLConstant.TOK_COUNT_NODE_TIMESERIES, path, Integer.parseInt(ctx.INT().getText()));
-    } else {
-      return new CountOperator(SQLConstant.TOK_COUNT_TIMESERIES, path);
-    }
+    return new CountOperator(SQLConstant.TOK_COUNT_STORAGE_GROUP, path);
   }
 
+  // Count Devices
+
   @Override
-  public Operator visitCountDevices(CountDevicesContext ctx) {
-    PrefixPathContext pathContext = ctx.prefixPath();
+  public Operator visitCountDevices(IoTDBSqlParser.CountDevicesContext ctx) {
+    IoTDBSqlParser.PrefixPathContext pathContext = ctx.prefixPath();
     PartialPath path =
         (pathContext != null
             ? parsePrefixPath(pathContext)
@@ -990,79 +734,41 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     return new CountOperator(SQLConstant.TOK_COUNT_DEVICES, path);
   }
 
+  // Count Timeseries
+
   @Override
-  public Operator visitCountStorageGroup(CountStorageGroupContext ctx) {
-    PrefixPathContext pathContext = ctx.prefixPath();
+  public Operator visitCountTimeseries(IoTDBSqlParser.CountTimeseriesContext ctx) {
+    IoTDBSqlParser.PrefixPathContext pathContext = ctx.prefixPath();
     PartialPath path =
         (pathContext != null
             ? parsePrefixPath(pathContext)
             : new PartialPath(SQLConstant.getSingleRootArray()));
-    return new CountOperator(SQLConstant.TOK_COUNT_STORAGE_GROUP, path);
-  }
-
-  @Override
-  public Operator visitCountNodes(CountNodesContext ctx) {
-    return new CountOperator(
-        SQLConstant.TOK_COUNT_NODES,
-        parsePrefixPath(ctx.prefixPath()),
-        Integer.parseInt(ctx.INT().getText()));
-  }
-
-  @Override
-  public Operator visitLoadConfigurationStatement(LoadConfigurationStatementContext ctx) {
-    if (ctx.GLOBAL() != null) {
-      return new LoadConfigurationOperator(LoadConfigurationOperatorType.GLOBAL);
+    if (ctx.INTEGER_LITERAL() != null) {
+      return new CountOperator(
+          SQLConstant.TOK_COUNT_NODE_TIMESERIES,
+          path,
+          Integer.parseInt(ctx.INTEGER_LITERAL().getText()));
     } else {
-      return new LoadConfigurationOperator(LoadConfigurationOperatorType.LOCAL);
-    }
-  }
-
-  @Override
-  public Operator visitLoadFiles(LoadFilesContext ctx) {
-    LoadFilesOperator loadFilesOperator =
-        new LoadFilesOperator(
-            new File(removeStringQuote(ctx.stringLiteral().getText())),
-            true,
-            IoTDBDescriptor.getInstance().getConfig().getDefaultStorageGroupLevel(),
-            true);
-    if (ctx.loadFilesClause() != null) {
-      parseLoadFiles(loadFilesOperator, ctx.loadFilesClause());
+      return new CountOperator(SQLConstant.TOK_COUNT_TIMESERIES, path);
     }
-    return loadFilesOperator;
   }
 
-  @Override
-  public Operator visitRemoveFile(RemoveFileContext ctx) {
-    return new RemoveFileOperator(new File(removeStringQuote(ctx.stringLiteral().getText())));
-  }
+  // Count Nodes
 
   @Override
-  public Operator visitUnloadFile(UnloadFileContext ctx) {
-    return new UnloadFileOperator(
-        new File(removeStringQuote(ctx.stringLiteral(0).getText())),
-        new File(removeStringQuote(ctx.stringLiteral(1).getText())));
+  public Operator visitCountNodes(IoTDBSqlParser.CountNodesContext ctx) {
+    return new CountOperator(
+        SQLConstant.TOK_COUNT_NODES,
+        parsePrefixPath(ctx.prefixPath()),
+        Integer.parseInt(ctx.INTEGER_LITERAL().getText()));
   }
 
-  @Override
-  public Operator visitDeletePartition(DeletePartitionContext ctx) {
-    DeletePartitionOperator deletePartitionOperator =
-        new DeletePartitionOperator(SQLConstant.TOK_DELETE_PARTITION);
-    deletePartitionOperator.setStorageGroupName(parsePrefixPath(ctx.prefixPath()));
-    Set<Long> idSet = new HashSet<>();
-    for (TerminalNode terminalNode : ctx.INT()) {
-      idSet.add(Long.parseLong(terminalNode.getText()));
-    }
-    deletePartitionOperator.setPartitionIds(idSet);
-    return deletePartitionOperator;
-  }
+  /** 3. Data Manipulation Language (DML) */
 
-  @Override
-  public Operator visitCreateSnapshot(CreateSnapshotContext ctx) {
-    return new CreateSnapshotOperator(SQLConstant.TOK_CREATE_SCHEMA_SNAPSHOT);
-  }
+  // Select Statement
 
   @Override
-  public Operator visitSelectStatement(SelectStatementContext ctx) {
+  public Operator visitSelectStatement(IoTDBSqlParser.SelectStatementContext ctx) {
     // 1. Visit special clause first to initialize different query operator
     if (ctx.specialClause() != null) {
       queryOp = (QueryOperator) visit(ctx.specialClause());
@@ -1085,60 +791,8 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     return ctx.intoClause() == null ? queryOp : parseAndConstructSelectIntoOperator(ctx);
   }
 
-  public void parseSelectClause(SelectClauseContext ctx) {
-    SelectComponent selectComponent = new SelectComponent(zoneId);
-    if (ctx.topClause() != null) {
-      // TODO: parse info of top clause into selectOp
-      visitTopClause(ctx.topClause());
-    } else if (ctx.LAST() != null) {
-      queryOp = new LastQueryOperator(queryOp);
-    }
-
-    boolean isFirstElement = true;
-    for (ResultColumnContext resultColumnContext : ctx.resultColumn()) {
-      selectComponent.addResultColumn(parseResultColumn(resultColumnContext));
-      // judge query type according to the first select element
-      if (!hasDecidedQueryType()) {
-        if (selectComponent.hasAggregationFunction()) {
-          queryOp = new AggregationQueryOperator(queryOp);
-        } else if (selectComponent.hasTimeSeriesGeneratingFunction()) {
-          queryOp = new UDFQueryOperator(queryOp);
-        }
-      }
-    }
-
-    queryOp.setSelectComponent(selectComponent);
-  }
-
-  private boolean hasDecidedQueryType() {
-    return queryOp instanceof GroupByQueryOperator
-        || queryOp instanceof FillQueryOperator
-        || queryOp instanceof LastQueryOperator
-        || queryOp instanceof AggregationQueryOperator
-        || queryOp instanceof UDFQueryOperator;
-  }
-
-  @Override
-  public Operator visitTopClause(TopClauseContext ctx) {
-    Map<String, Object> props = new HashMap<>();
-    int top = Integer.parseInt(ctx.INT().getText());
-    if (top <= 0 || top > 1000) {
-      throw new SQLParserException(
-          String.format(
-              "TOP <N>: N should be greater than 0 and less than 1000, current N is %d", top));
-    }
-    props.put(TOP_K, top);
-    queryOp.setProps(props);
-    return queryOp;
-  }
-
-  private ResultColumn parseResultColumn(ResultColumnContext resultColumnContext) {
-    return new ResultColumn(
-        parseExpression(resultColumnContext.expression()),
-        resultColumnContext.AS() == null ? null : resultColumnContext.ID().getText());
-  }
-
-  private SelectIntoOperator parseAndConstructSelectIntoOperator(SelectStatementContext ctx) {
+  private SelectIntoOperator parseAndConstructSelectIntoOperator(
+      IoTDBSqlParser.SelectStatementContext ctx) {
     if (queryOp.getFromComponent().getPrefixPaths().size() != 1) {
       throw new SQLParserException(
           "select into: the number of prefix paths in the from clause should be 1.");
@@ -1160,7 +814,7 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     return selectIntoOperator;
   }
 
-  private PartialPath parseIntoPath(IntoPathContext intoPathContext) {
+  private PartialPath parseIntoPath(IoTDBSqlParser.IntoPathContext intoPathContext) {
     int levelLimitOfSourcePrefixPath;
     if (queryOp.isGroupByLevel()) {
       levelLimitOfSourcePrefixPath =
@@ -1188,8 +842,9 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
               "the x of ${x} should be greater than 0 and equal to or less than <level> or the length of queried path prefix.");
         }
       }
-    } else if (intoPathContext.nodeNameWithoutStar() != null) {
-      List<NodeNameWithoutStarContext> nodeNameWithoutStars = intoPathContext.nodeNameWithoutStar();
+    } else if (intoPathContext.nodeNameWithoutWildcard() != null) {
+      List<IoTDBSqlParser.NodeNameWithoutWildcardContext> nodeNameWithoutStars =
+          intoPathContext.nodeNameWithoutWildcard();
       String[] intoPathNodes =
           new String[1 + levelLimitOfSourcePrefixPath + nodeNameWithoutStars.size()];
 
@@ -1208,244 +863,95 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
   }
 
   @Override
-  public Operator visitDropContinuousQueryStatement(DropContinuousQueryStatementContext ctx) {
-    DropContinuousQueryOperator dropContinuousQueryOperator =
-        new DropContinuousQueryOperator(SQLConstant.TOK_CONTINUOUS_QUERY_DROP);
-    dropContinuousQueryOperator.setContinuousQueryName(ctx.continuousQueryName.getText());
-    return dropContinuousQueryOperator;
+  public Operator visitSpecialLimitStatement(IoTDBSqlParser.SpecialLimitStatementContext ctx) {
+    return visit(ctx.specialLimit());
   }
 
   @Override
-  public Operator visitShowContinuousQueriesStatement(ShowContinuousQueriesStatementContext ctx) {
-    return new ShowContinuousQueriesOperator(SQLConstant.TOK_SHOW_CONTINUOUS_QUERIES);
+  public Operator visitOrderByTimeStatement(IoTDBSqlParser.OrderByTimeStatementContext ctx) {
+    queryOp = new QueryOperator();
+    parseOrderByTimeClause(ctx.orderByTimeClause());
+    if (ctx.specialLimit() != null) {
+      return visit(ctx.specialLimit());
+    }
+    return queryOp;
   }
 
   @Override
-  public Operator visitCreateStorageGroup(CreateStorageGroupContext ctx) {
-    SetStorageGroupOperator setStorageGroupOperator =
-        new SetStorageGroupOperator(SQLConstant.TOK_METADATA_SET_FILE_LEVEL);
-    PartialPath path = parsePrefixPath(ctx.prefixPath());
-    setStorageGroupOperator.setPath(path);
-    return setStorageGroupOperator;
+  public Operator visitGroupByTimeStatement(IoTDBSqlParser.GroupByTimeStatementContext ctx) {
+    queryOp = new GroupByQueryOperator();
+    parseGroupByTimeClause(ctx.groupByTimeClause());
+    if (ctx.orderByTimeClause() != null) {
+      parseOrderByTimeClause(ctx.orderByTimeClause());
+    }
+    if (ctx.specialLimit() != null) {
+      return visit(ctx.specialLimit());
+    }
+    return queryOp;
   }
 
   @Override
-  public Operator visitCreateContinuousQueryStatement(CreateContinuousQueryStatementContext ctx) {
-    CreateContinuousQueryOperator createContinuousQueryOperator =
-        new CreateContinuousQueryOperator(SQLConstant.TOK_CONTINUOUS_QUERY_CREATE);
-
-    createContinuousQueryOperator.setQuerySql(ctx.getText());
-
-    createContinuousQueryOperator.setContinuousQueryName(ctx.continuousQueryName.getText());
-
-    if (ctx.resampleClause() != null) {
-      parseResampleClause(ctx.resampleClause(), createContinuousQueryOperator);
-    }
-
-    parseCqSelectIntoClause(ctx.cqSelectIntoClause(), createContinuousQueryOperator);
-
-    StringBuilder sb = new StringBuilder();
-    sb.append("select ");
-    sb.append(ctx.cqSelectIntoClause().selectClause().getText().substring(6));
-    sb.append(" from ");
-    sb.append(ctx.cqSelectIntoClause().fromClause().prefixPath(0).getText());
-
-    sb.append(" group by ([now() - ");
-    String groupByInterval = ctx.cqSelectIntoClause().cqGroupByTimeClause().DURATION().getText();
-    if (createContinuousQueryOperator.getForInterval() == 0) {
-      sb.append(groupByInterval);
-    } else {
-      List<TerminalNode> durations = ctx.resampleClause().DURATION();
-      sb.append(durations.get(durations.size() - 1).getText());
+  public Operator visitGroupByFillStatement(IoTDBSqlParser.GroupByFillStatementContext ctx) {
+    queryOp = new GroupByFillQueryOperator();
+    parseGroupByFillClause(ctx.groupByFillClause());
+    if (ctx.orderByTimeClause() != null) {
+      parseOrderByTimeClause(ctx.orderByTimeClause());
     }
-    sb.append(", now()), ");
-    sb.append(groupByInterval);
-    sb.append(")");
-    if (queryOp.isGroupByLevel()) {
-      sb.append(", level = ");
-      int[] levels = queryOp.getSpecialClauseComponent().getLevels();
-      sb.append(levels[0]);
-      for (int i = 1; i < levels.length; i++) {
-        sb.append(String.format(", %d", levels[i]));
-      }
+    if (ctx.specialLimit() != null) {
+      return visit(ctx.specialLimit());
     }
-    createContinuousQueryOperator.setQuerySql(sb.toString());
+    return queryOp;
+  }
 
-    if (createContinuousQueryOperator.getEveryInterval() == 0) {
-      createContinuousQueryOperator.setEveryInterval(
-          ((GroupByClauseComponent) queryOp.getSpecialClauseComponent()).getUnit());
+  @Override
+  public Operator visitGroupByLevelStatement(IoTDBSqlParser.GroupByLevelStatementContext ctx) {
+    queryOp = new AggregationQueryOperator();
+    parseGroupByLevelClause(ctx.groupByLevelClause());
+    if (ctx.orderByTimeClause() != null) {
+      parseOrderByTimeClause(ctx.orderByTimeClause());
     }
-
-    if (createContinuousQueryOperator.getEveryInterval()
-        < IoTDBDescriptor.getInstance().getConfig().getContinuousQueryMinimumEveryInterval()) {
-      throw new SQLParserException(
-          "CQ: every interval should not be lower than the minimum value you configured.");
+    if (ctx.specialLimit() != null) {
+      return visit(ctx.specialLimit());
     }
+    return queryOp;
+  }
 
-    if (createContinuousQueryOperator.getForInterval() == 0) {
-      createContinuousQueryOperator.setForInterval(
-          ((GroupByClauseComponent) queryOp.getSpecialClauseComponent()).getUnit());
+  @Override
+  public Operator visitFillStatement(IoTDBSqlParser.FillStatementContext ctx) {
+    queryOp = new FillQueryOperator();
+    parseFillClause(ctx.fillClause());
+    if (ctx.slimitClause() != null) {
+      parseSlimitClause(ctx.slimitClause());
     }
-
-    return createContinuousQueryOperator;
+    if (ctx.alignByDeviceClauseOrDisableAlign() != null) {
+      parseAlignByDeviceClauseOrDisableAlign(ctx.alignByDeviceClauseOrDisableAlign());
+    }
+    return queryOp;
   }
 
-  public void parseResampleClause(
-      ResampleClauseContext ctx, CreateContinuousQueryOperator operator) {
-
-    if (ctx.DURATION().size() == 1) {
-      if (ctx.EVERY() != null) {
-        operator.setEveryInterval(
-            DatetimeUtils.convertDurationStrToLong(ctx.DURATION(0).getText()));
-      } else if (ctx.FOR() != null) {
-        operator.setForInterval(DatetimeUtils.convertDurationStrToLong(ctx.DURATION(0).getText()));
-      }
-    } else if (ctx.DURATION().size() == 2) {
-      operator.setEveryInterval(DatetimeUtils.convertDurationStrToLong(ctx.DURATION(0).getText()));
-      operator.setForInterval(DatetimeUtils.convertDurationStrToLong(ctx.DURATION(1).getText()));
-    }
-  }
-
-  public void parseCqSelectIntoClause(
-      CqSelectIntoClauseContext ctx, CreateContinuousQueryOperator createContinuousQueryOperator) {
-
-    queryOp = new GroupByQueryOperator();
-
-    parseSelectClause(ctx.selectClause());
-    parseFromClause(ctx.fromClause());
-
-    if (queryOp.getSelectComponent().getResultColumns().size() > 1) {
-      throw new SQLParserException("CQ: CQ currently does not support multiple result columns.");
-    }
-
-    if (queryOp.getFromComponent().getPrefixPaths().size() > 1) {
-      throw new SQLParserException("CQ: CQ currently does not support multiple series.");
-    }
-
-    parseCqGroupByTimeClause(ctx.cqGroupByTimeClause());
-
-    if (queryOp.isGroupByLevel()) {
-      int[] groupByQueryLevels = queryOp.getSpecialClauseComponent().getLevels();
-      int fromPrefixLevelLimit = queryOp.getFromComponent().getPrefixPaths().get(0).getNodeLength();
-      if (Arrays.stream(groupByQueryLevels).max().getAsInt() >= fromPrefixLevelLimit) {
-        throw new SQLParserException("CQ: Level should not exceed the <from_prefix> length.");
-      }
-    }
-
-    createContinuousQueryOperator.setTargetPath(parseIntoPath(ctx.intoPath()));
-    createContinuousQueryOperator.setQueryOperator(queryOp);
-  }
-
-  public void parseCqGroupByTimeClause(CqGroupByTimeClauseContext ctx) {
-
-    GroupByClauseComponent groupByClauseComponent = new GroupByClauseComponent();
-
-    groupByClauseComponent.setUnit(
-        parseTimeUnitOrSlidingStep(ctx.DURATION().getText(), true, groupByClauseComponent));
-
-    groupByClauseComponent.setSlidingStep(groupByClauseComponent.getUnit());
-    groupByClauseComponent.setSlidingStepByMonth(groupByClauseComponent.isIntervalByMonth());
-
-    groupByClauseComponent.setLeftCRightO(true);
-
-    if (ctx.LEVEL() != null && ctx.INT() != null) {
-      int[] levels = new int[ctx.INT().size()];
-      for (int i = 0; i < ctx.INT().size(); i++) {
-        levels[i] = Integer.parseInt(ctx.INT().get(i).getText());
-      }
-      groupByClauseComponent.setLevels(levels);
-    }
-
-    queryOp.setSpecialClauseComponent(groupByClauseComponent);
-  }
-
-  @SuppressWarnings("squid:S3776")
-  private Expression parseExpression(ExpressionContext context) {
-    // LR_BRACKET unaryInBracket=expression RR_BRACKET
-    if (context.unaryInBracket != null) {
-      return parseExpression(context.unaryInBracket);
-    }
-
-    // (PLUS | MINUS) unaryAfterSign=expression
-    if (context.unaryAfterSign != null) {
-      return context.MINUS() != null
-          ? new NegationExpression(parseExpression(context.unaryAfterSign))
-          : parseExpression(context.unaryAfterSign);
-    }
-
-    // leftExpression=expression (STAR | DIV | MOD) rightExpression=expression
-    // leftExpression=expression (PLUS | MINUS) rightExpression=expression
-    if (context.leftExpression != null && context.rightExpression != null) {
-      Expression leftExpression = parseExpression(context.leftExpression);
-      Expression rightExpression = parseExpression(context.rightExpression);
-      if (context.STAR() != null) {
-        return new MultiplicationExpression(leftExpression, rightExpression);
-      }
-      if (context.DIV() != null) {
-        return new DivisionExpression(leftExpression, rightExpression);
-      }
-      if (context.MOD() != null) {
-        return new ModuloExpression(leftExpression, rightExpression);
-      }
-      if (context.PLUS() != null) {
-        return new AdditionExpression(leftExpression, rightExpression);
-      }
-      if (context.MINUS() != null) {
-        return new SubtractionExpression(leftExpression, rightExpression);
-      }
-    }
-
-    // functionName=suffixPath LR_BRACKET expression (COMMA expression)* functionAttribute*
-    // RR_BRACKET
-    if (context.functionName() != null) {
-      return parseFunctionExpression(context);
-    }
-
-    // suffixPath
-    if (context.suffixPath() != null) {
-      return new TimeSeriesOperand(parseSuffixPath(context.suffixPath()));
-    }
-
-    // literal=SINGLE_QUOTE_STRING_LITERAL
-    if (context.literal != null) {
-      return new TimeSeriesOperand(new PartialPath(new String[] {context.literal.getText()}));
+  @Override
+  public Operator visitLimitStatement(IoTDBSqlParser.LimitStatementContext ctx) {
+    if (queryOp == null) {
+      queryOp = new QueryOperator();
     }
-
-    throw new UnsupportedOperationException();
-  }
-
-  private Expression parseFunctionExpression(ExpressionContext functionClause) {
-    FunctionExpression functionExpression =
-        new FunctionExpression(functionClause.functionName().getText());
-
-    // expressions
-    for (ExpressionContext expression : functionClause.expression()) {
-      functionExpression.addExpression(parseExpression(expression));
+    parseLimitClause(ctx.limitClause(), queryOp);
+    if (ctx.slimitClause() != null) {
+      parseSlimitClause(ctx.slimitClause());
     }
-
-    // attributes
-    for (FunctionAttributeContext functionAttribute : functionClause.functionAttribute()) {
-      functionExpression.addAttribute(
-          removeStringQuote(functionAttribute.functionAttributeKey.getText()),
-          removeStringQuote(functionAttribute.functionAttributeValue.getText()));
+    if (ctx.alignByDeviceClauseOrDisableAlign() != null) {
+      parseAlignByDeviceClauseOrDisableAlign(ctx.alignByDeviceClauseOrDisableAlign());
     }
-
-    return functionExpression;
-  }
-
-  @Override
-  public Operator visitSpecialLimitStatement(SpecialLimitStatementContext ctx) {
-    return visit(ctx.specialLimit());
+    return queryOp;
   }
 
   @Override
-  public Operator visitLimitStatement(LimitStatementContext ctx) {
+  public Operator visitSlimitStatement(IoTDBSqlParser.SlimitStatementContext ctx) {
     if (queryOp == null) {
       queryOp = new QueryOperator();
     }
-    parseLimitClause(ctx.limitClause(), queryOp);
-    if (ctx.slimitClause() != null) {
-      parseSlimitClause(ctx.slimitClause());
+    parseSlimitClause(ctx.slimitClause());
+    if (ctx.limitClause() != null) {
+      parseLimitClause(ctx.limitClause(), queryOp);
     }
     if (ctx.alignByDeviceClauseOrDisableAlign() != null) {
       parseAlignByDeviceClauseOrDisableAlign(ctx.alignByDeviceClauseOrDisableAlign());
@@ -1454,14 +960,17 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
   }
 
   @Override
-  public Operator visitSlimitStatement(SlimitStatementContext ctx) {
+  public Operator visitWithoutNullStatement(IoTDBSqlParser.WithoutNullStatementContext ctx) {
     if (queryOp == null) {
       queryOp = new QueryOperator();
     }
-    parseSlimitClause(ctx.slimitClause());
+    parseWithoutNullClause(ctx.withoutNullClause());
     if (ctx.limitClause() != null) {
       parseLimitClause(ctx.limitClause(), queryOp);
     }
+    if (ctx.slimitClause() != null) {
+      parseSlimitClause(ctx.slimitClause());
+    }
     if (ctx.alignByDeviceClauseOrDisableAlign() != null) {
       parseAlignByDeviceClauseOrDisableAlign(ctx.alignByDeviceClauseOrDisableAlign());
     }
@@ -1470,7 +979,7 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
 
   @Override
   public Operator visitAlignByDeviceClauseOrDisableAlignStatement(
-      AlignByDeviceClauseOrDisableAlignStatementContext ctx) {
+      IoTDBSqlParser.AlignByDeviceClauseOrDisableAlignStatementContext ctx) {
     if (queryOp == null) {
       queryOp = new QueryOperator();
     }
@@ -1479,7 +988,7 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
   }
 
   private void parseAlignByDeviceClauseOrDisableAlign(
-      AlignByDeviceClauseOrDisableAlignContext ctx) {
+      IoTDBSqlParser.AlignByDeviceClauseOrDisableAlignContext ctx) {
     SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
     if (specialClauseComponent == null) {
       specialClauseComponent = new SpecialClauseComponent();
@@ -1492,182 +1001,104 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     queryOp.setSpecialClauseComponent(specialClauseComponent);
   }
 
-  @Override
-  public Operator visitWithoutNullStatement(WithoutNullStatementContext ctx) {
-    if (queryOp == null) {
-      queryOp = new QueryOperator();
-    }
-    parseWithoutNullClause(ctx.withoutNullClause());
-    if (ctx.limitClause() != null) {
-      parseLimitClause(ctx.limitClause(), queryOp);
-    }
-    if (ctx.slimitClause() != null) {
-      parseSlimitClause(ctx.slimitClause());
-    }
-    if (ctx.alignByDeviceClauseOrDisableAlign() != null) {
-      parseAlignByDeviceClauseOrDisableAlign(ctx.alignByDeviceClauseOrDisableAlign());
-    }
-    return queryOp;
+  private void parseAlignByDeviceClause(SpecialClauseComponent specialClauseComponent) {
+    specialClauseComponent.setAlignByDevice(true);
   }
 
-  private void parseWithoutNullClause(WithoutNullClauseContext ctx) {
-    SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
-    if (specialClauseComponent == null) {
-      specialClauseComponent = new SpecialClauseComponent();
-    }
-    specialClauseComponent.setWithoutAnyNull(ctx.ANY() != null);
-    specialClauseComponent.setWithoutAllNull(ctx.ALL() != null);
-    queryOp.setSpecialClauseComponent(specialClauseComponent);
+  private void parseDisableAlign(SpecialClauseComponent specialClauseComponent) {
+    specialClauseComponent.setAlignByTime(false);
   }
 
-  @Override
-  public Operator visitOrderByTimeStatement(OrderByTimeStatementContext ctx) {
-    queryOp = new QueryOperator();
-    parseOrderByTimeClause(ctx.orderByTimeClause());
-    if (ctx.specialLimit() != null) {
-      return visit(ctx.specialLimit());
+  private void parseOrderByTimeClause(IoTDBSqlParser.OrderByTimeClauseContext ctx) {
+    if (ctx.DESC() != null) {
+      SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
+      if (specialClauseComponent == null) {
+        specialClauseComponent = new SpecialClauseComponent();
+      }
+      specialClauseComponent.setAscending(false);
+      queryOp.setSpecialClauseComponent(specialClauseComponent);
     }
-    return queryOp;
   }
 
-  @Override
-  public Operator visitGroupByTimeStatement(GroupByTimeStatementContext ctx) {
-    queryOp = new GroupByQueryOperator();
-    parseGroupByTimeClause(ctx.groupByTimeClause());
-    if (ctx.orderByTimeClause() != null) {
-      parseOrderByTimeClause(ctx.orderByTimeClause());
+  private void parseGroupByTimeClause(IoTDBSqlParser.GroupByTimeClauseContext ctx) {
+    GroupByClauseComponent groupByClauseComponent = new GroupByClauseComponent();
+    groupByClauseComponent.setLeftCRightO(ctx.timeInterval().LS_BRACKET() != null);
+    // parse timeUnit
+    groupByClauseComponent.setUnit(
+        parseTimeUnitOrSlidingStep(
+            ctx.DURATION_LITERAL(0).getText(), true, groupByClauseComponent));
+    // parse sliding step
+    if (ctx.DURATION_LITERAL().size() == 2) {
+      groupByClauseComponent.setSlidingStep(
+          parseTimeUnitOrSlidingStep(
+              ctx.DURATION_LITERAL(1).getText(), false, groupByClauseComponent));
+      if (groupByClauseComponent.getSlidingStep() < groupByClauseComponent.getUnit()) {
+        throw new SQLParserException(
+            "The third parameter sliding step shouldn't be smaller than the second parameter time interval.");
+      }
+    } else {
+      groupByClauseComponent.setSlidingStep(groupByClauseComponent.getUnit());
+      groupByClauseComponent.setSlidingStepByMonth(groupByClauseComponent.isIntervalByMonth());
     }
-    if (ctx.specialLimit() != null) {
-      return visit(ctx.specialLimit());
+
+    parseTimeInterval(ctx.timeInterval(), groupByClauseComponent);
+
+    if (ctx.LEVEL() != null && ctx.INTEGER_LITERAL() != null) {
+      int[] levels = new int[ctx.INTEGER_LITERAL().size()];
+      for (int i = 0; i < ctx.INTEGER_LITERAL().size(); i++) {
+        levels[i] = Integer.parseInt(ctx.INTEGER_LITERAL().get(i).getText());
+      }
+      groupByClauseComponent.setLevels(levels);
     }
-    return queryOp;
+    queryOp.setSpecialClauseComponent(groupByClauseComponent);
   }
 
-  @Override
-  public Operator visitGroupByFillStatement(GroupByFillStatementContext ctx) {
-    queryOp = new GroupByFillQueryOperator();
-    parseGroupByFillClause(ctx.groupByFillClause());
-    if (ctx.orderByTimeClause() != null) {
-      parseOrderByTimeClause(ctx.orderByTimeClause());
-    }
-    if (ctx.specialLimit() != null) {
-      return visit(ctx.specialLimit());
+  private void parseGroupByFillClause(IoTDBSqlParser.GroupByFillClauseContext ctx) {
+    GroupByFillClauseComponent groupByFillClauseComponent = new GroupByFillClauseComponent();
+    groupByFillClauseComponent.setLeftCRightO(ctx.timeInterval().LS_BRACKET() != null);
+
+    // parse timeUnit
+    groupByFillClauseComponent.setUnit(
+        DatetimeUtils.convertDurationStrToLong(ctx.DURATION_LITERAL().getText()));
+    groupByFillClauseComponent.setSlidingStep(groupByFillClauseComponent.getUnit());
+
+    parseTimeInterval(ctx.timeInterval(), groupByFillClauseComponent);
+
+    List<IoTDBSqlParser.TypeClauseContext> list = ctx.typeClause();
+    Map<TSDataType, IFill> fillTypes = new EnumMap<>(TSDataType.class);
+    for (IoTDBSqlParser.TypeClauseContext typeClause : list) {
+      // group by fill doesn't support linear fill
+      if (typeClause.linearClause() != null) {
+        throw new SQLParserException("group by fill doesn't support linear fill");
+      }
+      // all type use the same fill way
+      if (typeClause.ALL() != null) {
+        parseAllTypeClause(typeClause, fillTypes);
+        break;
+      } else {
+        parsePrimitiveTypeClause(typeClause, fillTypes);
+      }
     }
-    return queryOp;
+    groupByFillClauseComponent.setFillTypes(fillTypes);
+    queryOp.setSpecialClauseComponent(groupByFillClauseComponent);
   }
 
-  @Override
-  public Operator visitFillStatement(FillStatementContext ctx) {
-    queryOp = new FillQueryOperator();
-    parseFillClause(ctx.fillClause());
-    if (ctx.slimitClause() != null) {
-      parseSlimitClause(ctx.slimitClause());
-    }
-    if (ctx.alignByDeviceClauseOrDisableAlign() != null) {
-      parseAlignByDeviceClauseOrDisableAlign(ctx.alignByDeviceClauseOrDisableAlign());
+  public void parseGroupByLevelClause(IoTDBSqlParser.GroupByLevelClauseContext ctx) {
+    SpecialClauseComponent groupByLevelClauseComponent = new SpecialClauseComponent();
+    int[] levels = new int[ctx.INTEGER_LITERAL().size()];
+    for (int i = 0; i < ctx.INTEGER_LITERAL().size(); i++) {
+      levels[i] = Integer.parseInt(ctx.INTEGER_LITERAL().get(i).getText());
     }
-    return queryOp;
+    groupByLevelClauseComponent.setLevels(levels);
+
+    queryOp.setSpecialClauseComponent(groupByLevelClauseComponent);
   }
 
-  @Override
-  public Operator visitGroupByLevelStatement(GroupByLevelStatementContext ctx) {
-    queryOp = new AggregationQueryOperator();
-    parseGroupByLevelClause(ctx.groupByLevelClause());
-    if (ctx.orderByTimeClause() != null) {
-      parseOrderByTimeClause(ctx.orderByTimeClause());
-    }
-    if (ctx.specialLimit() != null) {
-      return visit(ctx.specialLimit());
-    }
-    return queryOp;
-  }
-
-  public void parseFromClause(FromClauseContext ctx) {
-    FromComponent fromComponent = new FromComponent();
-    List<PrefixPathContext> prefixFromPaths = ctx.prefixPath();
-    for (PrefixPathContext prefixFromPath : prefixFromPaths) {
-      PartialPath path = parsePrefixPath(prefixFromPath);
-      fromComponent.addPrefixTablePath(path);
-    }
-    queryOp.setFromComponent(fromComponent);
-  }
-
-  private void parseIndexPredicate(IndexPredicateClauseContext ctx) {
-    Map<String, Object> props;
-    PartialPath path;
-    if (ctx.suffixPath() != null) {
-      path = parseSuffixPath(ctx.suffixPath());
-    } else {
-      path = parseFullPath(ctx.fullPath());
-    }
-    if (ctx.LIKE() != null) {
-      // whole matching case
-      if (queryOp.getSelectComponent().getResultColumns().size() != 1) {
-        throw new SQLParserException("Index query statement allows only one select path");
-      }
-      if (!path.equals(
-          queryOp.getSelectComponent().getResultColumns().get(0).getExpression().toString())) {
-        throw new SQLParserException(
-            "In the index query statement, "
-                + "the path in select element and the index predicate should be same");
-      }
-      if (queryOp.getProps() != null) {
-        props = queryOp.getProps();
-      } else {
-        props = new HashMap<>();
-      }
-      props.put(PATTERN, parseSequence(ctx.sequenceClause(0)));
-      queryOp.setIndexType(IndexType.RTREE_PAA);
-    } else if (ctx.CONTAIN() != null) {
-      // subsequence matching case
-      List<double[]> compositePattern = new ArrayList<>();
-      List<Double> thresholds = new ArrayList<>();
-      for (int i = 0; i < ctx.sequenceClause().size(); i++) {
-        compositePattern.add(parseSequence(ctx.sequenceClause(i)));
-        thresholds.add(Double.parseDouble(ctx.constant(i).getText()));
-      }
-      if (queryOp.getProps() != null) {
-        props = queryOp.getProps();
-      } else {
-        props = new HashMap<>();
-      }
-      List<ResultColumn> resultColumns = new ArrayList<>();
-      resultColumns.add(new ResultColumn(new TimeSeriesOperand(path)));
-      queryOp.getSelectComponent().setResultColumns(resultColumns);
-      props.put(PATTERN, compositePattern);
-      props.put(THRESHOLD, thresholds);
-      queryOp.setIndexType(IndexType.ELB_INDEX);
-    } else {
-      throw new SQLParserException("Unknown index predicate: " + ctx);
-    }
-    queryOp.setProps(props);
-  }
-
-  private double[] parseSequence(SequenceClauseContext ctx) {
-    int seqLen = ctx.constant().size();
-    double[] sequence = new double[seqLen];
-    for (int i = 0; i < seqLen; i++) {
-      sequence[i] = Double.parseDouble(ctx.constant(i).getText());
-    }
-    return sequence;
-  }
-
-  public void parseGroupByLevelClause(GroupByLevelClauseContext ctx) {
-    SpecialClauseComponent groupByLevelClauseComponent = new SpecialClauseComponent();
-    int[] levels = new int[ctx.INT().size()];
-    for (int i = 0; i < ctx.INT().size(); i++) {
-      levels[i] = Integer.parseInt(ctx.INT().get(i).getText());
-    }
-    groupByLevelClauseComponent.setLevels(levels);
-
-    queryOp.setSpecialClauseComponent(groupByLevelClauseComponent);
-  }
-
-  public void parseFillClause(FillClauseContext ctx) {
+  public void parseFillClause(IoTDBSqlParser.FillClauseContext ctx) {
     FillClauseComponent fillClauseComponent = new FillClauseComponent();
-    List<TypeClauseContext> list = ctx.typeClause();
+    List<IoTDBSqlParser.TypeClauseContext> list = ctx.typeClause();
     Map<TSDataType, IFill> fillTypes = new EnumMap<>(TSDataType.class);
-    for (TypeClauseContext typeClause : list) {
+    for (IoTDBSqlParser.TypeClauseContext typeClause : list) {
       if (typeClause.ALL() != null) {
         if (typeClause.linearClause() != null) {
           throw new SQLParserException("fill all doesn't support linear fill");
@@ -1682,188 +1113,80 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     queryOp.setSpecialClauseComponent(fillClauseComponent);
   }
 
-  private void parseAllTypeClause(TypeClauseContext ctx, Map<TSDataType, IFill> fillTypes) {
-    IFill fill;
-    long preRange;
-    if (ctx.previousUntilLastClause() != null) {
-      if (ctx.previousUntilLastClause().DURATION() != null) {
-        preRange =
-            DatetimeUtils.convertDurationStrToLong(
-                ctx.previousUntilLastClause().DURATION().getText());
-      } else {
-        preRange = IoTDBDescriptor.getInstance().getConfig().getDefaultFillInterval();
-      }
-      fill = new PreviousFill(preRange, true);
-    } else {
-      if (ctx.previousClause().DURATION() != null) {
-        preRange =
-            DatetimeUtils.convertDurationStrToLong(ctx.previousClause().DURATION().getText());
-      } else {
-        preRange = IoTDBDescriptor.getInstance().getConfig().getDefaultFillInterval();
-      }
-      fill = new PreviousFill(preRange);
-    }
-    for (TSDataType tsDataType : TSDataType.values()) {
-      fillTypes.put(tsDataType, fill.copy());
-    }
-  }
-
-  private void parseLimitClause(LimitClauseContext ctx, Operator operator) {
-    int limit;
-    try {
-      limit = Integer.parseInt(ctx.INT().getText());
-    } catch (NumberFormatException e) {
-      throw new SQLParserException("Out of range. LIMIT <N>: N should be Int32.");
-    }
-    if (limit <= 0) {
-      throw new SQLParserException("LIMIT <N>: N should be greater than 0.");
-    }
-    if (operator instanceof ShowTimeSeriesOperator) {
-      ((ShowTimeSeriesOperator) operator).setLimit(limit);
-    } else if (operator instanceof ShowDevicesOperator) {
-      ((ShowDevicesOperator) operator).setLimit(limit);
+  private void parseTimeInterval(
+      IoTDBSqlParser.TimeIntervalContext timeInterval,
+      GroupByClauseComponent groupByClauseComponent) {
+    long startTime;
+    long endTime;
+    long currentTime = DatetimeUtils.currentTime();
+    if (timeInterval.datetimeLiteral(0).INTEGER_LITERAL() != null) {
+      startTime = Long.parseLong(timeInterval.datetimeLiteral(0).INTEGER_LITERAL().getText());
+    } else if (timeInterval.datetimeLiteral(0).dateExpression() != null) {
+      startTime =
+          parseDateExpression(timeInterval.datetimeLiteral(0).dateExpression(), currentTime);
     } else {
-      SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
-      if (specialClauseComponent == null) {
-        specialClauseComponent = new SpecialClauseComponent();
-      }
-      specialClauseComponent.setRowLimit(limit);
-      queryOp.setSpecialClauseComponent(specialClauseComponent);
-    }
-    if (ctx.offsetClause() != null) {
-      parseOffsetClause(ctx.offsetClause(), operator);
-    }
-  }
-
-  private void parseOffsetClause(OffsetClauseContext ctx, Operator operator) {
-    int offset;
-    try {
-      offset = Integer.parseInt(ctx.INT().getText());
-    } catch (NumberFormatException e) {
-      throw new SQLParserException(
-          "Out of range. OFFSET <OFFSETValue>: OFFSETValue should be Int32.");
-    }
-    if (offset < 0) {
-      throw new SQLParserException("OFFSET <OFFSETValue>: OFFSETValue should >= 0.");
-    }
-    if (operator instanceof ShowTimeSeriesOperator) {
-      ((ShowTimeSeriesOperator) operator).setOffset(offset);
-    } else if (operator instanceof ShowDevicesOperator) {
-      ((ShowDevicesOperator) operator).setOffset(offset);
+      startTime =
+          parseDateFormat(
+              timeInterval.datetimeLiteral(0).DATETIME_LITERAL().getText(), currentTime);
+    }
+    if (timeInterval.datetimeLiteral(1).INTEGER_LITERAL() != null) {
+      endTime = Long.parseLong(timeInterval.datetimeLiteral(1).INTEGER_LITERAL().getText());
+    } else if (timeInterval.datetimeLiteral(1).dateExpression() != null) {
+      endTime = parseDateExpression(timeInterval.datetimeLiteral(1).dateExpression(), currentTime);
     } else {
-      SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
-      if (specialClauseComponent == null) {
-        specialClauseComponent = new SpecialClauseComponent();
-      }
-      specialClauseComponent.setRowOffset(offset);
-      queryOp.setSpecialClauseComponent(specialClauseComponent);
+      endTime =
+          parseDateFormat(
+              timeInterval.datetimeLiteral(1).DATETIME_LITERAL().getText(), currentTime);
     }
-  }
 
-  private void parseSlimitClause(SlimitClauseContext ctx) {
-    int slimit;
-    try {
-      slimit = Integer.parseInt(ctx.INT().getText());
-    } catch (NumberFormatException e) {
-      throw new SQLParserException("Out of range. SLIMIT <SN>: SN should be Int32.");
-    }
-    if (slimit <= 0) {
-      throw new SQLParserException("SLIMIT <SN>: SN should be greater than 0.");
-    }
-    SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
-    if (specialClauseComponent == null) {
-      specialClauseComponent = new SpecialClauseComponent();
-    }
-    specialClauseComponent.setSeriesLimit(slimit);
-    queryOp.setSpecialClauseComponent(specialClauseComponent);
-    if (ctx.soffsetClause() != null) {
-      parseSoffsetClause(ctx.soffsetClause(), queryOp);
+    groupByClauseComponent.setStartTime(startTime);
+    groupByClauseComponent.setEndTime(endTime);
+    if (startTime >= endTime) {
+      throw new SQLParserException("Start time should be smaller than endTime in GroupBy");
     }
   }
 
-  public void parseSoffsetClause(SoffsetClauseContext ctx, QueryOperator queryOp) {
-    int soffset;
-    try {
-      soffset = Integer.parseInt(ctx.INT().getText());
-    } catch (NumberFormatException e) {
-      throw new SQLParserException(
-          "Out of range. SOFFSET <SOFFSETValue>: SOFFSETValue should be Int32.");
-    }
-    if (soffset < 0) {
-      throw new SQLParserException("SOFFSET <SOFFSETValue>: SOFFSETValue should >= 0.");
-    }
+  private void parseWithoutNullClause(IoTDBSqlParser.WithoutNullClauseContext ctx) {
     SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
     if (specialClauseComponent == null) {
       specialClauseComponent = new SpecialClauseComponent();
     }
-    specialClauseComponent.setSeriesOffset(soffset);
+    specialClauseComponent.setWithoutAnyNull(ctx.ANY() != null);
+    specialClauseComponent.setWithoutAllNull(ctx.ALL() != null);
     queryOp.setSpecialClauseComponent(specialClauseComponent);
   }
 
-  private void parseGroupByTimeClause(GroupByTimeClauseContext ctx) {
-    GroupByClauseComponent groupByClauseComponent = new GroupByClauseComponent();
-    groupByClauseComponent.setLeftCRightO(ctx.timeInterval().LS_BRACKET() != null);
-    // parse timeUnit
-    groupByClauseComponent.setUnit(
-        parseTimeUnitOrSlidingStep(ctx.DURATION(0).getText(), true, groupByClauseComponent));
-    // parse sliding step
-    if (ctx.DURATION().size() == 2) {
-      groupByClauseComponent.setSlidingStep(
-          parseTimeUnitOrSlidingStep(ctx.DURATION(1).getText(), false, groupByClauseComponent));
-      if (groupByClauseComponent.getSlidingStep() < groupByClauseComponent.getUnit()) {
-        throw new SQLParserException(
-            "The third parameter sliding step shouldn't be smaller than the second parameter time interval.");
+  private void parseAllTypeClause(
+      IoTDBSqlParser.TypeClauseContext ctx, Map<TSDataType, IFill> fillTypes) {
+    IFill fill;
+    long preRange;
+    if (ctx.previousUntilLastClause() != null) {
+      if (ctx.previousUntilLastClause().DURATION_LITERAL() != null) {
+        preRange =
+            DatetimeUtils.convertDurationStrToLong(
+                ctx.previousUntilLastClause().DURATION_LITERAL().getText());
+      } else {
+        preRange = IoTDBDescriptor.getInstance().getConfig().getDefaultFillInterval();
       }
+      fill = new PreviousFill(preRange, true);
     } else {
-      groupByClauseComponent.setSlidingStep(groupByClauseComponent.getUnit());
-      groupByClauseComponent.setSlidingStepByMonth(groupByClauseComponent.isIntervalByMonth());
-    }
-
-    parseTimeInterval(ctx.timeInterval(), groupByClauseComponent);
-
-    if (ctx.LEVEL() != null && ctx.INT() != null) {
-      int[] levels = new int[ctx.INT().size()];
-      for (int i = 0; i < ctx.INT().size(); i++) {
-        levels[i] = Integer.parseInt(ctx.INT().get(i).getText());
-      }
-      groupByClauseComponent.setLevels(levels);
-    }
-
-    queryOp.setSpecialClauseComponent(groupByClauseComponent);
-  }
-
-  private void parseGroupByFillClause(GroupByFillClauseContext ctx) {
-    GroupByFillClauseComponent groupByFillClauseComponent = new GroupByFillClauseComponent();
-    groupByFillClauseComponent.setLeftCRightO(ctx.timeInterval().LS_BRACKET() != null);
-
-    // parse timeUnit
-    groupByFillClauseComponent.setUnit(
-        DatetimeUtils.convertDurationStrToLong(ctx.DURATION().getText()));
-    groupByFillClauseComponent.setSlidingStep(groupByFillClauseComponent.getUnit());
-
-    parseTimeInterval(ctx.timeInterval(), groupByFillClauseComponent);
-
-    List<TypeClauseContext> list = ctx.typeClause();
-    Map<TSDataType, IFill> fillTypes = new EnumMap<>(TSDataType.class);
-    for (TypeClauseContext typeClause : list) {
-      // group by fill doesn't support linear fill
-      if (typeClause.linearClause() != null) {
-        throw new SQLParserException("group by fill doesn't support linear fill");
-      }
-      // all type use the same fill way
-      if (typeClause.ALL() != null) {
-        parseAllTypeClause(typeClause, fillTypes);
-        break;
+      if (ctx.previousClause().DURATION_LITERAL() != null) {
+        preRange =
+            DatetimeUtils.convertDurationStrToLong(
+                ctx.previousClause().DURATION_LITERAL().getText());
       } else {
-        parsePrimitiveTypeClause(typeClause, fillTypes);
+        preRange = IoTDBDescriptor.getInstance().getConfig().getDefaultFillInterval();
       }
+      fill = new PreviousFill(preRange);
+    }
+    for (TSDataType tsDataType : TSDataType.values()) {
+      fillTypes.put(tsDataType, fill.copy());
     }
-    groupByFillClauseComponent.setFillTypes(fillTypes);
-    queryOp.setSpecialClauseComponent(groupByFillClauseComponent);
   }
 
-  private void parsePrimitiveTypeClause(TypeClauseContext ctx, Map<TSDataType, IFill> fillTypes) {
-    TSDataType dataType = parseType(ctx.dataType().getText());
+  private void parsePrimitiveTypeClause(
+      IoTDBSqlParser.TypeClauseContext ctx, Map<TSDataType, IFill> fillTypes) {
+    TSDataType dataType = parseType(ctx.dataType.getText());
     if (ctx.linearClause() != null && dataType == TSDataType.TEXT) {
       throw new SQLParserException(
           String.format(
@@ -1874,19 +1197,22 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     int defaultFillInterval = IoTDBDescriptor.getInstance().getConfig().getDefaultFillInterval();
 
     if (ctx.linearClause() != null) { // linear
-      if (ctx.linearClause().DURATION(0) != null) {
+      if (ctx.linearClause().DURATION_LITERAL(0) != null) {
         long beforeRange =
-            DatetimeUtils.convertDurationStrToLong(ctx.linearClause().DURATION(0).getText());
+            DatetimeUtils.convertDurationStrToLong(
+                ctx.linearClause().DURATION_LITERAL(0).getText());
         long afterRange =
-            DatetimeUtils.convertDurationStrToLong(ctx.linearClause().DURATION(1).getText());
+            DatetimeUtils.convertDurationStrToLong(
+                ctx.linearClause().DURATION_LITERAL(1).getText());
         fillTypes.put(dataType, new LinearFill(beforeRange, afterRange));
       } else {
         fillTypes.put(dataType, new LinearFill(defaultFillInterval, defaultFillInterval));
       }
     } else if (ctx.previousClause() != null) { // previous
-      if (ctx.previousClause().DURATION() != null) {
+      if (ctx.previousClause().DURATION_LITERAL() != null) {
         long preRange =
-            DatetimeUtils.convertDurationStrToLong(ctx.previousClause().DURATION().getText());
+            DatetimeUtils.convertDurationStrToLong(
+                ctx.previousClause().DURATION_LITERAL().getText());
         fillTypes.put(dataType, new PreviousFill(preRange));
       } else {
         fillTypes.put(dataType, new PreviousFill(defaultFillInterval));
@@ -1899,10 +1225,10 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
         throw new SQLParserException("fill value cannot be null");
       }
     } else { // previous until last
-      if (ctx.previousUntilLastClause().DURATION() != null) {
+      if (ctx.previousUntilLastClause().DURATION_LITERAL() != null) {
         long preRange =
             DatetimeUtils.convertDurationStrToLong(
-                ctx.previousUntilLastClause().DURATION().getText());
+                ctx.previousUntilLastClause().DURATION_LITERAL().getText());
         fillTypes.put(dataType, new PreviousFill(preRange, true));
       } else {
         fillTypes.put(dataType, new PreviousFill(defaultFillInterval, true));
@@ -1910,7 +1236,6 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     }
   }
 
-  /** parse datatype node. */
   private TSDataType parseType(String datatype) {
     String type = datatype.toLowerCase();
     switch (type) {
@@ -1931,79 +1256,76 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     }
   }
 
-  private void parseOrderByTimeClause(OrderByTimeClauseContext ctx) {
-    if (ctx.DESC() != null) {
-      SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
-      if (specialClauseComponent == null) {
-        specialClauseComponent = new SpecialClauseComponent();
-      }
-      specialClauseComponent.setAscending(false);
-      queryOp.setSpecialClauseComponent(specialClauseComponent);
-    }
-  }
+  // Insert Statement
 
-  private void parseAlignByDeviceClause(SpecialClauseComponent specialClauseComponent) {
-    specialClauseComponent.setAlignByDevice(true);
-  }
-
-  private void parseDisableAlign(SpecialClauseComponent specialClauseComponent) {
-    specialClauseComponent.setAlignByTime(false);
+  @Override
+  public Operator visitInsertStatement(IoTDBSqlParser.InsertStatementContext ctx) {
+    InsertOperator insertOp = new InsertOperator(SQLConstant.TOK_INSERT);
+    insertOp.setDevice(parsePrefixPath(ctx.prefixPath()));
+    parseInsertColumnSpec(ctx.insertColumnsSpec(), insertOp);
+    parseInsertValuesSpec(ctx.insertValuesSpec(), insertOp);
+    return insertOp;
   }
 
-  private void parseTimeInterval(
-      TimeIntervalContext timeInterval, GroupByClauseComponent groupByClauseComponent) {
-    long startTime;
-    long endTime;
-    long currentTime = DatetimeUtils.currentTime();
-    if (timeInterval.timeValue(0).INT() != null) {
-      startTime = Long.parseLong(timeInterval.timeValue(0).INT().getText());
-    } else if (timeInterval.timeValue(0).dateExpression() != null) {
-      startTime = parseDateExpression(timeInterval.timeValue(0).dateExpression(), currentTime);
-    } else {
-      startTime = parseTimeFormat(timeInterval.timeValue(0).dateFormat().getText(), currentTime);
-    }
-    if (timeInterval.timeValue(1).INT() != null) {
-      endTime = Long.parseLong(timeInterval.timeValue(1).INT().getText());
-    } else if (timeInterval.timeValue(1).dateExpression() != null) {
-      endTime = parseDateExpression(timeInterval.timeValue(1).dateExpression(), currentTime);
-    } else {
-      endTime = parseTimeFormat(timeInterval.timeValue(1).dateFormat().getText(), currentTime);
+  private void parseInsertColumnSpec(
+      IoTDBSqlParser.InsertColumnsSpecContext ctx, InsertOperator insertOp) {
+    List<IoTDBSqlParser.MeasurementNameContext> measurementNames = ctx.measurementName();
+    List<String> measurementList = new ArrayList<>();
+    for (IoTDBSqlParser.MeasurementNameContext measurementName : measurementNames) {
+      String measurement = measurementName.getText();
+      measurementList.add(measurement);
     }
+    insertOp.setMeasurementList(measurementList.toArray(new String[0]));
+  }
 
-    groupByClauseComponent.setStartTime(startTime);
-    groupByClauseComponent.setEndTime(endTime);
-    if (startTime >= endTime) {
-      throw new SQLParserException("Start time should be smaller than endTime in GroupBy");
+  private void parseInsertValuesSpec(
+      IoTDBSqlParser.InsertValuesSpecContext ctx, InsertOperator insertOp) {
+    List<IoTDBSqlParser.InsertMultiValueContext> insertMultiValues = ctx.insertMultiValue();
+    List<String> valueList = new ArrayList<>();
+    long[] timeArray = new long[insertMultiValues.size()];
+    for (int i = 0; i < insertMultiValues.size(); i++) {
+      long timestamp;
+      if (insertMultiValues.get(i).DATETIME_LITERAL() != null) {
+        timestamp = parseDateFormat(insertMultiValues.get(i).DATETIME_LITERAL().getText());
+      } else if (insertMultiValues.get(i).INTEGER_LITERAL() != null) {
+        timestamp = Long.parseLong(insertMultiValues.get(i).INTEGER_LITERAL().getText());
+      } else if (insertMultiValues.size() != 1) {
+        throw new SQLParserException("need timestamps when insert multi rows");
+      } else {
+        timestamp = parseDateFormat(SQLConstant.NOW_FUNC);
+      }
+      timeArray[i] = timestamp;
+      List<IoTDBSqlParser.MeasurementValueContext> values =
+          insertMultiValues.get(i).measurementValue();
+      for (IoTDBSqlParser.MeasurementValueContext value : values) {
+        for (IoTDBSqlParser.ConstantContext counstant : value.constant()) {
+          valueList.add(counstant.getText());
+        }
+      }
     }
+    insertOp.setTimes(timeArray);
+    insertOp.setValueList(valueList.toArray(new String[0]));
   }
 
-  private void parseShowWhereClause(ShowWhereClauseContext ctx, ShowTimeSeriesOperator operator) {
-    PropertyValueContext propertyValueContext;
-    if (ctx.containsExpression() != null) {
-      operator.setContains(true);
-      propertyValueContext = ctx.containsExpression().propertyValue();
-      operator.setKey(ctx.containsExpression().ID().getText());
-    } else {
-      operator.setContains(false);
-      propertyValueContext = ctx.property().propertyValue();
-      operator.setKey(ctx.property().ID().getText());
+  // Delete Statement
+
+  @Override
+  public Operator visitDeleteStatement(IoTDBSqlParser.DeleteStatementContext ctx) {
+    DeleteDataOperator deleteDataOp = new DeleteDataOperator(SQLConstant.TOK_DELETE);
+    List<IoTDBSqlParser.PrefixPathContext> prefixPaths = ctx.prefixPath();
+    for (IoTDBSqlParser.PrefixPathContext prefixPath : prefixPaths) {
+      deleteDataOp.addPath(parsePrefixPath(prefixPath));
     }
-    String value;
-    if (propertyValueContext.stringLiteral() != null) {
-      value = removeStringQuote(propertyValueContext.getText());
+    if (ctx.whereClause() != null) {
+      WhereComponent whereComponent = parseWhereClause(ctx.whereClause());
+      Pair<Long, Long> timeInterval = parseDeleteTimeInterval(whereComponent.getFilterOperator());
+      deleteDataOp.setStartTime(timeInterval.left);
+      deleteDataOp.setEndTime(timeInterval.right);
     } else {
-      value = propertyValueContext.getText();
-    }
-    operator.setValue(value);
-  }
-
-  private String[] parsePrivilege(PrivilegesContext ctx) {
-    List<StringLiteralContext> privilegeList = ctx.stringLiteral();
-    List<String> privileges = new ArrayList<>();
-    for (StringLiteralContext privilege : privilegeList) {
-      privileges.add(removeStringQuote(privilege.getText()));
+      deleteDataOp.setStartTime(Long.MIN_VALUE);
+      deleteDataOp.setEndTime(Long.MAX_VALUE);
     }
-    return privileges.toArray(new String[0]);
+    return deleteDataOp;
   }
 
   private Pair<Long, Long> parseDeleteTimeInterval(FilterOperator filterOperator) {
@@ -2035,186 +1357,555 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     return parsedInterval;
   }
 
-  private Pair<Long, Long> calcOperatorInterval(FilterOperator filterOperator) {
+  /** 4. Data Control Language (DCL) */
 
-    if (filterOperator.getSinglePath() != null
-        && !IoTDBConstant.TIME.equals(filterOperator.getSinglePath().getMeasurement())) {
-      throw new SQLParserException(DELETE_ONLY_SUPPORT_TIME_EXP_ERROR_MSG);
-    }
+  // Create User
 
-    long time = Long.parseLong(((BasicFunctionOperator) filterOperator).getValue());
-    switch (filterOperator.getFilterType()) {
-      case LESSTHAN:
-        return new Pair<>(Long.MIN_VALUE, time - 1);
-      case LESSTHANOREQUALTO:
-        return new Pair<>(Long.MIN_VALUE, time);
-      case GREATERTHAN:
-        return new Pair<>(time + 1, Long.MAX_VALUE);
-      case GREATERTHANOREQUALTO:
-        return new Pair<>(time, Long.MAX_VALUE);
-      case EQUAL:
-        return new Pair<>(time, time);
-      default:
-        throw new SQLParserException(DELETE_RANGE_ERROR_MSG);
-    }
+  @Override
+  public Operator visitCreateUser(IoTDBSqlParser.CreateUserContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(SQLConstant.TOK_AUTHOR_CREATE, AuthorOperator.AuthorType.CREATE_USER);
+    authorOperator.setUserName(ctx.ID().getText());
+    authorOperator.setPassWord(removeStringQuote(ctx.password.getText()));
+    return authorOperator;
   }
 
-  public WhereComponent parseWhereClause(WhereClauseContext ctx) {
-    if (ctx.indexPredicateClause() != null) {
-      parseIndexPredicate(ctx.indexPredicateClause());
-      return null;
-    }
-    FilterOperator whereOp = new FilterOperator();
-    whereOp.addChildOperator(parseOrExpression(ctx.orExpression()));
-    return new WhereComponent(whereOp.getChildren().get(0));
-  }
+  // Create Role
 
-  private FilterOperator parseOrExpression(OrExpressionContext ctx) {
-    if (ctx.andExpression().size() == 1) {
-      return parseAndExpression(ctx.andExpression(0));
-    }
-    FilterOperator binaryOp = new FilterOperator(FilterType.KW_OR);
-    if (ctx.andExpression().size() > 2) {
-      binaryOp.addChildOperator(parseAndExpression(ctx.andExpression(0)));
-      binaryOp.addChildOperator(parseAndExpression(ctx.andExpression(1)));
-      for (int i = 2; i < ctx.andExpression().size(); i++) {
-        FilterOperator op = new FilterOperator(FilterType.KW_OR);
-        op.addChildOperator(binaryOp);
-        op.addChildOperator(parseAndExpression(ctx.andExpression(i)));
-        binaryOp = op;
-      }
-    } else {
-      for (AndExpressionContext andExpressionContext : ctx.andExpression()) {
-        binaryOp.addChildOperator(parseAndExpression(andExpressionContext));
-      }
-    }
-    return binaryOp;
+  @Override
+  public Operator visitCreateRole(IoTDBSqlParser.CreateRoleContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(SQLConstant.TOK_AUTHOR_CREATE, AuthorOperator.AuthorType.CREATE_ROLE);
+    authorOperator.setRoleName(ctx.ID().getText());
+    return authorOperator;
   }
 
-  private FilterOperator parseAndExpression(AndExpressionContext ctx) {
-    if (ctx.predicate().size() == 1) {
-      return parsePredicate(ctx.predicate(0));
-    }
-    FilterOperator binaryOp = new FilterOperator(FilterType.KW_AND);
-    int size = ctx.predicate().size();
-    if (size > 2) {
-      binaryOp.addChildOperator(parsePredicate(ctx.predicate(0)));
-      binaryOp.addChildOperator(parsePredicate(ctx.predicate(1)));
-      for (int i = 2; i < size; i++) {
-        FilterOperator op = new FilterOperator(FilterType.KW_AND);
-        op.addChildOperator(binaryOp);
-        op.addChildOperator(parsePredicate(ctx.predicate(i)));
-        binaryOp = op;
-      }
-    } else {
-      for (PredicateContext predicateContext : ctx.predicate()) {
-        binaryOp.addChildOperator(parsePredicate(predicateContext));
-      }
-    }
-    return binaryOp;
-  }
+  // Alter Password
 
-  @SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning
-  private FilterOperator parsePredicate(PredicateContext ctx) {
-    PartialPath path = null;
-    if (ctx.OPERATOR_NOT() != null) {
-      FilterOperator notOp = new FilterOperator(FilterType.KW_NOT);
-      notOp.addChildOperator(parseOrExpression(ctx.orExpression()));
-      return notOp;
-    } else if (ctx.LR_BRACKET() != null && ctx.OPERATOR_NOT() == null) {
-      return parseOrExpression(ctx.orExpression());
-    } else if (ctx.REGEXP() != null || ctx.LIKE() != null) {
-      if (ctx.suffixPath() != null) {
-        path = parseSuffixPath(ctx.suffixPath());
-      } else if (ctx.fullPath() != null) {
-        path = parseFullPath(ctx.fullPath());
-      }
-      if (path == null) {
-        throw new SQLParserException("Path is null, please check the sql.");
-      }
-      return ctx.REGEXP() != null
-          ? new RegexpOperator(FilterType.REGEXP, path, ctx.stringLiteral().getText())
-          : new LikeOperator(FilterType.LIKE, path, ctx.stringLiteral().getText());
-    } else {
-      if (ctx.TIME() != null || ctx.TIMESTAMP() != null) {
-        path = new PartialPath(SQLConstant.getSingleTimeArray());
-      }
-      if (ctx.fullPath() != null) {
-        path = parseFullPath(ctx.fullPath());
-      }
-      if (ctx.suffixPath() != null) {
-        path = parseSuffixPath(ctx.suffixPath());
-      }
-      if (path == null) {
-        throw new SQLParserException("Path is null, please check the sql.");
-      }
-      if (ctx.inClause() != null) {
-        return parseInOperator(ctx.inClause(), path);
-      } else {
-        return parseBasicFunctionOperator(ctx, path);
-      }
-    }
+  @Override
+  public Operator visitAlterUser(IoTDBSqlParser.AlterUserContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(
+            SQLConstant.TOK_AUTHOR_UPDATE_USER, AuthorOperator.AuthorType.UPDATE_USER);
+    authorOperator.setUserName(ctx.userName.getText());
+    authorOperator.setNewPassword(removeStringQuote(ctx.password.getText()));
+    return authorOperator;
   }
 
-  private FilterOperator parseInOperator(InClauseContext ctx, PartialPath path) {
-    Set<String> values = new HashSet<>();
-    boolean not = ctx.OPERATOR_NOT() != null;
-    for (ConstantContext constant : ctx.constant()) {
-      if (constant.dateExpression() != null) {
-        if (!path.equals(TIME_PATH)) {
-          throw new SQLParserException(path.getFullPath(), "Date can only be used to time");
-        }
-        values.add(Long.toString(parseDateExpression(constant.dateExpression())));
-      } else {
-        values.add(constant.getText());
-      }
-    }
-    return new InOperator(FilterType.IN, path, not, values);
+  // Grant User Privileges
+
+  @Override
+  public Operator visitGrantUser(IoTDBSqlParser.GrantUserContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorOperator.AuthorType.GRANT_USER);
+    authorOperator.setUserName(ctx.ID().getText());
+    authorOperator.setPrivilegeList(parsePrivilege(ctx.privileges()));
+    authorOperator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
+    return authorOperator;
   }
 
-  private FilterOperator parseBasicFunctionOperator(PredicateContext ctx, PartialPath path) {
-    BasicFunctionOperator basic;
-    if (ctx.constant().dateExpression() != null) {
-      if (!path.equals(TIME_PATH)) {
-        throw new SQLParserException(path.getFullPath(), "Date can only be used to time");
-      }
-      basic =
-          new BasicFunctionOperator(
-              FilterConstant.lexerToFilterType.get(ctx.comparisonOperator().type.getType()),
-              path,
-              Long.toString(parseDateExpression(ctx.constant().dateExpression())));
-    } else {
-      basic =
-          new BasicFunctionOperator(
-              FilterConstant.lexerToFilterType.get(ctx.comparisonOperator().type.getType()),
-              path,
-              ctx.constant().getText());
-    }
-    return basic;
+  // Grant Role Privileges
+
+  @Override
+  public Operator visitGrantRole(IoTDBSqlParser.GrantRoleContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.GRANT_ROLE);
+    authorOperator.setRoleName(ctx.ID().getText());
+    authorOperator.setPrivilegeList(parsePrivilege(ctx.privileges()));
+    authorOperator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
+    return authorOperator;
   }
 
-  /**
-   * parse time expression, which is addition and subtraction expression of duration time, now() or
-   * DataTimeFormat time.
-   *
-   * <p>eg. now() + 1d - 2h
-   */
-  private Long parseDateExpression(DateExpressionContext ctx) {
-    long time;
-    time = parseTimeFormat(ctx.getChild(0).getText());
-    for (int i = 1; i < ctx.getChildCount(); i = i + 2) {
-      if (ctx.getChild(i).getText().equals("+")) {
-        time += DatetimeUtils.convertDurationStrToLong(time, ctx.getChild(i + 1).getText());
-      } else {
-        time -= DatetimeUtils.convertDurationStrToLong(time, ctx.getChild(i + 1).getText());
-      }
-    }
-    return time;
+  // Grant User Role
+
+  @Override
+  public Operator visitGrantRoleToUser(IoTDBSqlParser.GrantRoleToUserContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(
+            SQLConstant.TOK_AUTHOR_GRANT, AuthorOperator.AuthorType.GRANT_ROLE_TO_USER);
+    authorOperator.setRoleName(ctx.roleName.getText());
+    authorOperator.setUserName(ctx.userName.getText());
+    return authorOperator;
   }
 
-  private Long parseDateExpression(DateExpressionContext ctx, long currentTime) {
+  // Revoke User Privileges
+
+  @Override
+  public Operator visitRevokeUser(IoTDBSqlParser.RevokeUserContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.REVOKE_USER);
+    authorOperator.setUserName(ctx.ID().getText());
+    authorOperator.setPrivilegeList(parsePrivilege(ctx.privileges()));
+    authorOperator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
+    return authorOperator;
+  }
+
+  // Revoke Role Privileges
+
+  @Override
+  public Operator visitRevokeRole(IoTDBSqlParser.RevokeRoleContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.REVOKE_ROLE);
+    authorOperator.setRoleName(ctx.ID().getText());
+    authorOperator.setPrivilegeList(parsePrivilege(ctx.privileges()));
+    authorOperator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
+    return authorOperator;
+  }
+
+  // Revoke Role From User
+
+  @Override
+  public Operator visitRevokeRoleFromUser(IoTDBSqlParser.RevokeRoleFromUserContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(SQLConstant.TOK_AUTHOR_GRANT, AuthorType.REVOKE_ROLE_FROM_USER);
+    authorOperator.setRoleName(ctx.roleName.getText());
+    authorOperator.setUserName(ctx.userName.getText());
+    return authorOperator;
+  }
+
+  // Drop User
+
+  @Override
+  public Operator visitDropUser(IoTDBSqlParser.DropUserContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(SQLConstant.TOK_AUTHOR_DROP, AuthorOperator.AuthorType.DROP_USER);
+    authorOperator.setUserName(ctx.ID().getText());
+    return authorOperator;
+  }
+
+  // Drop Role
+
+  @Override
+  public Operator visitDropRole(IoTDBSqlParser.DropRoleContext ctx) {
+    AuthorOperator authorOperator =
+        new AuthorOperator(SQLConstant.TOK_AUTHOR_DROP, AuthorOperator.AuthorType.DROP_ROLE);
+    authorOperator.setRoleName(ctx.ID().getText());
+    return authorOperator;
+  }
+
+  // List Users
+
+  @Override
+  public Operator visitListUser(IoTDBSqlParser.ListUserContext ctx) {
+    return new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER);
+  }
+
+  // List Roles
+
+  @Override
+  public Operator visitListRole(IoTDBSqlParser.ListRoleContext ctx) {
+    return new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE);
+  }
+
+  // List Privileges
+
+  @Override
+  public Operator visitListPrivilegesUser(IoTDBSqlParser.ListPrivilegesUserContext ctx) {
+    AuthorOperator operator =
+        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER_PRIVILEGE);
+    operator.setUserName(ctx.userName.getText());
+    operator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
+    return operator;
+  }
+
+  // List Privileges of Roles On Specific Path
+
+  @Override
+  public Operator visitListPrivilegesRole(IoTDBSqlParser.ListPrivilegesRoleContext ctx) {
+    AuthorOperator operator =
+        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE_PRIVILEGE);
+    operator.setRoleName((ctx.ID().getText()));
+    operator.setNodeNameList(parsePrefixPath(ctx.prefixPath()));
+    return operator;
+  }
+
+  // List Privileges of Users
+
+  @Override
+  public Operator visitListUserPrivileges(IoTDBSqlParser.ListUserPrivilegesContext ctx) {
+    AuthorOperator operator =
+        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER_PRIVILEGE);
+    operator.setUserName(ctx.userName.getText());
+    return operator;
+  }
+
+  // List Privileges of Roles
+
+  @Override
+  public Operator visitListRolePrivileges(IoTDBSqlParser.ListRolePrivilegesContext ctx) {
+    AuthorOperator operator =
+        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE_PRIVILEGE);
+    operator.setRoleName(ctx.ID().getText());
+    return operator;
+  }
+
+  // List Roles of Users
+
+  @Override
+  public Operator visitListAllRoleOfUser(IoTDBSqlParser.ListAllRoleOfUserContext ctx) {
+    AuthorOperator operator =
+        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_USER_ROLES);
+    operator.setUserName(ctx.userName.getText());
+    return operator;
+  }
+
+  // List Users of Role
+
+  @Override
+  public Operator visitListAllUserOfRole(IoTDBSqlParser.ListAllUserOfRoleContext ctx) {
+    AuthorOperator operator =
+        new AuthorOperator(SQLConstant.TOK_LIST, AuthorOperator.AuthorType.LIST_ROLE_USERS);
+    operator.setRoleName((ctx.ID().getText()));
+    return operator;
+  }
+
+  private String[] parsePrivilege(IoTDBSqlParser.PrivilegesContext ctx) {
+    List<IoTDBSqlParser.PrivilegeValueContext> privilegeList = ctx.privilegeValue();
+    List<String> privileges = new ArrayList<>();
+    for (IoTDBSqlParser.PrivilegeValueContext privilegeValue : privilegeList) {
+      privileges.add(privilegeValue.getText());
+    }
+    return privileges.toArray(new String[0]);
+  }
+
+  /** 5. Utility Statements */
+
+  // Merge
+
+  @Override
+  public Operator visitMerge(IoTDBSqlParser.MergeContext ctx) {
+    return new MergeOperator(SQLConstant.TOK_MERGE);
+  }
+
+  // Full Merge
+
+  @Override
+  public Operator visitFullMerge(IoTDBSqlParser.FullMergeContext ctx) {
+    return new MergeOperator(SQLConstant.TOK_FULL_MERGE);
+  }
+
+  // Flush
+
+  @Override
+  public Operator visitFlush(IoTDBSqlParser.FlushContext ctx) {
+    FlushOperator flushOperator = new FlushOperator(SQLConstant.TOK_FLUSH);
+    if (ctx.BOOLEAN_LITERAL() != null) {
+      flushOperator.setSeq(Boolean.parseBoolean(ctx.BOOLEAN_LITERAL().getText()));
+    }
+    if (ctx.prefixPath(0) != null) {
+      List<PartialPath> storageGroups = new ArrayList<>();
+      for (IoTDBSqlParser.PrefixPathContext prefixPathContext : ctx.prefixPath()) {
+        storageGroups.add(parsePrefixPath(prefixPathContext));
+      }
+      flushOperator.setStorageGroupList(storageGroups);
+    }
+    return flushOperator;
+  }
+
+  // Clear Cache
+
+  @Override
+  public Operator visitClearCache(IoTDBSqlParser.ClearCacheContext ctx) {
+    return new ClearCacheOperator(SQLConstant.TOK_CLEAR_CACHE);
+  }
+
+  // Settle
+
+  @Override
+  public Operator visitSettle(IoTDBSqlParser.SettleContext ctx) {
+    SettleOperator settleOperator = new SettleOperator(SQLConstant.TOK_SETTLE);
+    if (ctx.prefixPath() != null) {
+      // Storage Group
+      PartialPath sgPath = parsePrefixPath(ctx.prefixPath());
+      settleOperator.setSgPath(sgPath);
+      settleOperator.setIsSgPath(true);
+    } else {
+      // TsFile Path
+      String tsFilePath = removeStringQuote(ctx.tsFilePath.getText());
+      settleOperator.setTsFilePath(tsFilePath);
+      settleOperator.setIsSgPath(false);
+    }
+    return settleOperator;
+  }
+
+  // Set System To ReadOnly/Writable
+
+  @Override
+  public Operator visitSetSystemStatus(IoTDBSqlParser.SetSystemStatusContext ctx) {
+    if (ctx.READONLY() != null) {
+      // Set system to ReadOnly
+      return new SetSystemModeOperator(SQLConstant.TOK_SET_SYSTEM_MODE, true);
+    } else {
+      // Set system to Writable
+      return new SetSystemModeOperator(SQLConstant.TOK_SET_SYSTEM_MODE, false);
+    }
+  }
+
+  // Show Version
+
+  @Override
+  public Operator visitShowVersion(IoTDBSqlParser.ShowVersionContext ctx) {
+    return new ShowOperator(SQLConstant.TOK_VERSION);
+  }
+
+  // Show Flush Info
+
+  @Override
+  public Operator visitShowFlushInfo(IoTDBSqlParser.ShowFlushInfoContext ctx) {
+    return new ShowOperator(SQLConstant.TOK_FLUSH_TASK_INFO);
+  }
+
+  // Show Lock Info
+
+  @Override
+  public Operator visitShowLockInfo(IoTDBSqlParser.ShowLockInfoContext ctx) {
+    if (ctx.prefixPath() != null) {
+      return new ShowLockInfoOperator(SQLConstant.TOK_LOCK_INFO, parsePrefixPath(ctx.prefixPath()));
+    } else {
+      return new ShowLockInfoOperator(
+          SQLConstant.TOK_LOCK_INFO, new PartialPath(SQLConstant.getSingleRootArray()));
+    }
+  }
+
+  // Show Merge Info
+
+  @Override
+  public Operator visitShowMergeInfo(IoTDBSqlParser.ShowMergeInfoContext ctx) {
+    return new ShowMergeStatusOperator(SQLConstant.TOK_SHOW_MERGE_STATUS);
+  }
+
+  // Show Query Processlist
+
+  @Override
+  public Operator visitShowQueryProcesslist(IoTDBSqlParser.ShowQueryProcesslistContext ctx) {
+    return new ShowOperator(SQLConstant.TOK_QUERY_PROCESSLIST);
+  }
+
+  // Kill Query
+
+  @Override
+  public Operator visitKillQuery(IoTDBSqlParser.KillQueryContext ctx) {
+    KillQueryOperator killQueryOperator = new KillQueryOperator(TOK_KILL_QUERY);
+    if (ctx.INTEGER_LITERAL() != null) {
+      killQueryOperator.setQueryId(Integer.parseInt(ctx.INTEGER_LITERAL().getText()));
+    }
+    return killQueryOperator;
+  }
+
+  // Grant Watermark Embedding
+
+  @Override
+  public Operator visitGrantWatermarkEmbedding(IoTDBSqlParser.GrantWatermarkEmbeddingContext ctx) {
+    List<IoTDBSqlParser.UsernameWithRootContext> usernameList = ctx.usernameWithRoot();
+    List<String> users = new ArrayList<>();
+    for (IoTDBSqlParser.UsernameWithRootContext username : usernameList) {
+      users.add(username.getText());
+    }
+    return new DataAuthOperator(SQLConstant.TOK_GRANT_WATERMARK_EMBEDDING, users);
+  }
+
+  // Revoke Watermark Embedding
+
+  @Override
+  public Operator visitRevokeWatermarkEmbedding(
+      IoTDBSqlParser.RevokeWatermarkEmbeddingContext ctx) {
+    List<IoTDBSqlParser.UsernameWithRootContext> usernameList = ctx.usernameWithRoot();
+    List<String> users = new ArrayList<>();
+    for (IoTDBSqlParser.UsernameWithRootContext username : usernameList) {
+      users.add(username.getText());
+    }
+    return new DataAuthOperator(SQLConstant.TOK_REVOKE_WATERMARK_EMBEDDING, users);
+  }
+
+  // Load Configuration
+
+  @Override
+  public Operator visitLoadConfiguration(IoTDBSqlParser.LoadConfigurationContext ctx) {
+    if (ctx.GLOBAL() != null) {
+      return new LoadConfigurationOperator(LoadConfigurationOperatorType.GLOBAL);
+    } else {
+      return new LoadConfigurationOperator(LoadConfigurationOperatorType.LOCAL);
+    }
+  }
+
+  // Load Timeseries
+
+  @Override
+  public Operator visitLoadTimeseries(IoTDBSqlParser.LoadTimeseriesContext ctx) {
+    if (ctx.prefixPath().nodeName().size() < 3) {
+      throw new SQLParserException("data load command: child count < 3\n");
+    }
+
+    String csvPath = ctx.fileName.getText();
+    StringContainer sc = new StringContainer(TsFileConstant.PATH_SEPARATOR);
+    List<IoTDBSqlParser.NodeNameContext> nodeNames = ctx.prefixPath().nodeName();
+    sc.addTail(ctx.prefixPath().ROOT().getText());
+    for (IoTDBSqlParser.NodeNameContext nodeName : nodeNames) {
+      sc.addTail(nodeName.getText());
+    }
+    return new LoadDataOperator(
+        SQLConstant.TOK_DATALOAD, removeStringQuote(csvPath), sc.toString());
+  }
+
+  // Load TsFile
+
+  @Override
+  public Operator visitLoadFile(IoTDBSqlParser.LoadFileContext ctx) {
+    LoadFilesOperator loadFilesOperator =
+        new LoadFilesOperator(
+            new File(removeStringQuote(ctx.fileName.getText())),
+            true,
+            IoTDBDescriptor.getInstance().getConfig().getDefaultStorageGroupLevel(),
+            true);
+    if (ctx.loadFilesClause() != null) {
+      parseLoadFiles(loadFilesOperator, ctx.loadFilesClause());
+    }
+    return loadFilesOperator;
+  }
+
+  /**
+   * used for parsing load tsfile, context will be one of "SCHEMA, LEVEL, METADATA", and maybe
+   * followed by a recursion property statement
+   *
+   * @param operator the result operator, setting by clause context
+   * @param ctx context of property statement
+   */
+  private void parseLoadFiles(
+      LoadFilesOperator operator, IoTDBSqlParser.LoadFilesClauseContext ctx) {
+    if (ctx.AUTOREGISTER() != null) {
+      operator.setAutoCreateSchema(Boolean.parseBoolean(ctx.BOOLEAN_LITERAL().getText()));
+    } else if (ctx.SGLEVEL() != null) {
+      operator.setSgLevel(Integer.parseInt(ctx.INTEGER_LITERAL().getText()));
+    } else if (ctx.VERIFY() != null) {
+      operator.setVerifyMetadata(Boolean.parseBoolean(ctx.BOOLEAN_LITERAL().getText()));
+    } else {
+      throw new SQLParserException(
+          String.format(
+              "load tsfile format %s error, please input AUTOREGISTER | SGLEVEL | VERIFY.",
+              ctx.getText()));
+    }
+    if (ctx.loadFilesClause() != null) {
+      parseLoadFiles(operator, ctx.loadFilesClause());
+    }
+  }
+
+  // Remove TsFile
+
+  @Override
+  public Operator visitRemoveFile(IoTDBSqlParser.RemoveFileContext ctx) {
+    return new RemoveFileOperator(new File(removeStringQuote(ctx.fileName.getText())));
+  }
+
+  // Unload TsFile
+
+  @Override
+  public Operator visitUnloadFile(IoTDBSqlParser.UnloadFileContext ctx) {
+    return new UnloadFileOperator(
+        new File(removeStringQuote(ctx.srcFileName.getText())),
+        new File(removeStringQuote(ctx.dstFileDir.getText())));
+  }
+
+  /** 6. Common Clauses */
+
+  // IoTDB Objects
+
+  private PartialPath parseFullPath(IoTDBSqlParser.FullPathContext ctx) {
+    List<IoTDBSqlParser.NodeNameWithoutWildcardContext> nodeNamesWithoutStar =
+        ctx.nodeNameWithoutWildcard();
+    String[] path = new String[nodeNamesWithoutStar.size() + 1];
+    int i = 0;
+    if (ctx.ROOT() != null) {
+      path[0] = ctx.ROOT().getText();
+    }
+    for (IoTDBSqlParser.NodeNameWithoutWildcardContext nodeNameWithoutStar : nodeNamesWithoutStar) {
+      i++;
+      path[i] = nodeNameWithoutStar.getText();
+    }
+    return new PartialPath(path);
+  }
+
+  private PartialPath parsePrefixPath(IoTDBSqlParser.PrefixPathContext ctx) {
+    List<IoTDBSqlParser.NodeNameContext> nodeNames = ctx.nodeName();
+    String[] path = new String[nodeNames.size() + 1];
+    path[0] = ctx.ROOT().getText();
+    for (int i = 0; i < nodeNames.size(); i++) {
+      path[i + 1] = nodeNames.get(i).getText();
+    }
+    return new PartialPath(path);
+  }
+
+  private PartialPath parseSuffixPath(IoTDBSqlParser.SuffixPathContext ctx) {
+    List<IoTDBSqlParser.NodeNameContext> nodeNames = ctx.nodeName();
+    String[] path = new String[nodeNames.size()];
+    for (int i = 0; i < nodeNames.size(); i++) {
+      path[i] = nodeNames.get(i).getText();
+    }
+    return new PartialPath(path);
+  }
+
+  /** function for parsing datetime literal. */
+  public long parseDateFormat(String timestampStr) throws SQLParserException {
+    if (timestampStr == null || timestampStr.trim().equals("")) {
+      throw new SQLParserException("input timestamp cannot be empty");
+    }
+    if (timestampStr.equalsIgnoreCase(SQLConstant.NOW_FUNC)) {
+      return DatetimeUtils.currentTime();
+    }
+    try {
+      return DatetimeUtils.convertDatetimeStrToLong(timestampStr, zoneId);
+    } catch (Exception e) {
+      throw new SQLParserException(
+          String.format(
+              "Input time format %s error. "
+                  + "Input like yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss or "
+                  + "refer to user document for more info.",
+              timestampStr));
+    }
+  }
+
+  public long parseDateFormat(String timestampStr, long currentTime) throws SQLParserException {
+    if (timestampStr == null || timestampStr.trim().equals("")) {
+      throw new SQLParserException("input timestamp cannot be empty");
+    }
+    if (timestampStr.equalsIgnoreCase(SQLConstant.NOW_FUNC)) {
+      return currentTime;
+    }
+    try {
+      return DatetimeUtils.convertDatetimeStrToLong(timestampStr, zoneId);
+    } catch (Exception e) {
+      throw new SQLParserException(
+          String.format(
+              "Input time format %s error. "
+                  + "Input like yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss or "
+                  + "refer to user document for more info.",
+              timestampStr));
+    }
+  }
+
+  // Expression & Predicate
+
+  /**
+   * parse time expression, which is addition and subtraction expression of duration time, now() or
+   * DataTimeFormat time.
+   *
+   * <p>eg. now() + 1d - 2h
+   */
+  private Long parseDateExpression(IoTDBSqlParser.DateExpressionContext ctx) {
+    long time;
+    time = parseDateFormat(ctx.getChild(0).getText());
+    for (int i = 1; i < ctx.getChildCount(); i = i + 2) {
+      if (ctx.getChild(i).getText().equals("+")) {
+        time += DatetimeUtils.convertDurationStrToLong(time, ctx.getChild(i + 1).getText());
+      } else {
+        time -= DatetimeUtils.convertDurationStrToLong(time, ctx.getChild(i + 1).getText());
+      }
+    }
+    return time;
+  }
+
+  private Long parseDateExpression(IoTDBSqlParser.DateExpressionContext ctx, long currentTime) {
     long time;
-    time = parseTimeFormat(ctx.getChild(0).getText(), currentTime);
+    time = parseDateFormat(ctx.getChild(0).getText(), currentTime);
     for (int i = 1; i < ctx.getChildCount(); i = i + 2) {
       if (ctx.getChild(i).getText().equals("+")) {
         time += DatetimeUtils.convertDurationStrToLong(time, ctx.getChild(i + 1).getText());
@@ -2222,134 +1913,452 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
         time -= DatetimeUtils.convertDurationStrToLong(time, ctx.getChild(i + 1).getText());
       }
     }
-    return time;
+    return time;
+  }
+
+  @SuppressWarnings("squid:S3776")
+  private Expression parseExpression(IoTDBSqlParser.ExpressionContext context) {
+    // LR_BRACKET unaryInBracket=expression RR_BRACKET
+    if (context.unaryInBracket != null) {
+      return parseExpression(context.unaryInBracket);
+    }
+
+    // (PLUS | MINUS) unaryAfterSign=expression
+    if (context.unaryAfterSign != null) {
+      return context.MINUS() != null
+          ? new NegationExpression(parseExpression(context.unaryAfterSign))
+          : parseExpression(context.unaryAfterSign);
+    }
+
+    // leftExpression=expression (STAR | DIV | MOD) rightExpression=expression
+    // leftExpression=expression (PLUS | MINUS) rightExpression=expression
+    if (context.leftExpression != null && context.rightExpression != null) {
+      Expression leftExpression = parseExpression(context.leftExpression);
+      Expression rightExpression = parseExpression(context.rightExpression);
+      if (context.STAR() != null) {
+        return new MultiplicationExpression(leftExpression, rightExpression);
+      }
+      if (context.DIV() != null) {
+        return new DivisionExpression(leftExpression, rightExpression);
+      }
+      if (context.MOD() != null) {
+        return new ModuloExpression(leftExpression, rightExpression);
+      }
+      if (context.PLUS() != null) {
+        return new AdditionExpression(leftExpression, rightExpression);
+      }
+      if (context.MINUS() != null) {
+        return new SubtractionExpression(leftExpression, rightExpression);
+      }
+    }
+
+    // functionName=suffixPath LR_BRACKET expression (COMMA expression)* functionAttribute*
+    // RR_BRACKET
+    if (context.functionName() != null) {
+      return parseFunctionExpression(context);
+    }
+
+    // suffixPath
+    if (context.suffixPath() != null) {
+      return new TimeSeriesOperand(parseSuffixPath(context.suffixPath()));
+    }
+
+    // literal=SINGLE_QUOTE_STRING_LITERAL
+    if (context.literal != null) {
+      return new TimeSeriesOperand(new PartialPath(new String[] {context.literal.getText()}));
+    }
+
+    throw new UnsupportedOperationException();
+  }
+
+  private Expression parseFunctionExpression(IoTDBSqlParser.ExpressionContext functionClause) {
+    FunctionExpression functionExpression =
+        new FunctionExpression(functionClause.functionName().getText());
+
+    // expressions
+    for (IoTDBSqlParser.ExpressionContext expression : functionClause.expression()) {
+      functionExpression.addExpression(parseExpression(expression));
+    }
+
+    // attributes
+    for (IoTDBSqlParser.FunctionAttributeContext functionAttribute :
+        functionClause.functionAttribute()) {
+      functionExpression.addAttribute(
+          removeStringQuote(functionAttribute.functionAttributeKey.getText()),
+          removeStringQuote(functionAttribute.functionAttributeValue.getText()));
+    }
+
+    return functionExpression;
+  }
+
+  private FilterOperator parseOrExpression(IoTDBSqlParser.OrExpressionContext ctx) {
+    if (ctx.andExpression().size() == 1) {
+      return parseAndExpression(ctx.andExpression(0));
+    }
+    FilterOperator binaryOp = new FilterOperator(FilterType.KW_OR);
+    if (ctx.andExpression().size() > 2) {
+      binaryOp.addChildOperator(parseAndExpression(ctx.andExpression(0)));
+      binaryOp.addChildOperator(parseAndExpression(ctx.andExpression(1)));
+      for (int i = 2; i < ctx.andExpression().size(); i++) {
+        FilterOperator op = new FilterOperator(FilterType.KW_OR);
+        op.addChildOperator(binaryOp);
+        op.addChildOperator(parseAndExpression(ctx.andExpression(i)));
+        binaryOp = op;
+      }
+    } else {
+      for (IoTDBSqlParser.AndExpressionContext andExpressionContext : ctx.andExpression()) {
+        binaryOp.addChildOperator(parseAndExpression(andExpressionContext));
+      }
+    }
+    return binaryOp;
   }
 
-  /**
-   * parse time unit or sliding step in group by query.
-   *
-   * @param durationStr represent duration string like: 12d8m9ns, 1y1d, etc.
-   * @return time in milliseconds, microseconds, or nanoseconds depending on the profile
-   */
-  private long parseTimeUnitOrSlidingStep(
-      String durationStr, boolean isParsingTimeUnit, GroupByClauseComponent groupByComponent) {
-    if (durationStr.toLowerCase().contains("mo")) {
-      if (isParsingTimeUnit) {
-        groupByComponent.setIntervalByMonth(true);
+  private FilterOperator parseAndExpression(IoTDBSqlParser.AndExpressionContext ctx) {
+    if (ctx.predicate().size() == 1) {
+      return parsePredicate(ctx.predicate(0));
+    }
+    FilterOperator binaryOp = new FilterOperator(FilterType.KW_AND);
+    int size = ctx.predicate().size();
+    if (size > 2) {
+      binaryOp.addChildOperator(parsePredicate(ctx.predicate(0)));
+      binaryOp.addChildOperator(parsePredicate(ctx.predicate(1)));
+      for (int i = 2; i < size; i++) {
+        FilterOperator op = new FilterOperator(FilterType.KW_AND);
+        op.addChildOperator(binaryOp);
+        op.addChildOperator(parsePredicate(ctx.predicate(i)));
+        binaryOp = op;
+      }
+    } else {
+      for (IoTDBSqlParser.PredicateContext predicateContext : ctx.predicate()) {
+        binaryOp.addChildOperator(parsePredicate(predicateContext));
+      }
+    }
+    return binaryOp;
+  }
+
+  @SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning
+  private FilterOperator parsePredicate(IoTDBSqlParser.PredicateContext ctx) {
+    PartialPath path = null;
+    if (ctx.OPERATOR_NOT() != null) {
+      FilterOperator notOp = new FilterOperator(FilterType.KW_NOT);
+      notOp.addChildOperator(parseOrExpression(ctx.orExpression()));
+      return notOp;
+    } else if (ctx.LR_BRACKET() != null && ctx.OPERATOR_NOT() == null) {
+      return parseOrExpression(ctx.orExpression());
+    } else if (ctx.REGEXP() != null || ctx.LIKE() != null) {
+      if (ctx.suffixPath() != null) {
+        path = parseSuffixPath(ctx.suffixPath());
+      } else if (ctx.fullPath() != null) {
+        path = parseFullPath(ctx.fullPath());
+      }
+      if (path == null) {
+        throw new SQLParserException("Path is null, please check the sql.");
+      }
+      return ctx.REGEXP() != null
+          ? new RegexpOperator(FilterType.REGEXP, path, ctx.STRING_LITERAL().getText())
+          : new LikeOperator(FilterType.LIKE, path, ctx.STRING_LITERAL().getText());
+    } else {
+      if (ctx.TIME() != null || ctx.TIMESTAMP() != null) {
+        path = new PartialPath(SQLConstant.getSingleTimeArray());
+      }
+      if (ctx.fullPath() != null) {
+        path = parseFullPath(ctx.fullPath());
+      }
+      if (ctx.suffixPath() != null) {
+        path = parseSuffixPath(ctx.suffixPath());
+      }
+      if (path == null) {
+        throw new SQLParserException("Path is null, please check the sql.");
+      }
+      if (ctx.inClause() != null) {
+        return parseInOperator(ctx.inClause(), path);
       } else {
-        groupByComponent.setSlidingStepByMonth(true);
+        return parseBasicFunctionOperator(ctx, path);
       }
     }
-    return DatetimeUtils.convertDurationStrToLong(durationStr);
   }
 
-  private PartialPath parseSuffixPath(SuffixPathContext ctx) {
-    List<NodeNameContext> nodeNames = ctx.nodeName();
-    String[] path = new String[nodeNames.size()];
-    for (int i = 0; i < nodeNames.size(); i++) {
-      path[i] = nodeNames.get(i).getText();
+  private FilterOperator parseBasicFunctionOperator(
+      IoTDBSqlParser.PredicateContext ctx, PartialPath path) {
+    BasicFunctionOperator basic;
+    if (ctx.constant().dateExpression() != null) {
+      if (!path.equals(TIME_PATH)) {
+        throw new SQLParserException(path.getFullPath(), "Date can only be used to time");
+      }
+      basic =
+          new BasicFunctionOperator(
+              FilterConstant.lexerToFilterType.get(ctx.comparisonOperator().type.getType()),
+              path,
+              Long.toString(parseDateExpression(ctx.constant().dateExpression())));
+    } else {
+      basic =
+          new BasicFunctionOperator(
+              FilterConstant.lexerToFilterType.get(ctx.comparisonOperator().type.getType()),
+              path,
+              ctx.constant().getText());
     }
-    return new PartialPath(path);
+    return basic;
   }
 
-  private void parseInsertColumnSpec(InsertColumnsSpecContext ctx, InsertOperator insertOp) {
-    List<MeasurementNameContext> measurementNames = ctx.measurementName();
-    List<String> measurementList = new ArrayList<>();
-    for (MeasurementNameContext measurementName : measurementNames) {
-      String measurement = measurementName.getText();
-      measurementList.add(measurement);
+  private FilterOperator parseInOperator(IoTDBSqlParser.InClauseContext ctx, PartialPath path) {
+    Set<String> values = new HashSet<>();
+    boolean not = ctx.OPERATOR_NOT() != null;
+    for (IoTDBSqlParser.ConstantContext constant : ctx.constant()) {
+      if (constant.dateExpression() != null) {
+        if (!path.equals(TIME_PATH)) {
+          throw new SQLParserException(path.getFullPath(), "Date can only be used to time");
+        }
+        values.add(Long.toString(parseDateExpression(constant.dateExpression())));
+      } else {
+        values.add(constant.getText());
+      }
     }
-    insertOp.setMeasurementList(measurementList.toArray(new String[0]));
+    return new InOperator(FilterType.IN, path, not, values);
   }
 
-  private void parseInsertValuesSpec(InsertValuesSpecContext ctx, InsertOperator insertOp) {
-    List<InsertMultiValueContext> insertMultiValues = ctx.insertMultiValue();
-    List<String> valueList = new ArrayList<>();
-    long[] timeArray = new long[insertMultiValues.size()];
-    for (int i = 0; i < insertMultiValues.size(); i++) {
-      long timestamp;
-      if (insertMultiValues.get(i).dateFormat() != null) {
-        timestamp = parseTimeFormat(insertMultiValues.get(i).dateFormat().getText());
-      } else if (insertMultiValues.get(i).INT() != null) {
-        timestamp = Long.parseLong(insertMultiValues.get(i).INT().getText());
-      } else if (insertMultiValues.size() != 1) {
-        throw new SQLParserException("need timestamps when insert multi rows");
+  private void parseIndexPredicate(IoTDBSqlParser.IndexPredicateClauseContext ctx) {
+    Map<String, Object> props;
+    PartialPath path;
+    if (ctx.suffixPath() != null) {
+      path = parseSuffixPath(ctx.suffixPath());
+    } else {
+      path = parseFullPath(ctx.fullPath());
+    }
+    if (ctx.LIKE() != null) {
+      // whole matching case
+      if (queryOp.getSelectComponent().getResultColumns().size() != 1) {
+        throw new SQLParserException("Index query statement allows only one select path");
+      }
+      if (!path.equals(
+          queryOp.getSelectComponent().getResultColumns().get(0).getExpression().toString())) {
+        throw new SQLParserException(
+            "In the index query statement, "
+                + "the path in select element and the index predicate should be same");
+      }
+      if (queryOp.getProps() != null) {
+        props = queryOp.getProps();
       } else {
-        timestamp = parseTimeFormat(SQLConstant.NOW_FUNC);
+        props = new HashMap<>();
       }
-      timeArray[i] = timestamp;
-      List<MeasurementValueContext> values = insertMultiValues.get(i).measurementValue();
-      for (MeasurementValueContext value : values) {
-        for (ConstantContext counstant : value.constant()) {
-          valueList.add(counstant.getText());
+      props.put(PATTERN, parseSequence(ctx.sequenceClause(0)));
+      queryOp.setIndexType(IndexType.RTREE_PAA);
+    } else if (ctx.CONTAIN() != null) {
+      // subsequence matching case
+      List<double[]> compositePattern = new ArrayList<>();
+      List<Double> thresholds = new ArrayList<>();
+      for (int i = 0; i < ctx.sequenceClause().size(); i++) {
+        compositePattern.add(parseSequence(ctx.sequenceClause(i)));
+        thresholds.add(Double.parseDouble(ctx.constant(i).getText()));
+      }
+      if (queryOp.getProps() != null) {
+        props = queryOp.getProps();
+      } else {
+        props = new HashMap<>();
+      }
+      List<ResultColumn> resultColumns = new ArrayList<>();
+      resultColumns.add(new ResultColumn(new TimeSeriesOperand(path)));
+      queryOp.getSelectComponent().setResultColumns(resultColumns);
+      props.put(PATTERN, compositePattern);
+      props.put(THRESHOLD, thresholds);
+      queryOp.setIndexType(IndexType.ELB_INDEX);
+    } else {
+      throw new SQLParserException("Unknown index predicate: " + ctx);
+    }
+    queryOp.setProps(props);
+  }
+
+  private double[] parseSequence(IoTDBSqlParser.SequenceClauseContext ctx) {
+    int seqLen = ctx.constant().size();
+    double[] sequence = new double[seqLen];
+    for (int i = 0; i < seqLen; i++) {
+      sequence[i] = Double.parseDouble(ctx.constant(i).getText());
+    }
+    return sequence;
+  }
+
+  // Select Clause
+
+  public void parseSelectClause(IoTDBSqlParser.SelectClauseContext ctx) {
+    SelectComponent selectComponent = new SelectComponent(zoneId);
+    if (ctx.topClause() != null) {
+      // TODO: parse info of top clause into selectOp
+      visitTopClause(ctx.topClause());
+    } else if (ctx.LAST() != null) {
+      queryOp = new LastQueryOperator(queryOp);
+    }
+
+    boolean isFirstElement = true;
+    for (IoTDBSqlParser.ResultColumnContext resultColumnContext : ctx.resultColumn()) {
+      selectComponent.addResultColumn(parseResultColumn(resultColumnContext));
+      // judge query type according to the first select element
+      if (!hasDecidedQueryType()) {
+        if (selectComponent.hasAggregationFunction()) {
+          queryOp = new AggregationQueryOperator(queryOp);
+        } else if (selectComponent.hasTimeSeriesGeneratingFunction()) {
+          queryOp = new UDFQueryOperator(queryOp);
         }
       }
     }
-    insertOp.setTimes(timeArray);
-    insertOp.setValueList(valueList.toArray(new String[0]));
+
+    queryOp.setSelectComponent(selectComponent);
+  }
+
+  @Override
+  public Operator visitTopClause(IoTDBSqlParser.TopClauseContext ctx) {
+    Map<String, Object> props = new HashMap<>();
+    int top = Integer.parseInt(ctx.INTEGER_LITERAL().getText());
+    if (top <= 0 || top > 1000) {
+      throw new SQLParserException(
+          String.format(
+              "TOP <N>: N should be greater than 0 and less than 1000, current N is %d", top));
+    }
+    props.put(TOP_K, top);
+    queryOp.setProps(props);
+    return queryOp;
+  }
+
+  private ResultColumn parseResultColumn(IoTDBSqlParser.ResultColumnContext resultColumnContext) {
+    return new ResultColumn(
+        parseExpression(resultColumnContext.expression()),
+        resultColumnContext.AS() == null ? null : resultColumnContext.ID().getText());
+  }
+
+  // From Clause
+
+  public void parseFromClause(IoTDBSqlParser.FromClauseContext ctx) {
+    FromComponent fromComponent = new FromComponent();
+    List<IoTDBSqlParser.PrefixPathContext> prefixFromPaths = ctx.prefixPath();
+    for (IoTDBSqlParser.PrefixPathContext prefixFromPath : prefixFromPaths) {
+      PartialPath path = parsePrefixPath(prefixFromPath);
+      fromComponent.addPrefixTablePath(path);
+    }
+    queryOp.setFromComponent(fromComponent);
+  }
+
+  // Where Clause
+
+  public WhereComponent parseWhereClause(IoTDBSqlParser.WhereClauseContext ctx) {
+    if (ctx.indexPredicateClause() != null) {
+      parseIndexPredicate(ctx.indexPredicateClause());
+      return null;
+    }
+    FilterOperator whereOp = new FilterOperator();
+    whereOp.addChildOperator(parseOrExpression(ctx.orExpression()));
+    return new WhereComponent(whereOp.getChildren().get(0));
+  }
+
+  // Tag & Property Clause
+
+  public void parseTagClause(IoTDBSqlParser.TagClauseContext ctx, Operator operator) {
+    Map<String, String> tags = extractMap(ctx.propertyClause(), ctx.propertyClause(0));
+    if (operator instanceof CreateTimeSeriesOperator) {
+      ((CreateTimeSeriesOperator) operator).setTags(tags);
+    } else if (operator instanceof AlterTimeSeriesOperator) {
+      ((AlterTimeSeriesOperator) operator).setTagsMap(tags);
+    }
+  }
+
+  // Limit & Offset Clause
+
+  private void parseLimitClause(IoTDBSqlParser.LimitClauseContext ctx, Operator operator) {
+    int limit;
+    try {
+      limit = Integer.parseInt(ctx.INTEGER_LITERAL().getText());
+    } catch (NumberFormatException e) {
+      throw new SQLParserException("Out of range. LIMIT <N>: N should be Int32.");
+    }
+    if (limit <= 0) {
+      throw new SQLParserException("LIMIT <N>: N should be greater than 0.");
+    }
+    if (operator instanceof ShowTimeSeriesOperator) {
+      ((ShowTimeSeriesOperator) operator).setLimit(limit);
+    } else if (operator instanceof ShowDevicesOperator) {
+      ((ShowDevicesOperator) operator).setLimit(limit);
+    } else {
+      SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
+      if (specialClauseComponent == null) {
+        specialClauseComponent = new SpecialClauseComponent();
+      }
+      specialClauseComponent.setRowLimit(limit);
+      queryOp.setSpecialClauseComponent(specialClauseComponent);
+    }
+    if (ctx.offsetClause() != null) {
+      parseOffsetClause(ctx.offsetClause(), operator);
+    }
   }
 
-  private void parseAlterClause(
-      AlterClauseContext ctx, AlterTimeSeriesOperator alterTimeSeriesOperator) {
-    Map<String, String> alterMap = new HashMap<>();
-    // rename
-    if (ctx.RENAME() != null) {
-      alterTimeSeriesOperator.setAlterType(AlterType.RENAME);
-      alterMap.put(ctx.beforeName.getText(), ctx.currentName.getText());
-    } else if (ctx.SET() != null) {
-      // set
-      alterTimeSeriesOperator.setAlterType(AlterType.SET);
-      setMap(ctx, alterMap);
-    } else if (ctx.DROP() != null) {
-      // drop
-      alterTimeSeriesOperator.setAlterType(AlterType.DROP);
-      for (TerminalNode dropId : ctx.ID()) {
-        alterMap.put(dropId.getText(), null);
-      }
-    } else if (ctx.TAGS() != null) {
-      // add tag
-      alterTimeSeriesOperator.setAlterType(AlterType.ADD_TAGS);
-      setMap(ctx, alterMap);
-    } else if (ctx.ATTRIBUTES() != null) {
-      // add attribute
-      alterTimeSeriesOperator.setAlterType(AlterType.ADD_ATTRIBUTES);
-      setMap(ctx, alterMap);
+  private void parseOffsetClause(IoTDBSqlParser.OffsetClauseContext ctx, Operator operator) {
+    int offset;
+    try {
+      offset = Integer.parseInt(ctx.INTEGER_LITERAL().getText());
+    } catch (NumberFormatException e) {
+      throw new SQLParserException(
+          "Out of range. OFFSET <OFFSETValue>: OFFSETValue should be Int32.");
+    }
+    if (offset < 0) {
+      throw new SQLParserException("OFFSET <OFFSETValue>: OFFSETValue should >= 0.");
+    }
+    if (operator instanceof ShowTimeSeriesOperator) {
+      ((ShowTimeSeriesOperator) operator).setOffset(offset);
+    } else if (operator instanceof ShowDevicesOperator) {
+      ((ShowDevicesOperator) operator).setOffset(offset);
     } else {
-      // upsert
-      alterTimeSeriesOperator.setAlterType(AlterType.UPSERT);
-      if (ctx.aliasClause() != null) {
-        parseAliasClause(ctx.aliasClause(), alterTimeSeriesOperator);
-      }
-      if (ctx.tagClause() != null) {
-        parseTagClause(ctx.tagClause(), alterTimeSeriesOperator);
-      }
-      if (ctx.attributeClause() != null) {
-        parseAttributeClause(ctx.attributeClause(), alterTimeSeriesOperator);
+      SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
+      if (specialClauseComponent == null) {
+        specialClauseComponent = new SpecialClauseComponent();
       }
+      specialClauseComponent.setRowOffset(offset);
+      queryOp.setSpecialClauseComponent(specialClauseComponent);
     }
-    alterTimeSeriesOperator.setAlterMap(alterMap);
   }
 
-  public void parseAliasClause(
-      AliasClauseContext ctx, AlterTimeSeriesOperator alterTimeSeriesOperator) {
-    if (alterTimeSeriesOperator != null && ctx.ID() != null) {
-      alterTimeSeriesOperator.setAlias(ctx.ID().getText());
+  private void parseSlimitClause(IoTDBSqlParser.SlimitClauseContext ctx) {
+    int slimit;
+    try {
+      slimit = Integer.parseInt(ctx.INTEGER_LITERAL().getText());
+    } catch (NumberFormatException e) {
+      throw new SQLParserException("Out of range. SLIMIT <SN>: SN should be Int32.");
+    }
+    if (slimit <= 0) {
+      throw new SQLParserException("SLIMIT <SN>: SN should be greater than 0.");
+    }
+    SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
+    if (specialClauseComponent == null) {
+      specialClauseComponent = new SpecialClauseComponent();
+    }
+    specialClauseComponent.setSeriesLimit(slimit);
+    queryOp.setSpecialClauseComponent(specialClauseComponent);
+    if (ctx.soffsetClause() != null) {
+      parseSoffsetClause(ctx.soffsetClause(), queryOp);
     }
   }
 
-  private void setMap(SqlBaseParser.AlterClauseContext ctx, Map<String, String> alterMap) {
-    List<PropertyContext> tagsList = ctx.property();
-    if (ctx.property(0) != null) {
-      for (PropertyContext property : tagsList) {
-        String value;
-        if (property.propertyValue().stringLiteral() != null) {
-          value = removeStringQuote(property.propertyValue().getText());
-        } else {
-          value = property.propertyValue().getText();
-        }
-        alterMap.put(property.ID().getText(), value);
-      }
+  public void parseSoffsetClause(IoTDBSqlParser.SoffsetClauseContext ctx, QueryOperator queryOp) {
+    int soffset;
+    try {
+      soffset = Integer.parseInt(ctx.INTEGER_LITERAL().getText());
+    } catch (NumberFormatException e) {
+      throw new SQLParserException(
+          "Out of range. SOFFSET <SOFFSETValue>: SOFFSETValue should be Int32.");
+    }
+    if (soffset < 0) {
+      throw new SQLParserException("SOFFSET <SOFFSETValue>: SOFFSETValue should >= 0.");
+    }
+    SpecialClauseComponent specialClauseComponent = queryOp.getSpecialClauseComponent();
+    if (specialClauseComponent == null) {
+      specialClauseComponent = new SpecialClauseComponent();
     }
+    specialClauseComponent.setSeriesOffset(soffset);
+    queryOp.setSpecialClauseComponent(specialClauseComponent);
+  }
+
+  /** Utils */
+  private boolean hasDecidedQueryType() {
+    return queryOp instanceof GroupByQueryOperator
+        || queryOp instanceof FillQueryOperator
+        || queryOp instanceof LastQueryOperator
+        || queryOp instanceof AggregationQueryOperator
+        || queryOp instanceof UDFQueryOperator;
   }
 
   private String removeStringQuote(String src) {
@@ -2357,86 +2366,54 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
       return src.substring(1, src.length() - 1);
     } else if (src.charAt(0) == '\"' && src.charAt(src.length() - 1) == '\"') {
       return src.substring(1, src.length() - 1);
+    } else if (src.charAt(0) == '`' && src.charAt(src.length() - 1) == '`') {
+      return src.substring(1, src.length() - 1);
     } else {
       throw new SQLParserException("error format for string with quote:" + src);
     }
   }
 
-  private PartialPath parsePrefixPath(PrefixPathContext ctx) {
-    List<NodeNameContext> nodeNames = ctx.nodeName();
-    String[] path = new String[nodeNames.size() + 1];
-    path[0] = ctx.ROOT().getText();
-    for (int i = 0; i < nodeNames.size(); i++) {
-      path[i + 1] = nodeNames.get(i).getText();
-    }
-    return new PartialPath(path);
-  }
-
-  public void parseAttributeClauses(
-      AttributeClausesContext ctx, CreateTimeSeriesOperator createTimeSeriesOperator) {
-    final String dataType = ctx.dataType().getChild(0).getText().toUpperCase();
-    final TSDataType tsDataType = TSDataType.valueOf(dataType);
-    createTimeSeriesOperator.setDataType(tsDataType);
-
-    final IoTDBDescriptor ioTDBDescriptor = IoTDBDescriptor.getInstance();
-    TSEncoding encoding = ioTDBDescriptor.getDefaultEncodingByType(tsDataType);
-    if (Objects.nonNull(ctx.encoding())) {
-      String encodingString = ctx.encoding().getChild(0).getText().toUpperCase();
-      encoding = TSEncoding.valueOf(encodingString);
-    }
-    createTimeSeriesOperator.setEncoding(encoding);
-
-    CompressionType compressor;
-    List<PropertyContext> properties = ctx.property();
-    if (ctx.compressor() != null) {
-      compressor = CompressionType.valueOf(ctx.compressor().getText().toUpperCase());
-    } else {
-      compressor = TSFileDescriptor.getInstance().getConfig().getCompressor();
-    }
-    Map<String, String> props = null;
-    if (ctx.property(0) != null) {
-      props = new HashMap<>(properties.size());
-      for (PropertyContext property : properties) {
-        props.put(
-            property.ID().getText().toLowerCase(),
-            property.propertyValue().getText().toLowerCase());
+  /**
+   * parse time unit or sliding step in group by query.
+   *
+   * @param durationStr represent duration string like: 12d8m9ns, 1y1d, etc.
+   * @return time in milliseconds, microseconds, or nanoseconds depending on the profile
+   */
+  private long parseTimeUnitOrSlidingStep(
+      String durationStr, boolean isParsingTimeUnit, GroupByClauseComponent groupByComponent) {
+    if (durationStr.toLowerCase().contains("mo")) {
+      if (isParsingTimeUnit) {
+        groupByComponent.setIntervalByMonth(true);
+      } else {
+        groupByComponent.setSlidingStepByMonth(true);
       }
     }
-    createTimeSeriesOperator.setCompressor(compressor);
-    createTimeSeriesOperator.setProps(props);
-    if (ctx.tagClause() != null) {
-      parseTagClause(ctx.tagClause(), createTimeSeriesOperator);
-    }
-    if (ctx.attributeClause() != null) {
-      parseAttributeClause(ctx.attributeClause(), createTimeSeriesOperator);
-    }
-  }
-
-  public void parseAttributeClause(AttributeClauseContext ctx, Operator operator) {
-    Map<String, String> attributes = extractMap(ctx.property(), ctx.property(0));
-    if (operator instanceof CreateTimeSeriesOperator) {
-      ((CreateTimeSeriesOperator) operator).setAttributes(attributes);
-    } else if (operator instanceof AlterTimeSeriesOperator) {
-      ((AlterTimeSeriesOperator) operator).setAttributesMap(attributes);
-    }
+    return DatetimeUtils.convertDurationStrToLong(durationStr);
   }
 
-  public void parseTagClause(TagClauseContext ctx, Operator operator) {
-    Map<String, String> tags = extractMap(ctx.property(), ctx.property(0));
-    if (operator instanceof CreateTimeSeriesOperator) {
-      ((CreateTimeSeriesOperator) operator).setTags(tags);
-    } else if (operator instanceof AlterTimeSeriesOperator) {
-      ((AlterTimeSeriesOperator) operator).setTagsMap(tags);
+  private void setMap(IoTDBSqlParser.AlterClauseContext ctx, Map<String, String> alterMap) {
+    List<IoTDBSqlParser.PropertyClauseContext> tagsList = ctx.propertyClause();
+    if (ctx.propertyClause(0) != null) {
+      for (IoTDBSqlParser.PropertyClauseContext property : tagsList) {
+        String value;
+        if (property.propertyValue().STRING_LITERAL() != null) {
+          value = removeStringQuote(property.propertyValue().getText());
+        } else {
+          value = property.propertyValue().getText();
+        }
+        alterMap.put(property.ID().getText(), value);
+      }
     }
   }
 
   private Map<String, String> extractMap(
-      List<PropertyContext> property2, PropertyContext property3) {
+      List<IoTDBSqlParser.PropertyClauseContext> property2,
+      IoTDBSqlParser.PropertyClauseContext property3) {
     String value;
     Map<String, String> tags = new HashMap<>(property2.size());
     if (property3 != null) {
-      for (PropertyContext property : property2) {
-        if (property.propertyValue().stringLiteral() != null) {
+      for (IoTDBSqlParser.PropertyClauseContext property : property2) {
+        if (property.propertyValue().STRING_LITERAL() != null) {
           value = removeStringQuote(property.propertyValue().getText());
         } else {
           value = property.propertyValue().getText();
@@ -2447,81 +2424,27 @@ public class IoTDBSqlVisitor extends SqlBaseBaseVisitor<Operator> {
     return tags;
   }
 
-  private PartialPath parseFullPath(FullPathContext ctx) {
-    List<NodeNameWithoutStarContext> nodeNamesWithoutStar = ctx.nodeNameWithoutStar();
-    String[] path = new String[nodeNamesWithoutStar.size() + 1];
-    int i = 0;
-    if (ctx.ROOT() != null) {
-      path[0] = ctx.ROOT().getText();
-    }
-    for (NodeNameWithoutStarContext nodeNameWithoutStar : nodeNamesWithoutStar) {
-      i++;
-      path[i] = nodeNameWithoutStar.getText();
-    }
-    return new PartialPath(path);
-  }
-
-  /** function for parsing time format. */
-  public long parseTimeFormat(String timestampStr) throws SQLParserException {
-    if (timestampStr == null || timestampStr.trim().equals("")) {
-      throw new SQLParserException("input timestamp cannot be empty");
-    }
-    if (timestampStr.equalsIgnoreCase(SQLConstant.NOW_FUNC)) {
-      return DatetimeUtils.currentTime();
-    }
-    try {
-      return DatetimeUtils.convertDatetimeStrToLong(timestampStr, zoneId);
-    } catch (Exception e) {
-      throw new SQLParserException(
-          String.format(
-              "Input time format %s error. "
-                  + "Input like yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss or "
-                  + "refer to user document for more info.",
-              timestampStr));
-    }
-  }
+  private Pair<Long, Long> calcOperatorInterval(FilterOperator filterOperator) {
 
-  public long parseTimeFormat(String timestampStr, long currentTime) throws SQLParserException {
-    if (timestampStr == null || timestampStr.trim().equals("")) {
-      throw new SQLParserException("input timestamp cannot be empty");
-    }
-    if (timestampStr.equalsIgnoreCase(SQLConstant.NOW_FUNC)) {
-      return currentTime;
-    }
-    try {
-      return DatetimeUtils.convertDatetimeStrToLong(timestampStr, zoneId);
-    } catch (Exception e) {
-      throw new SQLParserException(
-          String.format(
-              "Input time format %s error. "
-                  + "Input like yyyy-MM-dd HH:mm:ss, yyyy-MM-ddTHH:mm:ss or "
-                  + "refer to user document for more info.",
-              timestampStr));
+    if (filterOperator.getSinglePath() != null
+        && !IoTDBConstant.TIME.equals(filterOperator.getSinglePath().getMeasurement())) {
+      throw new SQLParserException(DELETE_ONLY_SUPPORT_TIME_EXP_ERROR_MSG);
     }
-  }
 
-  /**
-   * used for parsing load tsfile, context will be one of "SCHEMA, LEVEL, METADATA", and maybe
-   * followed by a recursion property statement
-   *
-   * @param operator the result operator, setting by clause context
-   * @param ctx context of property statement
-   */
-  private void parseLoadFiles(LoadFilesOperator operator, LoadFilesClauseContext ctx) {
-    if (ctx.AUTOREGISTER() != null) {
-      operator.setAutoCreateSchema(Boolean.parseBoolean(ctx.booleanClause().getText()));
-    } else if (ctx.SGLEVEL() != null) {
-      operator.setSgLevel(Integer.parseInt(ctx.INT().getText()));
-    } else if (ctx.VERIFY() != null) {
-      operator.setVerifyMetadata(Boolean.parseBoolean(ctx.booleanClause().getText()));
-    } else {
-      throw new SQLParserException(
-          String.format(
-              "load tsfile format %s error, please input AUTOREGISTER | SGLEVEL | VERIFY.",
-              ctx.getText()));
-    }
-    if (ctx.loadFilesClause() != null) {
-      parseLoadFiles(operator, ctx.loadFilesClause());
+    long time = Long.parseLong(((BasicFunctionOperator) filterOperator).getValue());
+    switch (filterOperator.getFilterType()) {
+      case LESSTHAN:
+        return new Pair<>(Long.MIN_VALUE, time - 1);
+      case LESSTHANOREQUALTO:
+        return new Pair<>(Long.MIN_VALUE, time);
+      case GREATERTHAN:
+        return new Pair<>(time + 1, Long.MAX_VALUE);
+      case GREATERTHANOREQUALTO:
+        return new Pair<>(time, Long.MAX_VALUE);
+      case EQUAL:
+        return new Pair<>(time, time);
+      default:
+        throw new SQLParserException(DELETE_RANGE_ERROR_MSG);
     }
   }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java b/server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
index c0047b7..6c48346 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
@@ -29,9 +29,9 @@ import org.apache.iotdb.db.qp.logical.crud.LastQueryOperator;
 import org.apache.iotdb.db.qp.logical.crud.QueryOperator;
 import org.apache.iotdb.db.qp.logical.crud.SelectComponent;
 import org.apache.iotdb.db.qp.logical.crud.WhereComponent;
+import org.apache.iotdb.db.qp.sql.IoTDBSqlLexer;
+import org.apache.iotdb.db.qp.sql.IoTDBSqlParser;
 import org.apache.iotdb.db.qp.sql.IoTDBSqlVisitor;
-import org.apache.iotdb.db.qp.sql.SqlBaseLexer;
-import org.apache.iotdb.db.qp.sql.SqlBaseParser;
 import org.apache.iotdb.db.query.expression.ResultColumn;
 import org.apache.iotdb.db.query.expression.unary.TimeSeriesOperand;
 import org.apache.iotdb.service.rpc.thrift.TSLastDataQueryReq;
@@ -57,11 +57,11 @@ public class LogicalGenerator {
     IoTDBSqlVisitor ioTDBSqlVisitor = new IoTDBSqlVisitor();
     ioTDBSqlVisitor.setZoneId(zoneId);
     CharStream charStream1 = CharStreams.fromString(sql);
-    SqlBaseLexer lexer1 = new SqlBaseLexer(charStream1);
+    IoTDBSqlLexer lexer1 = new IoTDBSqlLexer(charStream1);
     lexer1.removeErrorListeners();
     lexer1.addErrorListener(SQLParseError.INSTANCE);
     CommonTokenStream tokens1 = new CommonTokenStream(lexer1);
-    SqlBaseParser parser1 = new SqlBaseParser(tokens1);
+    IoTDBSqlParser parser1 = new IoTDBSqlParser(tokens1);
     parser1.getInterpreter().setPredictionMode(PredictionMode.SLL);
     parser1.removeErrorListeners();
     parser1.addErrorListener(SQLParseError.INSTANCE);
@@ -70,11 +70,11 @@ public class LogicalGenerator {
       tree = parser1.singleStatement(); // STAGE 1
     } catch (Exception ex) {
       CharStream charStream2 = CharStreams.fromString(sql);
-      SqlBaseLexer lexer2 = new SqlBaseLexer(charStream2);
+      IoTDBSqlLexer lexer2 = new IoTDBSqlLexer(charStream2);
       lexer2.removeErrorListeners();
       lexer2.addErrorListener(SQLParseError.INSTANCE);
       CommonTokenStream tokens2 = new CommonTokenStream(lexer2);
-      SqlBaseParser parser2 = new SqlBaseParser(tokens2);
+      IoTDBSqlParser parser2 = new IoTDBSqlParser(tokens2);
       parser2.getInterpreter().setPredictionMode(PredictionMode.LL);
       parser2.removeErrorListeners();
       parser2.addErrorListener(SQLParseError.INSTANCE);
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBInIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBInIT.java
index 8add24f..b37a5a1 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBInIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBInIT.java
@@ -40,20 +40,20 @@ public class IoTDBInIT {
       new String[] {
         "set storage group to root.ln",
         "create timeseries root.sg.d1.s1.qrcode with datatype=TEXT,encoding=PLAIN",
-        "insert into root.sg.d1.s1(timestamp,qrcode) values(1509465600000,\"qrcode001\")",
-        "insert into root.sg.d1.s1(timestamp,qrcode) values(1509465660000,\"qrcode002\")",
-        "insert into root.sg.d1.s1(timestamp,qrcode) values(1509465720000,\"qrcode003\")",
-        "insert into root.sg.d1.s1(timestamp,qrcode) values(1509465780000,\"qrcode004\")",
+        "insert into root.sg.d1.s1(timestamp,qrcode) values(1509465600000,'qrcode001')",
+        "insert into root.sg.d1.s1(timestamp,qrcode) values(1509465660000,'qrcode002')",
+        "insert into root.sg.d1.s1(timestamp,qrcode) values(1509465720000,'qrcode003')",
+        "insert into root.sg.d1.s1(timestamp,qrcode) values(1509465780000,'qrcode004')",
         "create timeseries root.sg.d1.s2.qrcode with datatype=TEXT,encoding=PLAIN",
-        "insert into root.sg.d1.s2(timestamp,qrcode) values(1509465720000,\"qrcode002\")",
-        "insert into root.sg.d1.s2(timestamp,qrcode) values(1509465780000,\"qrcode003\")",
-        "insert into root.sg.d1.s2(timestamp,qrcode) values(1509465840000,\"qrcode004\")",
-        "insert into root.sg.d1.s2(timestamp,qrcode) values(1509465900000,\"qrcode005\")",
+        "insert into root.sg.d1.s2(timestamp,qrcode) values(1509465720000,'qrcode002')",
+        "insert into root.sg.d1.s2(timestamp,qrcode) values(1509465780000,'qrcode003')",
+        "insert into root.sg.d1.s2(timestamp,qrcode) values(1509465840000,'qrcode004')",
+        "insert into root.sg.d1.s2(timestamp,qrcode) values(1509465900000,'qrcode005')",
         "create timeseries root.sg.d2.s1.qrcode with datatype=TEXT,encoding=PLAIN",
-        "insert into root.sg.d2.s1(timestamp,qrcode) values(1509465780000,\"qrcode002\")",
-        "insert into root.sg.d2.s1(timestamp,qrcode) values(1509465840000,\"qrcode003\")",
-        "insert into root.sg.d2.s1(timestamp,qrcode) values(1509465900000,\"qrcode004\")",
-        "insert into root.sg.d2.s1(timestamp,qrcode) values(1509465960000,\"qrcode005\")"
+        "insert into root.sg.d2.s1(timestamp,qrcode) values(1509465780000,'qrcode002')",
+        "insert into root.sg.d2.s1(timestamp,qrcode) values(1509465840000,'qrcode003')",
+        "insert into root.sg.d2.s1(timestamp,qrcode) values(1509465900000,'qrcode004')",
+        "insert into root.sg.d2.s1(timestamp,qrcode) values(1509465960000,'qrcode005')"
       };
 
   @BeforeClass
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBLoadExternalTsFileWithTimePartitionIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBLoadExternalTsFileWithTimePartitionIT.java
index a4f9a5b..89b245b 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBLoadExternalTsFileWithTimePartitionIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBLoadExternalTsFileWithTimePartitionIT.java
@@ -174,7 +174,7 @@ public class IoTDBLoadExternalTsFileWithTimePartitionIT {
         Statement statement = connection.createStatement()) {
       prepareData();
 
-      statement.execute(String.format("load \"%s\"", new File(tempDir).getAbsolutePath()));
+      statement.execute(String.format("load '%s'", new File(tempDir).getAbsolutePath()));
 
       String dataDir = config.getDataDirs()[0];
       // sequence/logical_sg/virtual_sg/time_partitions
@@ -285,7 +285,7 @@ public class IoTDBLoadExternalTsFileWithTimePartitionIT {
         Statement statement = connection.createStatement()) {
       prepareDataWithDifferentDevice();
 
-      statement.execute(String.format("load \"%s\"", new File(tempDir).getAbsolutePath()));
+      statement.execute(String.format("load '%s'", new File(tempDir).getAbsolutePath()));
 
       String dataDir = config.getDataDirs()[0];
       // sequence/logical_sg/virtual_sg/time_partitions
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBLoadExternalTsfileIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBLoadExternalTsfileIT.java
index 5db1788..faf0537 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBLoadExternalTsfileIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBLoadExternalTsfileIT.java
@@ -43,11 +43,7 @@ import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -175,7 +171,7 @@ public class IoTDBLoadExternalTsfileIT {
         tmpDir.mkdirs();
       }
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("unload \"%s\" \"%s\"", resource.getTsFilePath(), tmpDir));
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), tmpDir));
       }
       assertEquals(
           0,
@@ -201,7 +197,7 @@ public class IoTDBLoadExternalTsfileIT {
         tmpDir.mkdirs();
       }
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("unload \"%s\" \"%s\"", resource.getTsFilePath(), tmpDir));
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), tmpDir));
       }
       assertEquals(
           0,
@@ -248,7 +244,7 @@ public class IoTDBLoadExternalTsfileIT {
         tmpDir.mkdirs();
       }
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("unload \"%s\" \"%s\"", resource.getTsFilePath(), tmpDir));
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), tmpDir));
       }
 
       // move root.test
@@ -277,7 +273,7 @@ public class IoTDBLoadExternalTsfileIT {
         tmpDir.mkdirs();
       }
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("unload \"%s\" \"%s\"", resource.getTsFilePath(), tmpDir));
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), tmpDir));
       }
 
       // load all tsfile in tmp dir
@@ -291,7 +287,7 @@ public class IoTDBLoadExternalTsfileIT {
                   .getParentFile()
                   .getParentFile(),
               "tmp");
-      statement.execute(String.format("load \"%s\"", tmpDir.getAbsolutePath()));
+      statement.execute(String.format("load '%s'", tmpDir.getAbsolutePath()));
       resources =
           new ArrayList<>(
               StorageEngine.getInstance()
@@ -405,7 +401,7 @@ public class IoTDBLoadExternalTsfileIT {
         tmpDir.mkdirs();
       }
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("unload \"%s\" \"%s\"", resource.getTsFilePath(), tmpDir));
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), tmpDir));
       }
       resources =
           new ArrayList<>(
@@ -414,7 +410,7 @@ public class IoTDBLoadExternalTsfileIT {
                   .getUnSequenceFileList());
       assertEquals(1, resources.size());
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("unload \"%s\" \"%s\"", resource.getTsFilePath(), tmpDir));
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), tmpDir));
       }
 
       // move root.test
@@ -429,7 +425,7 @@ public class IoTDBLoadExternalTsfileIT {
         tmpDir.mkdirs();
       }
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("unload \"%s\" \"%s\"", resource.getTsFilePath(), tmpDir));
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), tmpDir));
       }
       resources =
           new ArrayList<>(
@@ -438,12 +434,12 @@ public class IoTDBLoadExternalTsfileIT {
                   .getUnSequenceFileList());
       assertEquals(2, resources.size());
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("unload \"%s\" \"%s\"", resource.getTsFilePath(), tmpDir));
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), tmpDir));
       }
 
       // load all tsfile in tmp dir
       tmpDir = tmpDir.getParentFile().getParentFile();
-      statement.execute(String.format("load \"%s\"", tmpDir.getAbsolutePath()));
+      statement.execute(String.format("load '%s'", tmpDir.getAbsolutePath()));
       assertEquals(
           2,
           StorageEngine.getInstance()
@@ -563,7 +559,7 @@ public class IoTDBLoadExternalTsfileIT {
         tmpDir.mkdirs();
       }
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("unload \"%s\" \"%s\"", resource.getTsFilePath(), tmpDir));
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), tmpDir));
       }
 
       // move root.test
@@ -586,7 +582,7 @@ public class IoTDBLoadExternalTsfileIT {
         tmpDir.mkdirs();
       }
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("unload \"%s\" \"%s\"", resource.getTsFilePath(), tmpDir));
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), tmpDir));
       }
 
       Set<String> expectedSet =
@@ -623,7 +619,7 @@ public class IoTDBLoadExternalTsfileIT {
       boolean hasError = false;
       try {
         statement.execute(
-            String.format("load \"%s\" autoregister=false,sglevel=1", tmpDir.getAbsolutePath()));
+            String.format("load '%s' autoregister=false,sglevel=1", tmpDir.getAbsolutePath()));
       } catch (Exception e) {
         hasError = true;
       }
@@ -632,7 +628,7 @@ public class IoTDBLoadExternalTsfileIT {
       // test load metadata automatically, it will succeed.
       tmpDir = tmpDir.getParentFile().getParentFile().getParentFile();
       statement.execute(
-          String.format("load \"%s\" autoregister=true,sglevel=1", tmpDir.getAbsolutePath()));
+          String.format("load '%s' autoregister=true,sglevel=1", tmpDir.getAbsolutePath()));
       resources =
           new ArrayList<>(
               StorageEngine.getInstance()
@@ -681,7 +677,8 @@ public class IoTDBLoadExternalTsfileIT {
       }
 
       for (TsFileResource resource : resources) {
-        statement.execute("unload \"" + resource.getTsFilePath() + "\" \"" + vehicleTmpDir + "\"");
+        statement.execute(
+            String.format("unload '%s' '%s'", resource.getTsFilePath(), vehicleTmpDir));
       }
 
       resources =
@@ -697,7 +694,7 @@ public class IoTDBLoadExternalTsfileIT {
       }
 
       for (TsFileResource resource : resources) {
-        statement.execute("unload \"" + resource.getTsFilePath() + "\" \"" + testTmpDir + "\"");
+        statement.execute(String.format("unload '%s' '%s'", resource.getTsFilePath(), testTmpDir));
       }
 
       for (String sql : deleteSqls) {
@@ -724,7 +721,7 @@ public class IoTDBLoadExternalTsfileIT {
       // load vehicle
       boolean hasError = false;
       try {
-        statement.execute("load \"" + vehicleTmpDir + "\"");
+        statement.execute(String.format("load '%s'", vehicleTmpDir));
       } catch (Exception e) {
         hasError = true;
         assertTrue(
@@ -734,7 +731,7 @@ public class IoTDBLoadExternalTsfileIT {
       }
       assertTrue(hasError);
 
-      statement.execute("load \"" + vehicleTmpDir + "\" verify=false");
+      statement.execute(String.format("load '%s' verify=false", vehicleTmpDir));
       assertEquals(
           1,
           StorageEngine.getInstance()
@@ -745,7 +742,7 @@ public class IoTDBLoadExternalTsfileIT {
       // load test
       hasError = false;
       try {
-        statement.execute("load \"" + testTmpDir + "\"");
+        statement.execute(String.format("load '%s'", testTmpDir));
       } catch (Exception e) {
         hasError = true;
         assertTrue(
@@ -755,7 +752,7 @@ public class IoTDBLoadExternalTsfileIT {
       }
       assertTrue(hasError);
 
-      statement.execute("load \"" + testTmpDir + "\" verify=false");
+      statement.execute(String.format("load '%s' verify=false", testTmpDir));
       assertEquals(
           2,
           StorageEngine.getInstance()
@@ -781,7 +778,7 @@ public class IoTDBLoadExternalTsfileIT {
                   .getSequenceFileTreeSet());
       assertEquals(1, resources.size());
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("remove \"%s\"", resource.getTsFilePath()));
+        statement.execute(String.format("remove '%s'", resource.getTsFilePath()));
       }
       assertEquals(
           0,
@@ -797,7 +794,7 @@ public class IoTDBLoadExternalTsfileIT {
                   .getSequenceFileTreeSet());
       assertEquals(2, resources.size());
       for (TsFileResource resource : resources) {
-        statement.execute(String.format("remove \"%s\"", resource.getTsFilePath()));
+        statement.execute(String.format("remove '%s'", resource.getTsFilePath()));
       }
       assertEquals(
           0,
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBMergeIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBMergeIT.java
index 3daad5e..8f2c378 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBMergeIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBMergeIT.java
@@ -366,7 +366,7 @@ public class IoTDBMergeIT {
       }
 
       int cnt;
-      try (ResultSet resultSet = statement.executeQuery("SHOW MERGE")) {
+      try (ResultSet resultSet = statement.executeQuery("SHOW MERGE INFO")) {
         cnt = 0;
         int colNum = resultSet.getMetaData().getColumnCount();
         while (resultSet.next()) {
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
index 46b8577..50f92ac 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
@@ -121,11 +121,11 @@ public class IoTDBNestedQueryIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function adder as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function adder as 'org.apache.iotdb.db.query.udf.example.Adder'");
       statement.execute(
-          "create function time_window_counter as \"org.apache.iotdb.db.query.udf.example.Counter\"");
+          "create function time_window_counter as 'org.apache.iotdb.db.query.udf.example.Counter'");
       statement.execute(
-          "create function size_window_counter as \"org.apache.iotdb.db.query.udf.example.Counter\"");
+          "create function size_window_counter as 'org.apache.iotdb.db.query.udf.example.Counter'");
     } catch (SQLException throwable) {
       fail(throwable.getMessage());
     }
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryDemoIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryDemoIT.java
index ad2d9ca..4df882e 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryDemoIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBQueryDemoIT.java
@@ -68,16 +68,16 @@ public class IoTDBQueryDemoIT {
         "insert into root.ln.wf01.wt01(timestamp,temperature) values(1509466080000,22.57987);",
         "insert into root.ln.wf01.wt01(timestamp,temperature) values(1509466140000,20.98177);",
         "create timeseries root.ln.wf02.wt02.hardware with datatype=TEXT,encoding=PLAIN",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465600000,\"v2\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465660000,\"v2\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465720000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465780000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465840000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465900000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465960000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466020000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466080000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466140000,\"v1\")",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465600000,'v2')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465660000,'v2')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465720000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465780000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465840000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465900000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465960000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466020000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466080000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466140000,'v1')",
         "create timeseries root.ln.wf02.wt02.status with datatype=BOOLEAN,encoding=PLAIN",
         "insert into root.ln.wf02.wt02(timestamp,status) values(1509465600000,true)",
         "insert into root.ln.wf02.wt02(timestamp,status) values(1509465660000,true)",
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSetSystemReadOnlyWritableIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSetSystemReadOnlyWritableIT.java
index a84c0ff..1920c07 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSetSystemReadOnlyWritableIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBSetSystemReadOnlyWritableIT.java
@@ -73,16 +73,16 @@ public class IoTDBSetSystemReadOnlyWritableIT {
         "insert into root.ln.wf01.wt01(timestamp,temperature) values(1509466080000,22.57987)",
         "insert into root.ln.wf01.wt01(timestamp,temperature) values(1509466140000,20.98177)",
         "create timeseries root.ln.wf02.wt02.hardware with datatype=TEXT,encoding=PLAIN",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465600000,\"v2\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465660000,\"v2\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465720000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465780000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465840000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465900000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465960000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466020000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466080000,\"v1\")",
-        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466140000,\"v1\")",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465600000,'v2')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465660000,'v2')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465720000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465780000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465840000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465900000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509465960000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466020000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466080000,'v1')",
+        "insert into root.ln.wf02.wt02(timestamp,hardware) values(1509466140000,'v1')",
         "create timeseries root.ln.wf02.wt02.status with datatype=BOOLEAN,encoding=PLAIN",
         "insert into root.ln.wf02.wt02(timestamp,status) values(1509465600000,true)",
         "insert into root.ln.wf02.wt02(timestamp,status) values(1509465660000,true)",
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTracingIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTracingIT.java
index 869635c..a9c6024 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTracingIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTracingIT.java
@@ -49,10 +49,11 @@ public class IoTDBTracingIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("SET STORAGE GROUP TO root.tracing");
-      statement.execute("CREATE TIMESERIES root.tracing.d1.s1 WITH DATATYPE=INT32, ENCODING=RLE");
+      statement.execute("SET STORAGE GROUP TO root.sg_tracing");
+      statement.execute(
+          "CREATE TIMESERIES root.sg_tracing.d1.s1 WITH DATATYPE=INT32, ENCODING=RLE");
 
-      String insertTemplate = "INSERT INTO root.tracing.d1(timestamp, s1) VALUES(%d,%d)";
+      String insertTemplate = "INSERT INTO root.sg_tracing.d1(timestamp, s1) VALUES(%d,%d)";
 
       for (int i = 100; i < 200; i++) {
         statement.execute(String.format(insertTemplate, i, i));
@@ -70,7 +71,7 @@ public class IoTDBTracingIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("tracing select s1 from root.tracing.d1");
+      statement.execute("tracing select s1 from root.sg_tracing.d1");
       AbstractIoTDBJDBCResultSet resultSet = (AbstractIoTDBJDBCResultSet) statement.getResultSet();
       Assert.assertTrue(resultSet.isSetTracingInfo());
       Assert.assertEquals(1, resultSet.getStatisticsByName("seriesPathNum"));
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerExecutionIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerExecutionIT.java
index d83629c..18fcb95 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerExecutionIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerExecutionIT.java
@@ -69,7 +69,7 @@ public class IoTDBTriggerExecutionIT {
               ++count;
               statement.execute(
                   String.format(
-                      "insert into root.vehicle.d1(timestamp,s1,s2,s3,s4,s5,s6) values(%d,%d,%d,%d,%d,%s,\"%d\")",
+                      "insert into root.vehicle.d1(timestamp,s1,s2,s3,s4,s5,s6) values(%d,%d,%d,%d,%d,%s,'%d')",
                       count, count, count, count, count, count % 2 == 0 ? "true" : "false", count));
             } while (!isInterrupted());
           } catch (Exception e) {
@@ -154,17 +154,17 @@ public class IoTDBTriggerExecutionIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       int[] counters1 = getCounters(6);
       LOGGER.info(Arrays.toString(counters1));
@@ -205,11 +205,11 @@ public class IoTDBTriggerExecutionIT {
       waitCountIncreaseBy(500);
 
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       waitCountIncreaseBy(500);
 
@@ -226,11 +226,11 @@ public class IoTDBTriggerExecutionIT {
       waitCountIncreaseBy(500);
 
       statement.execute(
-          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       // IOTDB-1825: if the background data generator's connection is closed, the following checks
       // will be meaningless, in which case we ignore the checks
@@ -260,11 +260,11 @@ public class IoTDBTriggerExecutionIT {
       waitCountIncreaseBy(500);
 
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       waitCountIncreaseBy(500);
 
@@ -285,22 +285,22 @@ public class IoTDBTriggerExecutionIT {
       statement.execute("drop trigger trigger-3");
       waitCountIncreaseBy(100);
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       waitCountIncreaseBy(100);
       statement.execute("drop trigger trigger-1");
       statement.execute("drop trigger trigger-2");
       statement.execute("drop trigger trigger-3");
       waitCountIncreaseBy(100);
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       waitCountIncreaseBy(500);
 
@@ -332,17 +332,17 @@ public class IoTDBTriggerExecutionIT {
       waitCountIncreaseBy(500);
 
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       waitCountIncreaseBy(500);
 
@@ -456,17 +456,17 @@ public class IoTDBTriggerExecutionIT {
       waitCountIncreaseBy(500);
 
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       waitCountIncreaseBy(500);
 
@@ -511,17 +511,17 @@ public class IoTDBTriggerExecutionIT {
       }
 
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       Thread.sleep(500);
 
@@ -546,17 +546,17 @@ public class IoTDBTriggerExecutionIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       waitCountIncreaseBy(500);
 
@@ -586,17 +586,17 @@ public class IoTDBTriggerExecutionIT {
       }
 
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-5 before insert on root.vehicle.d1.s5 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-6 after insert on root.vehicle.d1.s6 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       Thread.sleep(500);
 
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerManagementIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerManagementIT.java
index a474585..ec9a238 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerManagementIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTriggerManagementIT.java
@@ -97,9 +97,9 @@ public class IoTDBTriggerManagementIT {
 
       // create trigger
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       assertFalse(
           ((Accumulator) TriggerRegistrationService.getInstance().getTriggerInstance("trigger-1"))
               .isStopped());
@@ -150,7 +150,7 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-2 before insert on root.vehicle.d1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-2 before insert on root.vehicle.d1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
     } catch (SQLException throwable) {
       assertTrue(
           throwable.getMessage().contains("MNode [root.vehicle.d1] is not a MeasurementMNode."));
@@ -164,7 +164,7 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-2 before insert on root.nonexistent.d1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-2 before insert on root.nonexistent.d1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
     } catch (SQLException throwable) {
       assertTrue(throwable.getMessage().contains("Path [root.nonexistent.d1] does not exist"));
     }
@@ -177,7 +177,7 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-2 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Nonexistent\"");
+          "create trigger trigger-2 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Nonexistent'");
     } catch (SQLException throwable) {
       assertTrue(throwable.getMessage().contains("Failed to reflect Trigger trigger-2"));
     }
@@ -190,9 +190,9 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       statement.execute(
-          "create trigger trigger-1 after insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 after insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
     } catch (SQLException throwable) {
       assertTrue(
           throwable
@@ -209,9 +209,9 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       statement.execute(
-          "create trigger trigger-1 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
     } catch (SQLException throwable) {
       assertTrue(
           throwable
@@ -228,25 +228,25 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       statement.execute("drop trigger trigger-1");
       statement.execute("drop trigger trigger-2");
 
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       statement.execute("drop trigger trigger-1");
       statement.execute("drop trigger trigger-2");
 
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       ResultSet resultSet = statement.executeQuery("show triggers");
       assertTrue(resultSet.next());
@@ -270,16 +270,16 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       ((Accumulator) TriggerRegistrationService.getInstance().getTriggerInstance("trigger-1"))
           .setAccumulator(1234);
 
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       statement.execute(
-          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-4 after insert on root.vehicle.d1.s4 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
 
       assertEquals(
           1234,
@@ -322,7 +322,7 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       statement.execute("start trigger trigger-1");
     } catch (SQLException throwable) {
       assertTrue(throwable.getMessage().contains("Trigger trigger-1 has already been started"));
@@ -348,7 +348,7 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       statement.execute("stop trigger trigger-1");
       statement.execute("stop trigger trigger-1");
     } catch (SQLException throwable) {
@@ -363,7 +363,7 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
       assertFalse(
           TriggerRegistrationService.getInstance()
               .getRegistrationInformation("trigger-1")
@@ -405,21 +405,21 @@ public class IoTDBTriggerManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\" with ('k1'='v1', 'k2'='v2')");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s1 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator' with ('k1'='v1', 'k2'='v2')");
       statement.execute("stop trigger trigger-1");
       statement.execute("start trigger trigger-1");
       statement.execute("drop trigger trigger-1");
 
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Counter\" with ('k3'='v3')");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Counter' with ('k3'='v3')");
       statement.execute("stop trigger trigger-1");
       statement.execute("start trigger trigger-1");
       statement.execute("drop trigger trigger-1");
 
       statement.execute(
-          "create trigger trigger-1 after insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-1 after insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute(
-          "create trigger trigger-2 before insert on root.vehicle.d1.s4 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\" with ('k4'='v4')");
+          "create trigger trigger-2 before insert on root.vehicle.d1.s4 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator' with ('k4'='v4')");
       statement.execute("stop trigger trigger-1");
 
     } catch (Exception e) {
@@ -455,13 +455,13 @@ public class IoTDBTriggerManagementIT {
 
       statement.execute("drop trigger trigger-2");
       statement.execute(
-          "create trigger trigger-2 after insert on root.vehicle.d1.s3 as \"org.apache.iotdb.db.engine.trigger.example.Counter\"");
+          "create trigger trigger-2 after insert on root.vehicle.d1.s3 as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
       statement.execute("drop trigger trigger-1");
       statement.execute(
-          "create trigger trigger-1 before insert on root.vehicle.d1.s4 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\" with ('k5'='v5')");
+          "create trigger trigger-1 before insert on root.vehicle.d1.s4 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator' with ('k5'='v5')");
       statement.execute("stop trigger trigger-2");
       statement.execute(
-          "create trigger trigger-3 before insert on root.vehicle.d1.s2 as \"org.apache.iotdb.db.engine.trigger.example.Accumulator\"");
+          "create trigger trigger-3 before insert on root.vehicle.d1.s2 as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
     } catch (Exception e) {
       fail(e.getMessage());
     }
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFManagementIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFManagementIT.java
index 22c11e1..ac24306 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFManagementIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFManagementIT.java
@@ -83,7 +83,7 @@ public class IoTDBUDFManagementIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
       statement.execute("select udf(*, *) from root.vehicle");
 
       ResultSet resultSet = statement.executeQuery("show functions");
@@ -114,7 +114,7 @@ public class IoTDBUDFManagementIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
       statement.execute("select udf(*, *) from root.vehicle");
 
       ResultSet resultSet = statement.executeQuery("show functions");
@@ -127,7 +127,7 @@ public class IoTDBUDFManagementIT {
       resultSet.close();
       statement.execute("drop function udf");
 
-      statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
       statement.execute("select udf(*, *) from root.vehicle");
 
       resultSet = statement.executeQuery("show functions");
@@ -162,7 +162,7 @@ public class IoTDBUDFManagementIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
       statement.execute("drop function udf");
       statement.execute("select udf(*, *) from root.vehicle");
     } catch (SQLException throwable) {
@@ -176,7 +176,7 @@ public class IoTDBUDFManagementIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function aVg as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function aVg as 'org.apache.iotdb.db.query.udf.example.Adder'");
       fail();
     } catch (SQLException throwable) {
       assertTrue(
@@ -193,7 +193,7 @@ public class IoTDBUDFManagementIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create function MAX_VALUE as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+          "create function MAX_VALUE as 'org.apache.iotdb.db.query.udf.example.Adder'");
       fail();
     } catch (SQLException throwable) {
       assertTrue(
@@ -209,10 +209,10 @@ public class IoTDBUDFManagementIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
 
       try {
-        statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+        statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
         fail();
       } catch (SQLException throwable) {
         assertTrue(throwable.getMessage().contains("Failed to register"));
@@ -226,10 +226,10 @@ public class IoTDBUDFManagementIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
 
       try {
-        statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+        statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
         fail();
       } catch (SQLException throwable) {
         assertTrue(
@@ -247,7 +247,7 @@ public class IoTDBUDFManagementIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
       statement.execute("drop function udf");
 
       try {
@@ -301,7 +301,7 @@ public class IoTDBUDFManagementIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function adder as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function adder as 'org.apache.iotdb.db.query.udf.example.Adder'");
       fail();
     } catch (SQLException throwable) {
       assertTrue(
@@ -355,7 +355,7 @@ public class IoTDBUDFManagementIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
 
       ResultSet resultSet = statement.executeQuery("show functions");
       assertEquals(3, resultSet.getMetaData().getColumnCount());
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFWindowQueryIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFWindowQueryIT.java
index 7129a34..5d3b761 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFWindowQueryIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDFWindowQueryIT.java
@@ -107,15 +107,15 @@ public class IoTDBUDFWindowQueryIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create function counter as \"org.apache.iotdb.db.query.udf.example.Counter\"");
+          "create function counter as 'org.apache.iotdb.db.query.udf.example.Counter'");
       statement.execute(
-          "create function accumulator as \"org.apache.iotdb.db.query.udf.example.Accumulator\"");
+          "create function accumulator as 'org.apache.iotdb.db.query.udf.example.Accumulator'");
       statement.execute(
-          "create function time_window_tester as \"org.apache.iotdb.db.query.udf.example.SlidingTimeWindowConstructionTester\"");
+          "create function time_window_tester as 'org.apache.iotdb.db.query.udf.example.SlidingTimeWindowConstructionTester'");
       statement.execute(
-          "create function size_window_0 as \"org.apache.iotdb.db.query.udf.example.SlidingSizeWindowConstructorTester0\"");
+          "create function size_window_0 as 'org.apache.iotdb.db.query.udf.example.SlidingSizeWindowConstructorTester0'");
       statement.execute(
-          "create function size_window_1 as \"org.apache.iotdb.db.query.udf.example.SlidingSizeWindowConstructorTester1\"");
+          "create function size_window_1 as 'org.apache.iotdb.db.query.udf.example.SlidingSizeWindowConstructorTester1'");
     } catch (SQLException throwable) {
       fail(throwable.getMessage());
     }
@@ -133,7 +133,7 @@ public class IoTDBUDFWindowQueryIT {
   public void testRowByRow() {
     String sql =
         String.format(
-            "select counter(s1, \"%s\"=\"%s\") from root.vehicle.d1",
+            "select counter(s1, '%s'='%s') from root.vehicle.d1",
             ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_ROW_BY_ROW);
 
     try (Connection connection =
@@ -195,7 +195,7 @@ public class IoTDBUDFWindowQueryIT {
   private void testSlidingSizeWindow(int windowSize) {
     String sql =
         String.format(
-            "select accumulator(s1, \"%s\"=\"%s\", \"%s\"=\"%s\") from root.vehicle.d1",
+            "select accumulator(s1, '%s'='%s', '%s'='%s') from root.vehicle.d1",
             ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_SLIDING_SIZE, WINDOW_SIZE_KEY, windowSize);
 
     try (Connection connection =
@@ -318,7 +318,7 @@ public class IoTDBUDFWindowQueryIT {
       int timeInterval, int slidingStep, int displayWindowBegin, int displayWindowEnd) {
     String sql =
         String.format(
-            "select accumulator(s1, s1, s1, \"%s\"=\"%s\", \"%s\"=\"%s\", \"%s\"=\"%s\", \"%s\"=\"%s\", \"%s\"=\"%s\") from root.vehicle.d1",
+            "select accumulator(s1, s1, s1, '%s'='%s', '%s'='%s', '%s'='%s', '%s'='%s', '%s'='%s') from root.vehicle.d1",
             ACCESS_STRATEGY_KEY,
             ACCESS_STRATEGY_SLIDING_TIME,
             TIME_INTERVAL_KEY,
@@ -393,7 +393,7 @@ public class IoTDBUDFWindowQueryIT {
   public void testSlidingTimeWindowWithTimeIntervalOnly(int timeInterval) {
     String sql =
         String.format(
-            "select time_window_tester(s1, \"%s\"=\"%s\") from root.vehicle.d1",
+            "select time_window_tester(s1, '%s'='%s') from root.vehicle.d1",
             TIME_INTERVAL_KEY, timeInterval);
 
     int displayWindowBegin = 0;
@@ -514,7 +514,7 @@ public class IoTDBUDFWindowQueryIT {
       int windowSize, int slidingStep, int consumptionPoint) {
     String sql =
         String.format(
-            "select size_window_0(s1, \"%s\"=\"%s\", \"%s\"=\"%s\"), size_window_1(s1, \"%s\"=\"%s\") from root.vehicle.d1",
+            "select size_window_0(s1, '%s'='%s', '%s'='%s'), size_window_1(s1, '%s'='%s') from root.vehicle.d1",
             "windowSize",
             windowSize,
             "slidingStep",
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFAlignByTimeQueryIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFAlignByTimeQueryIT.java
index c58cf95..97e7452 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFAlignByTimeQueryIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFAlignByTimeQueryIT.java
@@ -158,14 +158,14 @@ public class IoTDBUDTFAlignByTimeQueryIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
       statement.execute(
-          "create function multiplier as \"org.apache.iotdb.db.query.udf.example.Multiplier\"");
-      statement.execute("create function max as \"org.apache.iotdb.db.query.udf.example.Max\"");
+          "create function multiplier as 'org.apache.iotdb.db.query.udf.example.Multiplier'");
+      statement.execute("create function max as 'org.apache.iotdb.db.query.udf.example.Max'");
       statement.execute(
-          "create function terminate as \"org.apache.iotdb.db.query.udf.example.TerminateTester\"");
+          "create function terminate as 'org.apache.iotdb.db.query.udf.example.TerminateTester'");
       statement.execute(
-          "create function validate as \"org.apache.iotdb.db.query.udf.example.ValidateTester\"");
+          "create function validate as 'org.apache.iotdb.db.query.udf.example.ValidateTester'");
     } catch (SQLException throwable) {
       fail(throwable.getMessage());
     }
@@ -287,7 +287,7 @@ public class IoTDBUDTFAlignByTimeQueryIT {
   @Test
   public void queryWithoutValueFilter4() {
     String sqlStr =
-        "select udf(*, *, \"addend\"=\"" + ADDEND + "\"), *, udf(*, *) from root.vehicle.d1";
+        "select udf(*, *, 'addend'='" + ADDEND + "'), *, udf(*, *) from root.vehicle.d1";
 
     Set<Integer> s1AndS2WithAddend = new HashSet<>(Arrays.asList(0, 1, 2, 3));
     Set<Integer> s1AndS2 = new HashSet<>(Arrays.asList(6, 7, 8, 9));
@@ -325,7 +325,7 @@ public class IoTDBUDTFAlignByTimeQueryIT {
 
   @Test
   public void queryWithoutValueFilter5() {
-    String sqlStr = "select multiplier(s2, \"a\"=\"2\", \"b\"=\"5\") from root.vehicle.d1";
+    String sqlStr = "select multiplier(s2, 'a'='2', 'b'='5') from root.vehicle.d1";
 
     try (Connection connection =
             DriverManager.getConnection(
@@ -516,9 +516,9 @@ public class IoTDBUDTFAlignByTimeQueryIT {
   @Test
   public void queryWithValueFilter2() {
     String sqlStr =
-        "select udf(*, *, \"addend\"=\""
+        "select udf(*, *, 'addend'='"
             + ADDEND
-            + "\"), *, udf(*, *) from root.vehicle.d2"
+            + "'), *, udf(*, *) from root.vehicle.d2"
             + String.format(
                 " where s1 >= %d and s2 < %d",
                 (int) (0.25 * ITERATION_TIMES), (int) (0.75 * ITERATION_TIMES));
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFHybridQueryIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFHybridQueryIT.java
index 56011a5..591c3d6 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFHybridQueryIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFHybridQueryIT.java
@@ -91,7 +91,7 @@ public class IoTDBUDTFHybridQueryIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create function counter as \"org.apache.iotdb.db.query.udf.example.Counter\"");
+          "create function counter as 'org.apache.iotdb.db.query.udf.example.Counter'");
     } catch (SQLException throwable) {
       fail(throwable.getMessage());
     }
@@ -106,7 +106,7 @@ public class IoTDBUDTFHybridQueryIT {
   public void testUserDefinedBuiltInHybridAggregationQuery() {
     String sql =
         String.format(
-            "select count(*), counter(s1, \"%s\"=\"%s\") from root.vehicle.d1",
+            "select count(*), counter(s1, '%s'='%s') from root.vehicle.d1",
             ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_ROW_BY_ROW);
 
     try (Connection connection =
@@ -127,7 +127,7 @@ public class IoTDBUDTFHybridQueryIT {
   public void testUserDefinedFunctionFillFunctionHybridQuery() {
     String sql =
         String.format(
-            "select temperature, counter(temperature, \"%s\"=\"%s\") from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(float [linear, 1m, 1m])",
+            "select temperature, counter(temperature, '%s'='%s') from root.sgcc.wf03.wt01 where time = 2017-11-01T16:37:50.000 fill(float [linear, 1m, 1m])",
             ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_ROW_BY_ROW);
 
     try (Connection connection =
@@ -146,7 +146,7 @@ public class IoTDBUDTFHybridQueryIT {
   public void testLastUserDefinedFunctionQuery() {
     String sql =
         String.format(
-            "select last counter(temperature, \"%s\"=\"%s\") from root.sgcc.wf03.wt01",
+            "select last counter(temperature, '%s'='%s') from root.sgcc.wf03.wt01",
             ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_ROW_BY_ROW);
 
     try (Connection connection =
@@ -165,7 +165,7 @@ public class IoTDBUDTFHybridQueryIT {
   public void testUserDefinedFunctionAlignByDeviceQuery() {
     String sql =
         String.format(
-            "select adder(temperature), counter(temperature, \"%s\"=\"%s\") from root.sgcc.wf03.wt01 align by device",
+            "select adder(temperature), counter(temperature, '%s'='%s') from root.sgcc.wf03.wt01 align by device",
             ACCESS_STRATEGY_KEY, ACCESS_STRATEGY_ROW_BY_ROW);
 
     try (Connection connection =
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFNonAlignQueryIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFNonAlignQueryIT.java
index 134a73c..2ec9c70 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFNonAlignQueryIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFNonAlignQueryIT.java
@@ -123,7 +123,7 @@ public class IoTDBUDTFNonAlignQueryIT {
             DriverManager.getConnection(
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement statement = connection.createStatement()) {
-      statement.execute("create function udf as \"org.apache.iotdb.db.query.udf.example.Adder\"");
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
     } catch (SQLException throwable) {
       fail(throwable.getMessage());
     }
@@ -140,9 +140,9 @@ public class IoTDBUDTFNonAlignQueryIT {
   @Test
   public void queryWithoutValueFilter1() {
     String sqlStr =
-        "select udf(*, *, \"addend\"=\""
+        "select udf(*, *, 'addend'='"
             + ADDEND
-            + "\"), *, udf(*, *) from root.vehicle.d1 disable align";
+            + "'), *, udf(*, *) from root.vehicle.d1 disable align";
 
     Set<Integer> s1AndS2WithAddend = new HashSet<>(Arrays.asList(0, 1, 2, 3));
     Set<Integer> s1AndS2 = new HashSet<>(Arrays.asList(6, 7, 8, 9));
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/auth/IoTDBAuthorizationIT.java b/server/src/test/java/org/apache/iotdb/db/integration/auth/IoTDBAuthorizationIT.java
index 291c7f5..12678de 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/auth/IoTDBAuthorizationIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/auth/IoTDBAuthorizationIT.java
@@ -106,23 +106,23 @@ public class IoTDBAuthorizationIT {
 
         caught = false;
         try {
-          userStmt.execute("GRANT USER tempuser PRIVILEGES 'CREATE_TIMESERIES' ON root.a");
+          userStmt.execute("GRANT USER tempuser PRIVILEGES CREATE_TIMESERIES ON root.a");
         } catch (SQLException e) {
           caught = true;
         }
         assertTrue(caught);
 
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'ALL' ON root");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES ALL ON root");
 
         userStmt.execute("SET STORAGE GROUP TO root.a");
         userStmt.execute("CREATE TIMESERIES root.a.b WITH DATATYPE=INT32,ENCODING=PLAIN");
         userStmt.execute("INSERT INTO root.a(timestamp, b) VALUES (100, 100)");
         userStmt.execute("SELECT * from root.a");
-        userStmt.execute("GRANT USER tempuser PRIVILEGES 'SET_STORAGE_GROUP' ON root.a");
-        userStmt.execute("GRANT USER tempuser PRIVILEGES 'CREATE_TIMESERIES' ON root.b.b");
+        userStmt.execute("GRANT USER tempuser PRIVILEGES SET_STORAGE_GROUP ON root.a");
+        userStmt.execute("GRANT USER tempuser PRIVILEGES CREATE_TIMESERIES ON root.b.b");
 
-        adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'ALL' ON root");
-        adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'CREATE_TIMESERIES' ON root.b.b");
+        adminStmt.execute("REVOKE USER tempuser PRIVILEGES ALL ON root");
+        adminStmt.execute("REVOKE USER tempuser PRIVILEGES CREATE_TIMESERIES ON root.b.b");
 
         caught = false;
         try {
@@ -158,7 +158,7 @@ public class IoTDBAuthorizationIT {
 
         caught = false;
         try {
-          userStmt.execute("GRANT USER tempuser PRIVILEGES \"CREATE_TIMESERIES\" ON root.a");
+          userStmt.execute("GRANT USER tempuser PRIVILEGES CREATE_TIMESERIES ON root.a");
         } catch (SQLException e) {
           caught = true;
         }
@@ -279,7 +279,7 @@ public class IoTDBAuthorizationIT {
         // grant a non-existing user
         boolean caught = false;
         try {
-          adminStmt.execute("GRANT USER nulluser PRIVILEGES 'SET_STORAGE_GROUP' on root.a");
+          adminStmt.execute("GRANT USER nulluser PRIVILEGES SET_STORAGE_GROUP on root.a");
         } catch (SQLException e) {
           caught = true;
         }
@@ -288,17 +288,17 @@ public class IoTDBAuthorizationIT {
         // grant a non-existing privilege
         caught = false;
         try {
-          adminStmt.execute("GRANT USER tempuser PRIVILEGES 'NOT_A_PRIVILEGE' on root.a");
+          adminStmt.execute("GRANT USER tempuser PRIVILEGES NOT_A_PRIVILEGE on root.a");
         } catch (SQLException e) {
           caught = true;
         }
         assertTrue(caught);
 
         // duplicate grant
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'CREATE_USER' on root.a");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES CREATE_USER on root.a");
         caught = false;
         try {
-          adminStmt.execute("GRANT USER tempuser PRIVILEGES 'CREATE_USER' on root.a");
+          adminStmt.execute("GRANT USER tempuser PRIVILEGES CREATE_USER on root.a");
         } catch (SQLException e) {
           caught = true;
         }
@@ -307,7 +307,7 @@ public class IoTDBAuthorizationIT {
         // grant on a illegal seriesPath
         caught = false;
         try {
-          adminStmt.execute("GRANT USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on a.b");
+          adminStmt.execute("GRANT USER tempuser PRIVILEGES DELETE_TIMESERIES on a.b");
         } catch (SQLException e) {
           caught = true;
         }
@@ -316,7 +316,7 @@ public class IoTDBAuthorizationIT {
         // grant admin
         caught = false;
         try {
-          adminStmt.execute("GRANT USER root PRIVILEGES 'DELETE_TIMESERIES' on root.a.b");
+          adminStmt.execute("GRANT USER root PRIVILEGES DELETE_TIMESERIES on root.a.b");
         } catch (SQLException e) {
           caught = true;
         }
@@ -325,17 +325,17 @@ public class IoTDBAuthorizationIT {
         // no privilege to grant
         caught = false;
         try {
-          userStmt.execute("GRANT USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root.a.b");
+          userStmt.execute("GRANT USER tempuser PRIVILEGES DELETE_TIMESERIES on root.a.b");
         } catch (SQLException e) {
           caught = true;
         }
         assertTrue(caught);
 
         // revoke a non-existing privilege
-        adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'CREATE_USER' on root.a");
+        adminStmt.execute("REVOKE USER tempuser PRIVILEGES CREATE_USER on root.a");
         caught = false;
         try {
-          adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'CREATE_USER' on root.a");
+          adminStmt.execute("REVOKE USER tempuser PRIVILEGES CREATE_USER on root.a");
         } catch (SQLException e) {
           caught = true;
         }
@@ -344,7 +344,7 @@ public class IoTDBAuthorizationIT {
         // revoke a non-existing user
         caught = false;
         try {
-          adminStmt.execute("REVOKE USER tempuser1 PRIVILEGES 'CREATE_USER' on root.a");
+          adminStmt.execute("REVOKE USER tempuser1 PRIVILEGES CREATE_USER on root.a");
         } catch (SQLException e) {
           caught = true;
         }
@@ -353,7 +353,7 @@ public class IoTDBAuthorizationIT {
         // revoke on a illegal seriesPath
         caught = false;
         try {
-          adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on a.b");
+          adminStmt.execute("REVOKE USER tempuser PRIVILEGES DELETE_TIMESERIES on a.b");
         } catch (SQLException e) {
           caught = true;
         }
@@ -362,7 +362,7 @@ public class IoTDBAuthorizationIT {
         // revoke admin
         caught = false;
         try {
-          adminStmt.execute("REVOKE USER root PRIVILEGES 'DELETE_TIMESERIES' on root.a.b");
+          adminStmt.execute("REVOKE USER root PRIVILEGES DELETE_TIMESERIES on root.a.b");
         } catch (SQLException e) {
           caught = true;
         }
@@ -371,7 +371,7 @@ public class IoTDBAuthorizationIT {
         // no privilege to revoke
         caught = false;
         try {
-          userStmt.execute("REVOKE USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root.a.b");
+          userStmt.execute("REVOKE USER tempuser PRIVILEGES DELETE_TIMESERIES on root.a.b");
         } catch (SQLException e) {
           caught = true;
         }
@@ -380,24 +380,24 @@ public class IoTDBAuthorizationIT {
         // grant privilege to grant
         caught = false;
         try {
-          userStmt.execute("GRANT USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root.a.b");
+          userStmt.execute("GRANT USER tempuser PRIVILEGES DELETE_TIMESERIES on root.a.b");
         } catch (SQLException e) {
           caught = true;
         }
         assertTrue(caught);
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'GRANT_USER_PRIVILEGE' on root");
-        userStmt.execute("GRANT USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES GRANT_USER_PRIVILEGE on root");
+        userStmt.execute("GRANT USER tempuser PRIVILEGES DELETE_TIMESERIES on root");
 
         // grant privilege to revoke
         caught = false;
         try {
-          userStmt.execute("REVOKE USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root");
+          userStmt.execute("REVOKE USER tempuser PRIVILEGES DELETE_TIMESERIES on root");
         } catch (SQLException e) {
           caught = true;
         }
         assertTrue(caught);
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'REVOKE_USER_PRIVILEGE' on root");
-        userStmt.execute("REVOKE USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES REVOKE_USER_PRIVILEGE on root");
+        userStmt.execute("REVOKE USER tempuser PRIVILEGES DELETE_TIMESERIES on root");
       }
     }
   }
@@ -426,9 +426,9 @@ public class IoTDBAuthorizationIT {
         }
         assertTrue(caught);
 
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'SET_STORAGE_GROUP' ON root.a");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES SET_STORAGE_GROUP ON root.a");
         userStmt.execute("SET STORAGE GROUP TO root.a");
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'CREATE_TIMESERIES' ON root.a.b");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES CREATE_TIMESERIES ON root.a.b");
         userStmt.execute("CREATE TIMESERIES root.a.b WITH DATATYPE=INT32,ENCODING=PLAIN");
 
         caught = false;
@@ -443,13 +443,13 @@ public class IoTDBAuthorizationIT {
         caught = false;
         try {
           // privilege already exists
-          adminStmt.execute("GRANT USER tempuser PRIVILEGES 'SET_STORAGE_GROUP' ON root.a");
+          adminStmt.execute("GRANT USER tempuser PRIVILEGES SET_STORAGE_GROUP ON root.a");
         } catch (SQLException e) {
           caught = true;
         }
         assertTrue(caught);
 
-        adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'SET_STORAGE_GROUP' ON root.a");
+        adminStmt.execute("REVOKE USER tempuser PRIVILEGES SET_STORAGE_GROUP ON root.a");
         caught = false;
         try {
           // no privilege to create this one any more
@@ -471,13 +471,13 @@ public class IoTDBAuthorizationIT {
         caught = false;
         try {
           // privilege already exists
-          adminStmt.execute("GRANT USER tempuser PRIVILEGES 'CREATE_TIMESERIES' ON root.a.b");
+          adminStmt.execute("GRANT USER tempuser PRIVILEGES CREATE_TIMESERIES ON root.a.b");
         } catch (SQLException e) {
           caught = true;
         }
         assertTrue(caught);
 
-        adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'CREATE_TIMESERIES' ON root.a.b");
+        adminStmt.execute("REVOKE USER tempuser PRIVILEGES CREATE_TIMESERIES ON root.a.b");
         caught = false;
         try {
           // no privilege to create this one any more
@@ -498,15 +498,15 @@ public class IoTDBAuthorizationIT {
         assertTrue(caught);
 
         // the user can delete the timeseries now
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root.a");
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root.b");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES DELETE_TIMESERIES on root.a");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES DELETE_TIMESERIES on root.b");
         userStmt.execute("DELETE TIMESERIES root.a.b");
 
         // revoke the privilege to delete time series
         adminStmt.execute("CREATE TIMESERIES root.a.b WITH DATATYPE=INT32,ENCODING=PLAIN");
         adminStmt.execute("SET STORAGE GROUP TO root.b");
         adminStmt.execute("CREATE TIMESERIES root.b.a WITH DATATYPE=INT32,ENCODING=PLAIN");
-        adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'DELETE_TIMESERIES' on root.a");
+        adminStmt.execute("REVOKE USER tempuser PRIVILEGES DELETE_TIMESERIES on root.a");
         userStmt.execute("DELETE TIMESERIES root.b.a");
         caught = false;
         try {
@@ -534,9 +534,9 @@ public class IoTDBAuthorizationIT {
                   Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "tempuser", "temppw");
           Statement userStmt = userCon.createStatement()) {
 
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'SET_STORAGE_GROUP' ON root.a");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES SET_STORAGE_GROUP ON root.a");
         userStmt.execute("SET STORAGE GROUP TO root.a");
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'CREATE_TIMESERIES' ON root.a.b");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES CREATE_TIMESERIES ON root.a.b");
         userStmt.execute("CREATE TIMESERIES root.a.b WITH DATATYPE=INT32,ENCODING=PLAIN");
 
         // grant privilege to insert
@@ -547,11 +547,11 @@ public class IoTDBAuthorizationIT {
           caught = true;
         }
         assertTrue(caught);
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'INSERT_TIMESERIES' on root.a");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES INSERT_TIMESERIES on root.a");
         userStmt.execute("INSERT INTO root.a(timestamp, b) VALUES (1,100)");
 
         // revoke privilege to insert
-        adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'INSERT_TIMESERIES' on root.a");
+        adminStmt.execute("REVOKE USER tempuser PRIVILEGES INSERT_TIMESERIES on root.a");
         caught = false;
         try {
           userStmt.execute("INSERT INTO root.a(timestamp, b) VALUES (1,100)");
@@ -568,14 +568,14 @@ public class IoTDBAuthorizationIT {
           caught = true;
         }
         assertTrue(caught);
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'READ_TIMESERIES' on root.a");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES READ_TIMESERIES on root.a");
         userStmt.execute("SELECT * from root.a");
         userStmt.getResultSet().close();
         userStmt.execute("SELECT LAST b from root.a");
         userStmt.getResultSet().close();
 
         // revoke privilege to query
-        adminStmt.execute("REVOKE USER tempuser PRIVILEGES 'READ_TIMESERIES' on root.a");
+        adminStmt.execute("REVOKE USER tempuser PRIVILEGES READ_TIMESERIES on root.a");
         caught = false;
         try {
           userStmt.execute("SELECT * from root.a");
@@ -610,7 +610,7 @@ public class IoTDBAuthorizationIT {
         assertTrue(caught);
         adminStmt.execute("CREATE ROLE admin");
         adminStmt.execute(
-            "GRANT ROLE admin PRIVILEGES 'SET_STORAGE_GROUP','CREATE_TIMESERIES','DELETE_TIMESERIES','READ_TIMESERIES','INSERT_TIMESERIES' on root");
+            "GRANT ROLE admin PRIVILEGES SET_STORAGE_GROUP,CREATE_TIMESERIES,DELETE_TIMESERIES,READ_TIMESERIES,INSERT_TIMESERIES on root");
         adminStmt.execute("GRANT admin TO tempuser");
 
         userStmt.execute("SET STORAGE GROUP TO root.a");
@@ -621,7 +621,7 @@ public class IoTDBAuthorizationIT {
         userStmt.execute("SELECT * FROM root.**");
         userStmt.getResultSet().close();
 
-        adminStmt.execute("REVOKE ROLE admin PRIVILEGES 'DELETE_TIMESERIES' on root");
+        adminStmt.execute("REVOKE ROLE admin PRIVILEGES DELETE_TIMESERIES on root");
         caught = false;
         try {
           userStmt.execute("DELETE FROM root.* WHERE TIME <= 1000000000");
@@ -630,7 +630,7 @@ public class IoTDBAuthorizationIT {
         }
         assertTrue(caught);
 
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'READ_TIMESERIES' on root");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES READ_TIMESERIES on root");
         adminStmt.execute("REVOKE admin FROM tempuser");
         userStmt.execute("SELECT * FROM root.**");
         userStmt.getResultSet().close();
@@ -659,7 +659,7 @@ public class IoTDBAuthorizationIT {
       int privilegeCnt = 500;
       for (int i = 0; i < privilegeCnt; i++) {
         adminStmt.execute("CREATE TIMESERIES root.a.b" + i + " WITH DATATYPE=INT32,ENCODING=PLAIN");
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'INSERT_TIMESERIES' ON root.a.b" + i);
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES INSERT_TIMESERIES ON root.a.b" + i);
       }
       try (Connection userCon =
               DriverManager.getConnection(
@@ -800,12 +800,12 @@ public class IoTDBAuthorizationIT {
 
     try {
       adminStmt.execute("CREATE USER user1 'password1'");
-      adminStmt.execute("GRANT USER user1 PRIVILEGES 'READ_TIMESERIES' ON root.a.b");
+      adminStmt.execute("GRANT USER user1 PRIVILEGES READ_TIMESERIES ON root.a.b");
       adminStmt.execute("CREATE ROLE role1");
       adminStmt.execute(
-          "GRANT ROLE role1 PRIVILEGES 'READ_TIMESERIES','INSERT_TIMESERIES','DELETE_TIMESERIES' ON root.a.b.c");
+          "GRANT ROLE role1 PRIVILEGES READ_TIMESERIES,INSERT_TIMESERIES,DELETE_TIMESERIES ON root.a.b.c");
       adminStmt.execute(
-          "GRANT ROLE role1 PRIVILEGES 'READ_TIMESERIES','INSERT_TIMESERIES','DELETE_TIMESERIES' ON root.d.b.c");
+          "GRANT ROLE role1 PRIVILEGES READ_TIMESERIES,INSERT_TIMESERIES,DELETE_TIMESERIES ON root.d.b.c");
       adminStmt.execute("GRANT role1 TO user1");
 
       ResultSet resultSet = adminStmt.executeQuery("LIST USER PRIVILEGES  user1");
@@ -861,9 +861,9 @@ public class IoTDBAuthorizationIT {
         validateResultSet(resultSet, ans);
 
         adminStmt.execute(
-            "GRANT ROLE role1 PRIVILEGES 'READ_TIMESERIES','INSERT_TIMESERIES','DELETE_TIMESERIES' ON root.a.b.c");
+            "GRANT ROLE role1 PRIVILEGES READ_TIMESERIES,INSERT_TIMESERIES,DELETE_TIMESERIES ON root.a.b.c");
         adminStmt.execute(
-            "GRANT ROLE role1 PRIVILEGES 'READ_TIMESERIES','INSERT_TIMESERIES','DELETE_TIMESERIES' ON root.d.b.c");
+            "GRANT ROLE role1 PRIVILEGES READ_TIMESERIES,INSERT_TIMESERIES,DELETE_TIMESERIES ON root.d.b.c");
         resultSet = adminStmt.executeQuery("LIST ROLE PRIVILEGES role1");
         ans =
             "root.a.b.c : INSERT_TIMESERIES READ_TIMESERIES DELETE_TIMESERIES,\n"
@@ -875,7 +875,7 @@ public class IoTDBAuthorizationIT {
         validateResultSet(resultSet, ans);
 
         adminStmt.execute(
-            "REVOKE ROLE role1 PRIVILEGES 'INSERT_TIMESERIES','DELETE_TIMESERIES' ON root.a.b.c");
+            "REVOKE ROLE role1 PRIVILEGES INSERT_TIMESERIES,DELETE_TIMESERIES ON root.a.b.c");
 
         resultSet = adminStmt.executeQuery("LIST ROLE PRIVILEGES role1");
         ans =
@@ -1051,7 +1051,7 @@ public class IoTDBAuthorizationIT {
         validateResultSet(resultSet, ans);
 
         // with list user privilege
-        adminStmt.execute("GRANT USER tempuser PRIVILEGES 'LIST_USER' ON root");
+        adminStmt.execute("GRANT USER tempuser PRIVILEGES LIST_USER ON root");
         resultSet = userStmt.executeQuery("LIST USER");
         ans =
             "root,\n"
@@ -1112,7 +1112,7 @@ public class IoTDBAuthorizationIT {
                 Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
         Statement adminStmt = adminCon.createStatement()) {
       adminStmt.execute("CREATE USER tempuser 'temppw'");
-      adminStmt.execute("GRANT USER tempuser PRIVILEGES 'INSERT_TIMESERIES' on root.sg1");
+      adminStmt.execute("GRANT USER tempuser PRIVILEGES INSERT_TIMESERIES on root.sg1");
 
       try (Connection userCon =
               DriverManager.getConnection(
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/logical/IndexLogicalPlanTest.java b/server/src/test/java/org/apache/iotdb/db/qp/logical/IndexLogicalPlanTest.java
deleted file mode 100644
index 14ec78d..0000000
--- a/server/src/test/java/org/apache/iotdb/db/qp/logical/IndexLogicalPlanTest.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.db.qp.logical;
-
-import org.apache.iotdb.db.index.common.IndexType;
-import org.apache.iotdb.db.qp.logical.Operator.OperatorType;
-import org.apache.iotdb.db.qp.logical.crud.QueryOperator;
-import org.apache.iotdb.db.qp.logical.sys.CreateIndexOperator;
-import org.apache.iotdb.db.qp.logical.sys.DropIndexOperator;
-import org.apache.iotdb.db.qp.strategy.LogicalGenerator;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.time.ZoneId;
-import java.util.Arrays;
-import java.util.List;
-
-import static org.apache.iotdb.db.index.common.IndexConstant.BLOCK_SIZE;
-import static org.apache.iotdb.db.index.common.IndexConstant.PAA_DIM;
-import static org.apache.iotdb.db.index.common.IndexConstant.PATTERN;
-import static org.apache.iotdb.db.index.common.IndexConstant.THRESHOLD;
-import static org.apache.iotdb.db.index.common.IndexConstant.TOP_K;
-
-public class IndexLogicalPlanTest {
-
-  @Before
-  public void before() {}
-
-  @Test
-  public void testParseCreateIndexWholeMatching() {
-    String sqlStr =
-        "CREATE INDEX ON root.Ery.*.Glu WHERE time > 50 WITH INDEX=RTREE_PAA, PAA_dim=8";
-    Operator op = LogicalGenerator.generate(sqlStr, ZoneId.systemDefault());
-    Assert.assertEquals(CreateIndexOperator.class, op.getClass());
-    CreateIndexOperator createOperator = (CreateIndexOperator) op;
-    Assert.assertEquals(OperatorType.CREATE_INDEX, createOperator.getType());
-    Assert.assertNotNull(createOperator.getPaths());
-    Assert.assertEquals("root.Ery.*.Glu", createOperator.getPaths().get(0).toString());
-    Assert.assertEquals(IndexType.RTREE_PAA, createOperator.getIndexType());
-    Assert.assertEquals(50, createOperator.getTime());
-    Assert.assertEquals(1, createOperator.getProps().size());
-    Assert.assertEquals("8", createOperator.getProps().get(PAA_DIM));
-  }
-
-  @Test
-  public void testParseCreateIndexSubMatching() {
-    String sqlStr = "CREATE INDEX ON root.Wind.AZQ02.Speed WITH INDEX=ELB_INDEX, BLOCK_SIZE=5";
-    Operator op = LogicalGenerator.generate(sqlStr, ZoneId.systemDefault());
-    Assert.assertEquals(CreateIndexOperator.class, op.getClass());
-    CreateIndexOperator createOperator = (CreateIndexOperator) op;
-    Assert.assertEquals(OperatorType.CREATE_INDEX, createOperator.getType());
-    Assert.assertNotNull(createOperator.getPaths());
-    Assert.assertEquals("root.Wind.AZQ02.Speed", createOperator.getPaths().get(0).toString());
-    Assert.assertEquals(IndexType.ELB_INDEX, createOperator.getIndexType());
-    Assert.assertEquals(1, createOperator.getProps().size());
-    Assert.assertEquals("5", createOperator.getProps().get(BLOCK_SIZE));
-  }
-
-  @Test
-  public void testParseDropIndexWholeMatching() {
-    String sqlStr = "DROP INDEX RTREE_PAA ON root.Ery.*.Glu";
-    Operator op = LogicalGenerator.generate(sqlStr, ZoneId.systemDefault());
-    Assert.assertEquals(DropIndexOperator.class, op.getClass());
-    DropIndexOperator dropIndexOperator = (DropIndexOperator) op;
-    Assert.assertEquals(OperatorType.DROP_INDEX, dropIndexOperator.getType());
-    Assert.assertNotNull(dropIndexOperator.getPaths());
-    Assert.assertEquals("root.Ery.*.Glu", dropIndexOperator.getPaths().get(0).toString());
-    Assert.assertEquals(IndexType.RTREE_PAA, dropIndexOperator.getIndexType());
-  }
-
-  @Test
-  public void testParseDropIndexSubMatching() {
-    String sqlStr = "DROP INDEX ELB_INDEX ON root.Wind.AZQ02.Speed";
-    Operator op = LogicalGenerator.generate(sqlStr, ZoneId.systemDefault());
-    Assert.assertEquals(DropIndexOperator.class, op.getClass());
-    DropIndexOperator dropIndexOperator = (DropIndexOperator) op;
-    Assert.assertEquals(OperatorType.DROP_INDEX, dropIndexOperator.getType());
-    Assert.assertNotNull(dropIndexOperator.getPaths());
-    Assert.assertEquals("root.Wind.AZQ02.Speed", dropIndexOperator.getPaths().get(0).toString());
-    Assert.assertEquals(IndexType.ELB_INDEX, dropIndexOperator.getIndexType());
-  }
-
-  @Test
-  public void testParseQueryIndexWholeMatching() {
-    String sqlStr =
-        "SELECT TOP 2 Glu FROM root.Ery.* WHERE Glu LIKE (0, 120, 20, 80, 120, 100, 80, 0)";
-    Operator op = LogicalGenerator.generate(sqlStr, ZoneId.systemDefault());
-    Assert.assertEquals(QueryOperator.class, op.getClass());
-    QueryOperator queryOperator = (QueryOperator) op;
-    Assert.assertEquals(OperatorType.QUERY, queryOperator.getType());
-    Assert.assertEquals(
-        "Glu",
-        queryOperator.getSelectComponent().getResultColumns().get(0).getExpression().toString());
-    Assert.assertEquals(
-        "Glu",
-        queryOperator.getSelectComponent().getResultColumns().get(0).getExpression().toString());
-    Assert.assertEquals(
-        "root.Ery.*", queryOperator.getFromComponent().getPrefixPaths().get(0).getFullPath());
-    Assert.assertEquals(IndexType.RTREE_PAA, queryOperator.getIndexType());
-    Assert.assertEquals(2, queryOperator.getProps().size());
-    Assert.assertEquals(2, (int) queryOperator.getProps().get(TOP_K));
-    Assert.assertEquals(
-        "[0.0, 120.0, 20.0, 80.0, 120.0, 100.0, 80.0, 0.0]",
-        Arrays.toString((double[]) queryOperator.getProps().get(PATTERN)));
-  }
-
-  @Test
-  public void testParseQueryIndexSubMatching() {
-    String sqlStr =
-        "SELECT Speed.* FROM root.Wind.AZQ02 WHERE Speed "
-            + "CONTAIN (15, 14, 12, 12, 12, 11) WITH TOLERANCE 1 "
-            + "CONCAT (10, 20, 25, 24, 14, 8) WITH TOLERANCE 2 "
-            + "CONCAT  (8, 9, 10, 14, 15, 15) WITH TOLERANCE 1";
-    Operator op = LogicalGenerator.generate(sqlStr, ZoneId.systemDefault());
-    Assert.assertEquals(QueryOperator.class, op.getClass());
-    QueryOperator queryOperator = (QueryOperator) op;
-    Assert.assertEquals(OperatorType.QUERY, queryOperator.getType());
-    Assert.assertEquals(
-        "Speed",
-        queryOperator.getSelectComponent().getResultColumns().get(0).getExpression().toString());
-    Assert.assertEquals(
-        "Speed",
-        queryOperator.getSelectComponent().getResultColumns().get(0).getExpression().toString());
-    Assert.assertEquals(
-        "root.Wind.AZQ02", queryOperator.getFromComponent().getPrefixPaths().get(0).getFullPath());
-    Assert.assertEquals(IndexType.ELB_INDEX, queryOperator.getIndexType());
-    Assert.assertEquals(2, queryOperator.getProps().size());
-    Assert.assertEquals("[1.0, 2.0, 1.0]", queryOperator.getProps().get(THRESHOLD).toString());
-    Assert.assertTrue(queryOperator.getProps().get(PATTERN) instanceof List);
-    List pattern = (List) queryOperator.getProps().get(PATTERN);
-    Assert.assertEquals(
-        "[15.0, 14.0, 12.0, 12.0, 12.0, 11.0]", Arrays.toString((double[]) pattern.get(0)));
-    Assert.assertEquals(
-        "[10.0, 20.0, 25.0, 24.0, 14.0, 8.0]", Arrays.toString((double[]) pattern.get(1)));
-    Assert.assertEquals(
-        "[8.0, 9.0, 10.0, 14.0, 15.0, 15.0]", Arrays.toString((double[]) pattern.get(2)));
-  }
-}
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/other/TSPlanContextAuthorTest.java b/server/src/test/java/org/apache/iotdb/db/qp/other/TSPlanContextAuthorTest.java
index ea9d821..4998b1d 100644
--- a/server/src/test/java/org/apache/iotdb/db/qp/other/TSPlanContextAuthorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/qp/other/TSPlanContextAuthorTest.java
@@ -59,19 +59,19 @@ public class TSPlanContextAuthorTest {
           {"CREATE ROLE rolename", emptyPaths},
           {"DROP ROLE rolename", emptyPaths},
           {
-            "GRANT USER username PRIVILEGES 'SET_STORAGE_GROUP','INSERT_TIMESERIES' ON root.node1.a.b",
+            "GRANT USER username PRIVILEGES SET_STORAGE_GROUP,INSERT_TIMESERIES ON root.node1.a.b",
             testPaths
           },
           {
-            "REVOKE USER username PRIVILEGES 'SET_STORAGE_GROUP','INSERT_TIMESERIES' ON root.node1.a.b",
+            "REVOKE USER username PRIVILEGES SET_STORAGE_GROUP,INSERT_TIMESERIES ON root.node1.a.b",
             testPaths
           },
           {
-            "GRANT ROLE rolename PRIVILEGES 'SET_STORAGE_GROUP','INSERT_TIMESERIES' ON root.node1.a.b",
+            "GRANT ROLE rolename PRIVILEGES SET_STORAGE_GROUP,INSERT_TIMESERIES ON root.node1.a.b",
             testPaths
           },
           {
-            "REVOKE ROLE rolename PRIVILEGES 'SET_STORAGE_GROUP','INSERT_TIMESERIES' ON root.node1.a.b",
+            "REVOKE ROLE rolename PRIVILEGES SET_STORAGE_GROUP,INSERT_TIMESERIES ON root.node1.a.b",
             testPaths
           },
           {"GRANT rolename TO username", emptyPaths},
diff --git a/server/src/test/java/org/apache/iotdb/db/qp/physical/IndexSubMatchingPhysicalPlanTest.java b/server/src/test/java/org/apache/iotdb/db/qp/physical/IndexSubMatchingPhysicalPlanTest.java
deleted file mode 100644
index 5c1c19a..0000000
--- a/server/src/test/java/org/apache/iotdb/db/qp/physical/IndexSubMatchingPhysicalPlanTest.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.db.qp.physical;
-
-import org.apache.iotdb.db.exception.metadata.IllegalPathException;
-import org.apache.iotdb.db.exception.metadata.MetadataException;
-import org.apache.iotdb.db.exception.query.QueryProcessException;
-import org.apache.iotdb.db.index.common.IndexType;
-import org.apache.iotdb.db.metadata.MManager;
-import org.apache.iotdb.db.metadata.PartialPath;
-import org.apache.iotdb.db.qp.Planner;
-import org.apache.iotdb.db.qp.logical.Operator.OperatorType;
-import org.apache.iotdb.db.qp.physical.crud.QueryIndexPlan;
-import org.apache.iotdb.db.qp.physical.sys.CreateIndexPlan;
-import org.apache.iotdb.db.qp.physical.sys.DropIndexPlan;
-import org.apache.iotdb.db.utils.EnvironmentUtils;
-import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import java.util.List;
-
-import static org.apache.iotdb.db.index.common.IndexConstant.PATTERN;
-import static org.apache.iotdb.db.index.common.IndexConstant.THRESHOLD;
-import static org.junit.Assert.assertEquals;
-
-/** refer to org.apache.iotdb.db.qp.plan.PhysicalPlanTest */
-public class IndexSubMatchingPhysicalPlanTest {
-
-  private Planner processor = new Planner();
-
-  @Before
-  public void before() throws MetadataException {
-    MManager.getInstance().init();
-    MManager.getInstance().setStorageGroup(new PartialPath("root.Wind"));
-    MManager.getInstance()
-        .createTimeseries(
-            new PartialPath("root.Wind.AZQ02.Speed"),
-            TSDataType.FLOAT,
-            TSEncoding.PLAIN,
-            CompressionType.UNCOMPRESSED,
-            null);
-  }
-
-  @After
-  public void clean() throws IOException {
-    MManager.getInstance().clear();
-    EnvironmentUtils.cleanAllDir();
-  }
-
-  @Test
-  public void testCreateIndex() throws QueryProcessException {
-    String sqlStr = "CREATE INDEX ON root.Wind.AZQ02.Speed WITH INDEX=ELB_INDEX, BLOCK_SIZE=5";
-
-    Planner processor = new Planner();
-    CreateIndexPlan plan = (CreateIndexPlan) processor.parseSQLToPhysicalPlan(sqlStr);
-    System.out.println(plan);
-    assertEquals(
-        "paths: [root.Wind.AZQ02.Speed], index type: ELB_INDEX, start time: 0, props: {BLOCK_SIZE=5}",
-        plan.toString());
-  }
-
-  @Test
-  public void testDropIndex() throws QueryProcessException {
-    String sqlStr = "DROP INDEX ELB_INDEX ON root.Wind.AZQ02.Speed";
-    Planner processor = new Planner();
-    DropIndexPlan plan = (DropIndexPlan) processor.parseSQLToPhysicalPlan(sqlStr);
-    assertEquals("paths: [root.Wind.AZQ02.Speed], index type: ELB_INDEX", plan.toString());
-  }
-
-  @Test
-  public void testQueryIndex() throws QueryProcessException {
... 521 lines suppressed ...