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

rong pushed a commit to branch iotdb-1620
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/iotdb-1620 by this push:
     new 5679cb6  g4: ID
5679cb6 is described below

commit 5679cb67478a560ffe40dfd61ee376c9989013e8
Author: Steve Yurong Su <[email protected]>
AuthorDate: Wed Oct 6 11:17:42 2021 +0800

    g4: ID
---
 .../antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4   | 36 +++++-----------------
 .../Data-Concept/Data-Model-and-Terminology.md     |  4 +--
 .../Data-Concept/Data-Model-and-Terminology.md     |  6 +---
 3 files changed, 10 insertions(+), 36 deletions(-)

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
index e3e37ad..f9aaaef 100644
--- 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
@@ -1439,31 +1439,13 @@ DATETIME
       (('+' | '-') INT ':' INT)?)?
     ;
 
-/** Allow unicode rule/token names */
-ID : FIRST_NAME_CHAR NAME_CHAR*;
-
-fragment
-NAME_CHAR
-    :   'A'..'Z'
-    |   'a'..'z'
-    |   '0'..'9'
-    |   '_'
-    |   '-'
-    |   ':'
-    |   '/'
-    |   '@'
-    |   '#'
-    |   '$'
-    |   '%'
-    |   '&'
-    |   '+'
-    |   '{'
-    |   '}'
-    |   CN_CHAR
+ID
+    : ID_CHAR+
+    | '"' (~'"' | '""')* '"'
+    | '`' (~'`' | '``')* '`'
     ;
 
-fragment
-FIRST_NAME_CHAR
+fragment ID_CHAR
     :   'A'..'Z'
     |   'a'..'z'
     |   '0'..'9'
@@ -1474,15 +1456,14 @@ FIRST_NAME_CHAR
     |   '$'
     |   '%'
     |   '&'
-    |   '+'
     |   '{'
     |   '}'
     |   CN_CHAR
     ;
 
 fragment CN_CHAR
-  : '\u2E80'..'\u9FFF'
-  ;
+    : '\u2E80'..'\u9FFF'
+    ;
 
 DOUBLE_QUOTE_STRING_LITERAL
     : '"' ('\\' . | ~'"' )*? '"'
@@ -1492,7 +1473,6 @@ SINGLE_QUOTE_STRING_LITERAL
     : '\'' ('\\' . | ~'\'' )*? '\''
     ;
 
-//Characters and write it this way for case sensitivity
 fragment A
     : 'a' | 'A'
     ;
@@ -1598,5 +1578,5 @@ fragment Z
     ;
 
 WS
-    : [ \r\n\t]+ -> channel(HIDDEN)
+    : [ \u000B\t\r\n]+ -> channel(HIDDEN)
     ;
diff --git a/docs/UserGuide/Data-Concept/Data-Model-and-Terminology.md 
b/docs/UserGuide/Data-Concept/Data-Model-and-Terminology.md
index eb66047..cee30ce 100644
--- a/docs/UserGuide/Data-Concept/Data-Model-and-Terminology.md
+++ b/docs/UserGuide/Data-Concept/Data-Model-and-Terminology.md
@@ -82,11 +82,9 @@ The following are the constraints on the layer 
(`layer_name`):
 * Except for the beginning layer (`root`) of the time series, the characters 
supported in other layers are as follows:
 
   * Chinese characters:  `"\u2E80"` to `"\u9FFF"`
-  * `"+", "&", "%", "$", "#", "@", "/", "_", "-", ":"`
+  * `"_","/","@","#","$","%","&","{","}"`
   * `"A"` to `"Z"`, `"a"` to `"z"`, `"0"` to `"9"`
 
-  Among them, `'-'` and `':'` cannot be the first character, and  `'+'` cannot 
be used alone.
-
 * In addition to the beginning layer (`root`) of the time series and the 
storage group layer, other layers also support the use of special strings 
referenced by \` or `" ` as its name. It should be noted that the quoted string 
cannot contain `.` characters. Here are some legal examples:
 
   * root.sg."select".""""."\$", which contains 5 layers: root, sg, select, "", 
\$
diff --git a/docs/zh/UserGuide/Data-Concept/Data-Model-and-Terminology.md 
b/docs/zh/UserGuide/Data-Concept/Data-Model-and-Terminology.md
index 294a6b1..46e1938 100644
--- a/docs/zh/UserGuide/Data-Concept/Data-Model-and-Terminology.md
+++ b/docs/zh/UserGuide/Data-Concept/Data-Model-and-Terminology.md
@@ -83,13 +83,9 @@ layer_name : identifier
 
 * 除了时间序列的开头的层级(`root`)外,其他的层级支持的字符如下:
   * 中文字符`"\u2E80"`到`"\u9FFF"`
-  * `"+","&","%","$","#","@","/","_","-",":"`
+  * `"_","/","@","#","$","%","&","{","}"`
   * `"A"`到`"Z"`,`"a"`到`"z"`,`"0"`到`"9"`
-
-  其中`'-'` 和` ':'` 不能放置在第一位,不能使用单个 `'+'`。
-
 * 除了时间序列的开头的层级(`root`)和存储组层级外,层级还支持使用被  \`  或者 ` " ` 
符号引用的特殊字符串作为其名称。需要注意的是,被引用的字符串不可带有 `.` 字符。下面是一些合法的例子:
-
   * root.sg."select".""""."\$",5 个层级分别为 root, sg, select, "", \$
   * root.sg.\`\`\`\`.\`from\`.\`\$\`,5 个层级分别为 root, sg, \`\`, from, \$
 

Reply via email to