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 2022/01/17 13:22:47 UTC

[GitHub] [iotdb] SteveYurongSu commented on a change in pull request #4827: [IOTDB-2396] Compatible with 0.12 on language structure

SteveYurongSu commented on a change in pull request #4827:
URL: https://github.com/apache/iotdb/pull/4827#discussion_r785985343



##########
File path: docs/UserGuide/Appendix/Keywords.md
##########
@@ -0,0 +1,212 @@
+<!--
+
+    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.
+
+-->
+
+# Keywords and Reserved Words

Review comment:
       Add it to config.js

##########
File path: integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFBuiltinFunctionIT.java
##########
@@ -201,7 +201,7 @@ public void testStringProcessingFunctions() {
         Statement statement = connection.createStatement()) {
       ResultSet resultSet =
           statement.executeQuery(
-              "select STRING_CONTAINS(s6, 's'='0'), STRING_MATCHES(s6, 'regex'='\\d') from root.sg.d1");

Review comment:
       This is kind of wired...

##########
File path: docs/zh/UserGuide/IoTDB-SQL-Language/Syntax-Conventions.md
##########
@@ -21,103 +21,162 @@
 
 # 语法约定
 
-## 双引号(\")、反引号(\`)
+## 字面值常量
 
-双引号和反引号内引用的字符串被解释为标识符(ID),被引用的字符串一般包含特殊字符。需要注意的是,被引用的字符串不可带有 `.` 字符。
+该部分对 IoTDB 中支持的字面值常量进行说明,包括字符串常量、数值型常量、时间戳常量、布尔型常量和空值。
 
-标识符(ID)的定义为:
+### 字符串常量
 
-```sql
-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'
-    | '_'
-    | ':'
-    | '@'
-    | '#'
-    | '$'
-    | '{'
-    | '}'
-    | CN_CHAR
-    ;
-
-fragment CN_CHAR
-    : '\u2E80'..'\u9FFF'
-    ;
+字符串是由单引号(`'`)或双引号(`"`)字符括起来的字符序列。示例如下:
+```js
+'a string'
+"another string"
 ```
 
-标志符的使用场景:
-* `TRIGGER`,`FUNCTION`(UDF),`CONTINUOUS QUERY`,`USER`,`ROLE` 等的名字。
-* 时间序列路径的表达:除了时间序列的开头的层级(`root`)和存储组层级外,层级还支持使用被  \`  或者 ` " ` 符号引用的特殊字符串作为其名称。
+字符串字面值的使用场景:
 
-例子:
+- `INSERT` 或者 `SELECT` 中用于表达 `TEXT` 类型数据的场景 
+- SQL 中 UDF 和 Trigger 的 Java 类全类名
+- `CREATE TRIGGER` 语句中描述触发器属性的键值对 
+- UDF 函数输入参数中的属性
+- `LOAD` / `REMOVE` / `SETTLE` 指令中的文件路径 
+- 用户密码
+
+通过以下几种方式可以在字符串内使用引号:
+
+- 使用两个连续单引号转义单引号,即 `''` 转义为 `'`。
+- 使用两个连续双引号转义双引号,即 `""` 转义为 `"`。
+- 在引号前使用转义符 (\\)。

Review comment:
       双引号里面\转义单引号
   单引号里面\转义双引号

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
##########
@@ -166,5 +171,50 @@ public static Operator generate(TSLastDataQueryReq req, ZoneId zoneId)
     return queryOp;
   }
 
+  @TestOnly
+  public static Operator generate(String sql, ZoneId zoneId) throws ParseCancellationException {

Review comment:
       简化一下哈 = =

##########
File path: docs/zh/UserGuide/Appendix/Keywords.md
##########
@@ -0,0 +1,212 @@
+<!--
+
+    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.
+
+-->
+
+# 关键字和保留字
+
+以下为 IoTDB 0.13 版本的关键字,其中保留字用 **(R)** 标志。

Review comment:
       目前不区分。




-- 
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