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/09/02 05:49:45 UTC

[GitHub] [iotdb] HTHou commented on a change in pull request #3889: [IOTDB-1601]Add Like and REGEXP statement user guide in DML

HTHou commented on a change in pull request #3889:
URL: https://github.com/apache/iotdb/pull/3889#discussion_r700763210



##########
File path: docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
##########
@@ -924,7 +924,78 @@ Total line number = 2
 It costs 0.002s
 ```
 
+### Fuzzy query
 
+Fuzzy query is divided into Like statement and Regexp statement, both of which can support fuzzy matching of Text type data
+
+Like statement:
+
+Example 1: Query data containing c in value under root.sg.device,% means any 0 or more characters
+
+```
+IoTDB> select * from root.sg.device where value like '%cc%'
++-----------------------------+-----------------------------+
+|                         Time|         root.sg.device.value|
++-----------------------------+-----------------------------+
+|2017-11-07T23:59:00.000+08:00|                     aabbccdd| 
+|2017-11-07T23:59:00.000+08:00|                           cc|
++-----------------------------+-----------------------------+
+Total line number = 2
+It costs 0.002s
+```
+
+Example 2: Query root.sg.device The middle of the value value is b, before and after it is a single character, _ means any single character
+```
+IoTDB> select * from root.sg.device where value like '_b_'
++-----------------------------+-----------------------------+
+|                         Time|         root.sg.device.value|
++-----------------------------+-----------------------------+
+|2017-11-07T23:59:00.000+08:00|                          abc| 
++-----------------------------+-----------------------------+

Review comment:
       ```suggestion
   IoTDB> select * from root.sg.device where value like '_b_'
   +-----------------------------+--------------------+
   |                         Time|root.sg.device.value|
   +-----------------------------+--------------------+
   |2017-11-07T23:59:00.000+08:00|                 abc| 
   +-----------------------------+--------------------+
   ```

##########
File path: docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
##########
@@ -924,7 +924,78 @@ Total line number = 2
 It costs 0.002s
 ```
 
+### Fuzzy query
 
+Fuzzy query is divided into Like statement and Regexp statement, both of which can support fuzzy matching of Text type data
+
+Like statement:
+
+Example 1: Query data containing c in value under root.sg.device,% means any 0 or more characters

Review comment:
       ```suggestion
   Like statement:
   
   Example 1: Query data containing `'cc'` in `value` under `root.sg.device`. 
   The percentage (`%`) wildcard matches any string of zero or more characters.
   
   ```

##########
File path: docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
##########
@@ -924,7 +924,78 @@ Total line number = 2
 It costs 0.002s
 ```
 
+### Fuzzy query
 
+Fuzzy query is divided into Like statement and Regexp statement, both of which can support fuzzy matching of Text type data

Review comment:
       ```suggestion
   Fuzzy query is divided into Like statement and Regexp statement, both of which can support fuzzy matching of TEXT type data.
   ```

##########
File path: docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
##########
@@ -924,7 +924,78 @@ Total line number = 2
 It costs 0.002s
 ```
 
+### Fuzzy query
 
+Fuzzy query is divided into Like statement and Regexp statement, both of which can support fuzzy matching of Text type data
+
+Like statement:
+
+Example 1: Query data containing c in value under root.sg.device,% means any 0 or more characters
+
+```
+IoTDB> select * from root.sg.device where value like '%cc%'
++-----------------------------+-----------------------------+
+|                         Time|         root.sg.device.value|
++-----------------------------+-----------------------------+
+|2017-11-07T23:59:00.000+08:00|                     aabbccdd| 
+|2017-11-07T23:59:00.000+08:00|                           cc|
++-----------------------------+-----------------------------+

Review comment:
       ```suggestion
   +-----------------------------+--------------------+
   |                         Time|root.sg.device.value|
   +-----------------------------+--------------------+
   |2017-11-07T23:59:00.000+08:00|            aabbccdd| 
   |2017-11-07T23:59:00.000+08:00|                  cc|
   +-----------------------------+--------------------+
   ```

##########
File path: docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
##########
@@ -924,7 +924,78 @@ Total line number = 2
 It costs 0.002s
 ```
 
+### Fuzzy query
 
+Fuzzy query is divided into Like statement and Regexp statement, both of which can support fuzzy matching of Text type data
+
+Like statement:
+
+Example 1: Query data containing c in value under root.sg.device,% means any 0 or more characters
+
+```
+IoTDB> select * from root.sg.device where value like '%cc%'
++-----------------------------+-----------------------------+
+|                         Time|         root.sg.device.value|
++-----------------------------+-----------------------------+
+|2017-11-07T23:59:00.000+08:00|                     aabbccdd| 
+|2017-11-07T23:59:00.000+08:00|                           cc|
++-----------------------------+-----------------------------+
+Total line number = 2
+It costs 0.002s
+```
+
+Example 2: Query root.sg.device The middle of the value value is b, before and after it is a single character, _ means any single character

Review comment:
       ```suggestion
   Example 2: Query data that consists of 3 characters and the second character is `'b'` in `value` under `root.sg.device`.
   The underscore (`_`) wildcard matches any single character.
   ```




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