You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/10/12 12:25:37 UTC

[GitHub] [iotdb] liuminghui233 opened a new pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

liuminghui233 opened a new pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134


   The current ANTLR g4 file is not elegant.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] SteveYurongSu commented on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
SteveYurongSu commented on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-948377665


   > > > @liuminghui233 Hi, I noticed that double quotation marks are changed to single in this PR. Is this an incompatible change?
   > > 
   > > 
   > > @cornmonster Yes, later I will submit another PR to redefine and clarify the usage of `, " and '.
   > > The ' mark is used to quote a literal string.
   > > The usage of " and ` will be the same. They are used to quote an id or a path layer name with special chars.
   > 
   > Understood.
   > 
   > I had a look at the g4 file of rel/0.12, and I didn't see any usage of the backtick (`).
   > 
   > So how about using only the backtick (`) to handle special chars in a path and keep using the single and double quotation mark for the string literals?
   > 
   > We can keep the backward compatibility then.
   
   Sorry for the late reply.
   
   The reason we want to break the backward compatibility is that the usage of `"` is actually not well-defined.
   
   In a time series path layer, `"` can handle special chars but the `"` will be saved at the same time. If we execute 
   ```SQL
   insert into root.sg."(Hello|World)"(time, s1) values(0, 0) 
   ```
   then we will have a time series `root.sg."(Hello|World)".s1` in DB. This is not very elegant.
   
   For an ID, if it is quoted by `"`, we don't want to keep the `"` saved.
   
   In MySQL and SQLite, 
   
   ```
   IDENTIFIER:
       '"' (~'"' | '""')* '"'
       | '`' (~'`' | '``')* '`'
       | '[' ~']'* ']'
       | [a-zA-Z_] [a-zA-Z_0-9]*
      ; // TODO check: needs more chars in set
   
   STRING_LITERAL: '\'' ( ~'\'' | '\'\'')* '\'';
   ```
   
   Their usage is clearer and more elegant so we want to be consistent with them.
   
   WDYT?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] liuminghui233 commented on a change in pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
liuminghui233 commented on a change in pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#discussion_r731444033



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4
##########
@@ -0,0 +1,992 @@
+/*
+ * 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_VALE
+    : 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
+    : '\'' PRIVILEGE_VALUE_RANGE '\''

Review comment:
       I agree with you!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] SteveYurongSu commented on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
SteveYurongSu commented on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-947265708


   > @liuminghui233 Hi, I noticed that double quotation marks are changed to single in this PR. Is this an incompatible change?
   
   @cornmonster Yes, later I will submit another PR to redefine and clarify the usage of `, " and '.
   
   The ' mark is used to quote a literal string.
   
   The usage of " and ` will be the same. They are used to quote an id or a path layer name with special chars.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] SteveYurongSu commented on a change in pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
SteveYurongSu commented on a change in pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#discussion_r730522835



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4
##########
@@ -0,0 +1,992 @@
+/*
+ * 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_VALE

Review comment:
       ```suggestion
   ENCODING_VALUE
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-941007597


   
   [![Coverage Status](https://coveralls.io/builds/43594983/badge)](https://coveralls.io/builds/43594983)
   
   Coverage decreased (-0.3%) to 67.489% when pulling **a8e06cf3901a235d5f0ab313e56eb73d64fe9ca7 on liuminghui233:antlr4_rewrite** into **ffab5bd9f100edf0ca314002c24a860b69bd6f81 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-941007597


   
   [![Coverage Status](https://coveralls.io/builds/43470514/badge)](https://coveralls.io/builds/43470514)
   
   Coverage decreased (-0.03%) to 67.731% when pulling **23b627fee97953a6cb7082e5a34376a6075efe81 on liuminghui233:antlr4_rewrite** into **da269383089752a6bbaa9b8f09fc3be9e6a118b5 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-941007597


   
   [![Coverage Status](https://coveralls.io/builds/43595451/badge)](https://coveralls.io/builds/43595451)
   
   Coverage increased (+0.01%) to 67.453% when pulling **f0cc4482912aa5f390455828a9f4be42f8db45bc on liuminghui233:antlr4_rewrite** into **e4b7f64deb54b3fc186424cf969a68bff23a6fc7 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-941007597


   
   [![Coverage Status](https://coveralls.io/builds/43614608/badge)](https://coveralls.io/builds/43614608)
   
   Coverage decreased (-0.005%) to 67.439% when pulling **35af3ad53630040f06653279a26dacc25f0642c0 on liuminghui233:antlr4_rewrite** into **e4b7f64deb54b3fc186424cf969a68bff23a6fc7 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] liuminghui233 commented on a change in pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
liuminghui233 commented on a change in pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#discussion_r731443681



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4
##########
@@ -0,0 +1,992 @@
+/*
+ * 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_VALE

Review comment:
       I have fixed it ~




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls commented on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-941007597


   
   [![Coverage Status](https://coveralls.io/builds/43440893/badge)](https://coveralls.io/builds/43440893)
   
   Coverage decreased (-0.03%) to 67.73% when pulling **b75f216be83f24a28aaebee9a651b8c2cb12b50c on liuminghui233:antlr4_rewrite** into **da269383089752a6bbaa9b8f09fc3be9e6a118b5 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] coveralls edited a comment on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-941007597


   
   [![Coverage Status](https://coveralls.io/builds/43470514/badge)](https://coveralls.io/builds/43470514)
   
   Coverage decreased (-0.03%) to 67.731% when pulling **23b627fee97953a6cb7082e5a34376a6075efe81 on liuminghui233:antlr4_rewrite** into **da269383089752a6bbaa9b8f09fc3be9e6a118b5 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] SteveYurongSu commented on a change in pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
SteveYurongSu commented on a change in pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#discussion_r730523593



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlLexer.g4
##########
@@ -0,0 +1,992 @@
+/*
+ * 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_VALE
+    : 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
+    : '\'' PRIVILEGE_VALUE_RANGE '\''

Review comment:
       I think `'` is unnecessary when we have `PRIVILEGE_VALUE_RANGE`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] cornmonster commented on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
cornmonster commented on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-947269775


   > > @liuminghui233 Hi, I noticed that double quotation marks are changed to single in this PR. Is this an incompatible change?
   > 
   > @cornmonster Yes, later I will submit another PR to redefine and clarify the usage of `, " and '.
   > 
   > The ' mark is used to quote a literal string.
   > 
   > The usage of " and ` will be the same. They are used to quote an id or a path layer name with special chars.
   
   Understood. 
   
   I had a look at the g4 file of rel/0.12, and I didn't see any usage of the backtick (`).
   
   So how about using only the backtick (`) to handle special chars in a path and keep using the single and double quotation mark for the string literals? 
   
   We can keep the backward compatibility then.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] cornmonster commented on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
cornmonster commented on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-947258955


   @liuminghui233 Hi, I noticed that double quotation marks are changed to single in this PR. Is this an incompatible change? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] cornmonster commented on pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
cornmonster commented on pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134#issuecomment-948234052


   @SteveYurongSu Hi, do you have any comments on my suggestion?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] JackieTien97 merged pull request #4134: [IOTDB-1280] Rewrite the Antlr grammar file

Posted by GitBox <gi...@apache.org>.
JackieTien97 merged pull request #4134:
URL: https://github.com/apache/iotdb/pull/4134


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org