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/08/17 06:13:12 UTC

[GitHub] [iotdb] jixuan1989 commented on a change in pull request #3738: Support Like grammar

jixuan1989 commented on a change in pull request #3738:
URL: https://github.com/apache/iotdb/pull/3738#discussion_r690060986



##########
File path: docs/UserGuide/Appendix/SQL-Reference.md
##########
@@ -716,9 +716,27 @@ In this situation, it will throws an exception if * corresponds to multiple sens
 
 ```
 
+* Regexp Statement
+
+Regexp Statement only supports regular expressions with data type of text and Java standard library style when matching
+```
+SELECT <SelectClause> FROM <FromClause> WHERE  <WhereClause>
+Select Clause : <Path> [COMMA <Path>]*
+FromClause : < PrefixPath > [COMMA < PrefixPath >]*
+WhereClause : andExpression (OPERATOR_OR andExpression)*
+andExpression : predicate (OPERATOR_AND predicate)*
+predicate : (suffixPath | fullPath) LIKE stringLiteral
+stringLiteral : SINGLE_QUOTE_STRING_LITERAL | DOUBLE_QUOTE_STRING_LITERAL

Review comment:
       here, `stringLiberal` should be regular expressions, rather than simple `SINGLE_QUOTE_STRING_LITERAL`.
   
   Besides, a reference of Java regular expressions should be given.

##########
File path: docs/UserGuide/Appendix/SQL-Reference.md
##########
@@ -716,9 +716,27 @@ In this situation, it will throws an exception if * corresponds to multiple sens
 
 ```
 
+* Regexp Statement
+
+Regexp Statement only supports regular expressions with data type of text and Java standard library style when matching

Review comment:
       Regexp Statement only supports  regular expressions with Java standard library style on timeseries which is TEXT data type

##########
File path: docs/zh/UserGuide/Appendix/SQL-Reference.md
##########
@@ -705,9 +705,27 @@ E.g. select * as temperature from root.sg.d1
 这种情况如果 * 匹配多个传感器,则无法正常显示。
 
 ```
+* Regexp 语句
+
+Regexp语句仅支持数据类型为 TEXT,匹配时为 Java 标准库风格的正则表达式
+```
+SELECT <SelectClause> FROM <FromClause> WHERE  <WhereClause>
+Select Clause : <Path> [COMMA <Path>]*
+FromClause : < PrefixPath > [COMMA < PrefixPath >]*
+WhereClause : andExpression (OPERATOR_OR andExpression)*
+andExpression : predicate (OPERATOR_AND predicate)*
+predicate : (suffixPath | fullPath) LIKE stringLiteral
+stringLiteral : SINGLE_QUOTE_STRING_LITERAL | DOUBLE_QUOTE_STRING_LITERAL
+
+Eg. select s1 from root.sg.d1 where s1 regexp 'Regexp'
+Eg. select s1, s2 FROM root.sg.d1 where s1 regexp 'regexp' and s2 regexp 'Regexp'
+Eg. select * from root.sg.d1 where s1 regexp 'Regexp'
+Eg. select * from root.sg.d1 where s1 regexp 'Regexp' and time > 100
+```
+
 * Like 语句
 
-模糊查询,仅支持数据类型为 TEXT,匹配时为 Java 标准库风格的正则表达式
+Like语句的用法和mysql相同, 但是仅支持数据类型为 TEXT

Review comment:
       Like语句的用法和mysql相同, 但是仅支持对数据类型为 TEXT的列进行过滤

##########
File path: docs/zh/UserGuide/Appendix/SQL-Reference.md
##########
@@ -705,9 +705,27 @@ E.g. select * as temperature from root.sg.d1
 这种情况如果 * 匹配多个传感器,则无法正常显示。
 
 ```
+* Regexp 语句
+
+Regexp语句仅支持数据类型为 TEXT,匹配时为 Java 标准库风格的正则表达式

Review comment:
       Regexp语句仅支持对数据类型为 TEXT的列进行过滤,传入的过滤条件为 Java 标准库风格的正则表达式

##########
File path: docs/UserGuide/Appendix/SQL-Reference.md
##########
@@ -716,9 +716,27 @@ In this situation, it will throws an exception if * corresponds to multiple sens
 
 ```
 
+* Regexp Statement
+
+Regexp Statement only supports regular expressions with data type of text and Java standard library style when matching
+```
+SELECT <SelectClause> FROM <FromClause> WHERE  <WhereClause>
+Select Clause : <Path> [COMMA <Path>]*
+FromClause : < PrefixPath > [COMMA < PrefixPath >]*
+WhereClause : andExpression (OPERATOR_OR andExpression)*
+andExpression : predicate (OPERATOR_AND predicate)*
+predicate : (suffixPath | fullPath) LIKE stringLiteral
+stringLiteral : SINGLE_QUOTE_STRING_LITERAL | DOUBLE_QUOTE_STRING_LITERAL
+
+Eg. select s1 from root.sg.d1 where s1 regexp 'Regexp'
+Eg. select s1, s2 FROM root.sg.d1 where s1 regexp 'regexp' and s2 regexp 'Regexp'
+Eg. select * from root.sg.d1 where s1 regexp 'Regexp'
+Eg. select * from root.sg.d1 where s1 regexp 'Regexp' and time > 100
+```
+
 * Like Statement
 
-Fuzzy query only supports regular expressions with data type of text and Java standard library style when matching
+The usage of Like Statement similar with mysql, but only support the regular expressions with data type of text

Review comment:
       The usage of `LIKE` Statement is similar with mysql, but only support the regular expressions on time series  which is TEXT data type
   
   
   BTW, I still do not get the difference between `regexp` and `like` in your description.

##########
File path: docs/UserGuide/Appendix/SQL-Reference.md
##########
@@ -716,9 +716,27 @@ In this situation, it will throws an exception if * corresponds to multiple sens
 
 ```
 
+* Regexp Statement
+
+Regexp Statement only supports regular expressions with data type of text and Java standard library style when matching
+```
+SELECT <SelectClause> FROM <FromClause> WHERE  <WhereClause>
+Select Clause : <Path> [COMMA <Path>]*
+FromClause : < PrefixPath > [COMMA < PrefixPath >]*
+WhereClause : andExpression (OPERATOR_OR andExpression)*
+andExpression : predicate (OPERATOR_AND predicate)*
+predicate : (suffixPath | fullPath) LIKE stringLiteral
+stringLiteral : SINGLE_QUOTE_STRING_LITERAL | DOUBLE_QUOTE_STRING_LITERAL
+
+Eg. select s1 from root.sg.d1 where s1 regexp 'Regexp'

Review comment:
       As this is an example, do not use 'Regexp', use a real regular expression.

##########
File path: docs/UserGuide/Appendix/SQL-Reference.md
##########
@@ -728,10 +746,10 @@ andExpression : predicate (OPERATOR_AND predicate)*
 predicate : (suffixPath | fullPath) LIKE stringLiteral
 stringLiteral : SINGLE_QUOTE_STRING_LITERAL | DOUBLE_QUOTE_STRING_LITERAL
 
-Eg. select s1 from root.sg.d1 where s1 like 'Regex'
-Eg. select s1, s2 FROM root.sg.d1 where s1 like 'regex' and s2 like 'Regex'
-Eg. select * from root.sg.d1 where s1 like 'Regex'
-Eg. select * from root.sg.d1 where s1 like 'Regex' and time > 100
+Eg. select * from root.sg.d1 where s1 like 'String'

Review comment:
       Why all examples are `select *`, especially you removed examples like `select s1`, `select s1, s2`. Is this kind of statement not supported?




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