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/14 11:15:42 UTC

[GitHub] [iotdb] jun0315 opened a new pull request #3959: Compatible influxdb protocol

jun0315 opened a new pull request #3959:
URL: https://github.com/apache/iotdb/pull/3959


   At present, many users use influxdb as a time series database. If users change to another database, there will be a relatively high migration cost. The PR goal is to make iotdb compatible with the influxdb protocol.
   
   The objectives actually achieved include:
   
   1. Support influxdb compatible insertion function.
   
   2. Support the basic query function compatible with incluxdb, including tag value filtering, file value filtering and time value filtering.
   
   3. Support some advanced functions compatible with incluxdb, including common count, first, last, Max, mean, median, min, mode, spread, StdDev and sum functions.
   
   The work completed at the code design level includes:
   
   1. Firstly, the performance of two relational mapping schemes is tested (including large-scale 20W data insertion and query test code), and finally a better scheme is determined for development.
   
   2. Complete the data schema mapping of the two protocols at the code level.
   
   3. Complete the data structure conversion of query results.
   
   4. Complete the G4 syntax of antlr4 of the query SQL of inluxdb and the generation of the corresponding traversal data structure.
   


-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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



##########
File path: site/src/main/.vuepress/config.js
##########
@@ -1499,7 +1499,8 @@ var config = {
 							['API/Programming-Cpp-Native-API','C++ 原生接口'],
 							['API/Programming-Go-Native-API','Go 原生接口'],
 							['API/Programming-TsFile-API','TsFile API'],
-							['API/Time-zone','时区']
+							['API/Time-zone','时区'],
+							['API/IotDB-InfluxDB','InfluxDB适配器']

Review comment:
       ```suggestion
   							['API/IoTDB-InfluxDB','InfluxDB 协议适配器']
   ```




-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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



##########
File path: .github/workflows/influxdb-iotdb.yml
##########
@@ -0,0 +1,68 @@
+#    Licensed 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.
+
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: InfluxDB-IotDB Test
+
+on:
+  push:
+    branches:
+      - master
+      - 'rel/*'
+    paths-ignore:
+      - 'docs/**'
+  pull_request:
+    branches:
+      - master
+      - 'rel/*'
+      - cluster_new

Review comment:
       > - cluster_new 
   
   This can be removed.




-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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






-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43086538/badge)](https://coveralls.io/builds/43086538)
   
   Coverage decreased (-0.04%) to 67.494% when pulling **7aaf5cff3571fc1a7886449ba9f87a6d2422f4fa on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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



##########
File path: docs/zh/UserGuide/API/IoTDB-InfluxDB.md
##########
@@ -0,0 +1,855 @@
+<!--
+
+    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-InfluxDB适配器
+
+
+## 1.背景
+
+InfluxDB是当前世界排名第一的时序数据库,具有繁荣的生态系统,目前很多用户使用它来作为自己的第一选择。但是,实际上线后,会有高可用,高扩展的需求。如果换成别的数据库,会有比较高的迁移成本。
+
+## 2.目标 
+
+开发一套Java版本的适配器可以使IoTDB兼容InfluxDB协议,完善IoTDB的功能。
+
+1. IoTDB-InfluxDB:支持InfluxDB写入;支持InfluxDB部分查询;支持完整的InfluxDB查询。
+2. 对正确性和性能的测试,不仅要适配InfluxDB,也要知道在繁重的负载下是否可以很好的工作,例如:以非常高的频率生成数据
+   1. 正确性测试:通过适配器以influxdb的协议插入数据,然后查询IoTDB数据库,将我们认为发送的内容与我们希望存储的内容进行比较。进行正确性测试
+   2. 性能测试:以多线程的方式或者以Fiber多协程方式并发写入和读取,进行性能测试,类似的 demo:https://github.com/Tencent/TencentKona-8/tree/KonaFiber/demo/fiber/iotdb-sync-stress-demo
+
+
+## 3.方案一
+
+### 3.1 IoTDB-InfluxDb适配器

Review comment:
       ```suggestion
   ### 3.1 IoTDB-InfluxDB适配器
   ```




-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43052189/badge)](https://coveralls.io/builds/43052189)
   
   Coverage increased (+0.01%) to 67.548% when pulling **2a53d22687b63cda8da807f61e0e75366a028728 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43055336/badge)](https://coveralls.io/builds/43055336)
   
   Coverage decreased (-0.02%) to 67.519% when pulling **e063be214159b8b0ee04ba3c24b7077c4c570fd4 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43053500/badge)](https://coveralls.io/builds/43053500)
   
   Coverage increased (+0.01%) to 67.547% when pulling **4ed43a9b865e5f7eb465cf630d4d69023c40dff8 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43178344/badge)](https://coveralls.io/builds/43178344)
   
   Coverage increased (+0.2%) to 67.732% when pulling **28a62c24c97d45f5efe1736b1b8c15a1809924d3 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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] jun0315 commented on pull request #3959: [IOTDB-1689] Compatible influxdb protocol

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


   > Is there any design docs to help understand the implementation?
   
   Thank you for your attention! Design docs is here: https://github.com/jun0315/iotdb/blob/influxdb-connect/docs/zh/UserGuide/API/IoTDB-InfluxDB.md
   
   


-- 
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 #3959: Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/42859617/badge)](https://coveralls.io/builds/42859617)
   
   Coverage increased (+0.2%) to 67.542% when pulling **7d428361615a789d7b7e7a038410c2c4bd52d7bc on jun0315:influxdb-connect** into **511cb00e948a3dfa9d435daf8ffa4ba9a5d9317f 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43040117/badge)](https://coveralls.io/builds/43040117)
   
   Coverage increased (+0.2%) to 67.545% when pulling **b41c3ca4f1cd2432e1cd10771ad0209c2129c819 on jun0315:influxdb-connect** into **511cb00e948a3dfa9d435daf8ffa4ba9a5d9317f 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43046898/badge)](https://coveralls.io/builds/43046898)
   
   Coverage increased (+0.2%) to 67.55% when pulling **411d8747b614e70f526b43993f04650e08770d55 on jun0315:influxdb-connect** into **511cb00e948a3dfa9d435daf8ffa4ba9a5d9317f 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43055240/badge)](https://coveralls.io/builds/43055240)
   
   Coverage increased (+0.02%) to 67.552% when pulling **e063be214159b8b0ee04ba3c24b7077c4c570fd4 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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



##########
File path: iotdb-influxdb/README.md
##########
@@ -0,0 +1,852 @@
+`<!--
+
+    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-InfluxDB适配器
+
+
+## 1.背景
+
+InfluxDB是当前世界排名第一的时序数据库,具有繁荣的生态系统,目前很多用户使用它来作为自己的第一选择。但是,实际上线后,会有高可用,高扩展的需求。如果换成别的数据库,会有比较高的迁移成本。
+
+## 2.目标 
+
+开发一套Java版本的适配器可以使IotDB兼容InfluxDB协议,完善IotDB的功能。
+
+1. IotDB-InfluxDB:支持InfluxDB写入;支持InfluxDB部分查询;支持完整的InfluxDB查询。
+2. 对正确性和性能的测试,不仅要适配InfluxDB,也要知道在繁重的负载下是否可以很好的工作,例如:以非常高的频率生成数据
+   1. 正确性测试:通过适配器以influxb的协议插入数据,然后查询IotDB数据库,将我们认为发送的内容与我们希望存储的内容进行比较。进行正确性测试
+   2. 性能测试:以多线程的方式或者以Fiber多协程方式并发写入和读取,进行性能测试,类似的 demo:https://github.com/Tencent/TencentKona-8/tree/KonaFiber/demo/fiber/iotdb-sync-stress-demo
+
+
+## 3.方案一
+
+### 3.1 IotDB-InfluxDb适配器
+
+适配器是一个继承至InfluxDB基类的子类,实现了InfluxDB主要的写入和查询方法,用户通过改变代码中InfluxDB的实现类,从而使InfluxDB原有的操作函数没有改变,但是会以IotDB的协议写入IotDB数据库中。
+
+![image-20210725001005079](image/image-20210725001005079.png)
+
+### 3.2 将InfluxDB的数据格式转换成IotDB的数据格式
+
+#### 3.2.1问题
+
+1. 问题:InfluxDB中Tag的顺序不敏感,而在IoTDB中是敏感的。
+
+   a. InfluxDB的时序构成
+
+   ​	i. measurement
+
+   ​	ii.tag key tag value
+
+   ​	iii. field key field value
+
+   b. IotDB的时序构成
+
+   ​	i. storage group
+
+   ​	ii. path(time series ID)
+
+   ​	iii. measurement
+
+2. 关键点:需要记录每个tag对应的顺序,确保InfluxDB中label顺序不同的同一条时序对应到IoTDB中也是一条时序
+3. 需要解决的事情
+   1. 怎样映射tag key和它对应的order
+   2. 在不知道所有的label key的情况下,怎么维护他们之间的顺序
+
+### 3.2.2解决方案
+
+##### 3.2.2.1主要思想
+
+1. 内存中Map <Database_Measurement, Map <Tag Key, Order> > table结构维护Tag之间的顺序
+2. InfluxDB中时序根据label顺序对应到IoTDB
+
+##### 3.2.2.2实例
+
+a. 添加时序
+
+   1.  InfluxDB时序(database=testdabase):
+
+      (1)student{name=A,phone=B,sex=C}
+
+      (2)student{address=D}
+
+      (3))student{name=A,phone=B,sex=C,address=D} 
+
+   2. 简单对上述InfluxDB的时序进行解释,database是testdatabase;measurement是student;tag分别是name,phone、sex和address
+
+   3.  (1)对应的记录tag顺序的table为
+
+      ​	
+
+      | database_measurement | tag_key | order |
+      | -------------------- | ------- | ----- |
+      | testdatabase_student | name    | 0     |
+      | testdatabase_student | phone   | 1     |
+      | testdatabase_student | sex     | 2     |
+
+      (2)对应的记录tag顺序的table为
+
+      ​	
+
+      | database_measurement | tag_key | order |
+      | -------------------- | ------- | ----- |
+      | testdatabase_student | name    | 0     |
+      | testdatabase_student | phone   | 1     |
+      | testdatabase_student | sex     | 2     |
+      | testdatabase_student | address | 3     |
+
+      (3)对应的记录tag顺序的table为
+
+      ​	
+
+      | database_measurement | tag_key | order |
+      | -------------------- | ------- | ----- |
+      | testdatabase_student | name    | 0     |
+      | testdatabase_student | phone   | 1     |
+      | testdatabase_student | sex     | 2     |
+      | testdatabase_student | address | 3     |
+
+4. (1)对应IotDB时序为root._testdatabase_student.A.B.C
+
+   (2)对应IotDB时序为root._testdatabase_student.ph.ph.ph.D(其中ph表示占位符)
+
+   (3)对应IotDB时序为root._testdatabase_student.A.B.C.D
+
+5. 为了重启时候对table的恢复,在IoTDB中记录数据
+
+   | `root.TAG_INFO.database_name` | `root.TAG_INFO.measurement_name` | `root.TAG_INFO.tag_name` | `root.TAG_INFO.tag_order` |
+   | :------------------------------- | :------------------------------- | :----------------------- | :------------------------ |
+   | testdatabase| student             | name                     | 0                         |
+   | testdatabase| student             | phone                    | 1                         |
+   | testdatabase| student             | sex                      | 2                         |
+   | testdatabase| student             | address                  | 3                         |
+
+b. 查询数据
+
+	1. 查询student中phone=B的数据。在testdatabase_student中phone的顺序为1,order最大值是3,对应到IotDB的查询为:select * from root.testdatabase_student.*.B
+ 	2. 查询student中phone=B且存储的socre>97的数据,对应到IotDB的查询为:select * from root.testdatabase_student.*.B where socre>98
+ 	3. 查询student中phone=B且存储的socre>97且时间在最近七天内的的数据,对应到IotDB的查询为:select * from root.testdatabase_student.*.B where socre>98 and time > now()-7d
+
+## 4.方案二
+
+### 4.1关系映射
+
+#### 4.11influxdb:
+
+1. database
+2. measurement
+3. tag key tag value.  field key field value
+
+#### 4.1.2iotdb
+
+1. storage group
+2. device
+3. timeseries
+
+我们将上面对应的三点一一对应,举例如下
+
+### 4.2举例
+
+#### 4.2.1写入
+
+inlfuxbd的写入语句分别为(默认database=testdata)
+
+1. insert cpu,host=serverA,region=us value=0.64(tag为host、region)
+2. insert cpu,host=serverA,region=us,sex=n value=0.64(tag为host、region、sex)
+
+最终写入情况为:
+
+![image-20210730203234012](image/image-20210730203234012.png)

Review comment:
       The file names of the images are meaningless, we'd better rename them.

##########
File path: iotdb-influxdb/README.md
##########
@@ -0,0 +1,852 @@
+`<!--

Review comment:
       ![image](https://user-images.githubusercontent.com/30497621/134799507-587a4d4e-e200-4ba0-b497-8f57dd06c221.png)
   
   The header is not right.

##########
File path: .github/workflows/influxdb-iotdb.yml
##########
@@ -0,0 +1,56 @@
+# This workflow will build a Java project with Maven

Review comment:
       Please add the Apache License here.

##########
File path: iotdb-influxdb/src/main/antlr4/org/apache/iotdb/influxdb/qp/sql/InfluxDB.g4
##########
@@ -0,0 +1,1186 @@
+/*
+ * 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.
+ */
+
+grammar InfluxDB;
+
+singleStatement
+    : statement (';')? EOF
+    ;
+
+/*
+ * According to The Definitive ANTLR 4 Reference, 11. Altering the Parse with Semantic Predicates, Altering the Parse with Semantic Predicates.
+ * "It s a good idea to avoid embedding predicates in the parser when possible for efficiency and clarity reasons."
+ * So if unnecessary, don't use embedding predicates.
+ */
+
+ statement
+   : selectClause fromClause whereClause? #selectStatement
+   ;
+
+selectClause
+   : SELECT resultColumn (COMMA resultColumn)*
+   ;
+
+resultColumn
+   : expression (AS ID)?
+   ;
+
+expression
+   : LR_BRACKET unary=expression RR_BRACKET
+   | (PLUS | MINUS) unary=expression
+   | leftExpression=expression (STAR | DIV | MOD) rightExpression=expression
+   | leftExpression=expression (PLUS | MINUS) rightExpression=expression
+//   | functionName=suffixPath LR_BRACKET expression (COMMA expression)* functionAttribute* RR_BRACKET

Review comment:
       Please remove meaningless comments and all rules that are not used.

##########
File path: iotdb-influxdb/src/main/antlr4/org/apache/iotdb/influxdb/qp/sql/InfluxDB.g4
##########
@@ -0,0 +1,1186 @@
+/*
+ * 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.
+ */
+
+grammar InfluxDB;
+
+singleStatement
+    : statement (';')? EOF
+    ;
+
+/*
+ * According to The Definitive ANTLR 4 Reference, 11. Altering the Parse with Semantic Predicates, Altering the Parse with Semantic Predicates.
+ * "It s a good idea to avoid embedding predicates in the parser when possible for efficiency and clarity reasons."
+ * So if unnecessary, don't use embedding predicates.
+ */
+
+ statement
+   : selectClause fromClause whereClause? #selectStatement
+   ;
+
+selectClause
+   : SELECT resultColumn (COMMA resultColumn)*
+   ;
+
+resultColumn
+   : expression (AS ID)?
+   ;
+
+expression
+   : LR_BRACKET unary=expression RR_BRACKET
+   | (PLUS | MINUS) unary=expression
+   | leftExpression=expression (STAR | DIV | MOD) rightExpression=expression
+   | leftExpression=expression (PLUS | MINUS) rightExpression=expression
+//   | functionName=suffixPath LR_BRACKET expression (COMMA expression)* functionAttribute* RR_BRACKET
+//   | suffixPath
+   | functionName=nodeName LR_BRACKET expression (COMMA expression)* functionAttribute* RR_BRACKET
+   | nodeName
+   | literal=SINGLE_QUOTE_STRING_LITERAL
+   ;
+
+functionAttribute
+   : COMMA functionAttributeKey=stringLiteral OPERATOR_EQ functionAttributeValue=stringLiteral
+   ;
+
+
+
+compressor

Review comment:
       We only keep the useful parts. 
   
   > compressor
   
   It is useless, right? let's delete 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 edited a comment on pull request #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43017572/badge)](https://coveralls.io/builds/43017572)
   
   Coverage increased (+0.1%) to 67.523% when pulling **df8c6db30d1a2a2d64f7c28d5b1507c23857ed9e on jun0315:influxdb-connect** into **511cb00e948a3dfa9d435daf8ffa4ba9a5d9317f 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] chengjianyun commented on pull request #3959: [IOTDB-1689] Compatible influxdb protocol

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


   Is there any design docs to help understand the implementation? 


-- 
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] jun0315 commented on pull request #3959: [IOTDB-1689] Compatible influxdb protocol

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


   @SteveYurongSu Thanks for your review, I have fixed the above problem.  I also carefully checked the naming convention of IoTDB to avoid some problems. Please take a look again :D
   
   


-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43053222/badge)](https://coveralls.io/builds/43053222)
   
   Coverage decreased (-0.009%) to 67.527% when pulling **4ed43a9b865e5f7eb465cf630d4d69023c40dff8 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43298901/badge)](https://coveralls.io/builds/43298901)
   
   Coverage increased (+0.2%) to 67.772% when pulling **83d64ba4f3b974c7e17403c0c08040bcf80c69e7 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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



##########
File path: .github/workflows/influxdb-iotdb.yml
##########
@@ -0,0 +1,68 @@
+#    Licensed 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.
+
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: InfluxDB-IotDB Test

Review comment:
       ```suggestion
   name: InfluxDB-IoTDB Test
   ```




-- 
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] HTHou commented on a change in pull request #3959: Compatible influxdb protocol

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



##########
File path: iotdb-influxdb/pom.xml
##########
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>0.13.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>iotdb-influxdb</artifactId>
+    <name>iotdb-influxdb</name>
+    <description>compatible with the protocol of influxdb.</description>
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-session</artifactId>
+            <version>0.12.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-thrift</artifactId>
+            <version>0.12.0</version>
+        </dependency>

Review comment:
       Why using 0.12.0 here? 
   The version of Master branch is 0.13, which is not compatible with 0.12.0 actually...




-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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



##########
File path: iotdb-influxdb/src/test/java/org/apache/iotdb/influxdb/IoTDBInfluxDBTest.java
##########
@@ -0,0 +1,154 @@
+/*
+ * 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.
+ */
+
+package org.apache.iotdb.influxdb;
+
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.session.Session;
+import org.apache.iotdb.session.SessionDataSet;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+
+import org.junit.Before;
+
+import java.util.*;
+
+public class IoTDBInfluxDBTest {
+  private IoTDBInfluxDB iotDBInfluxDB;
+
+  private static final String LOCAL_HOST = "127.0.0.1";
+  private static Session session;
+  private static final String ROOT_T1 = "root.teststress.test1";
+  private static final String ROOT_T2 = "root.teststress.test2";
+
+  @Before
+  public void setUp() throws IoTDBConnectionException {
+    // 创建 连接

Review comment:
       ```suggestion
       // create session
   ```




-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43071865/badge)](https://coveralls.io/builds/43071865)
   
   Coverage decreased (-0.07%) to 67.469% when pulling **7011b1b2574996e8467b763f15d40d1c37aa0d98 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 commented on pull request #3959: Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/42857792/badge)](https://coveralls.io/builds/42857792)
   
   Coverage decreased (-0.01%) to 67.379% when pulling **15bc593aef199343b38898fda686cda003ec2e6e on jun0315:influxdb-connect** into **511cb00e948a3dfa9d435daf8ffa4ba9a5d9317f 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] jun0315 commented on a change in pull request #3959: Compatible influxdb protocol

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



##########
File path: iotdb-influxdb/pom.xml
##########
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>0.13.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>iotdb-influxdb</artifactId>
+    <name>iotdb-influxdb</name>
+    <description>compatible with the protocol of influxdb.</description>
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-session</artifactId>
+            <version>0.12.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-thrift</artifactId>
+            <version>0.12.0</version>
+        </dependency>

Review comment:
       Thanks for your reply!
   When I developed this adapter, version 0.13 had not been released. Due to my negligence, I didn't choose LATEST version. I will fix this problem later and change 0.12 to LATEST




-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43139327/badge)](https://coveralls.io/builds/43139327)
   
   Coverage increased (+0.003%) to 67.538% when pulling **26b61e39085af8bb64eb37a8afa67050ff91d4dc on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43071621/badge)](https://coveralls.io/builds/43071621)
   
   Coverage decreased (-0.08%) to 67.456% when pulling **7011b1b2574996e8467b763f15d40d1c37aa0d98 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43053176/badge)](https://coveralls.io/builds/43053176)
   
   Coverage increased (+0.03%) to 67.568% when pulling **4ed43a9b865e5f7eb465cf630d4d69023c40dff8 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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



##########
File path: iotdb-influxdb/src/test/java/org/apache/iotdb/influxdb/IoTDBInfluxDBTest.java
##########
@@ -0,0 +1,154 @@
+/*
+ * 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.
+ */
+
+package org.apache.iotdb.influxdb;
+
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.session.Session;
+import org.apache.iotdb.session.SessionDataSet;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+
+import org.junit.Before;
+
+import java.util.*;
+
+public class IoTDBInfluxDBTest {
+  private IoTDBInfluxDB iotDBInfluxDB;
+
+  private static final String LOCAL_HOST = "127.0.0.1";
+  private static Session session;
+  private static final String ROOT_T1 = "root.teststress.test1";
+  private static final String ROOT_T2 = "root.teststress.test2";
+
+  @Before
+  public void setUp() throws IoTDBConnectionException {
+    // 创建 连接

Review comment:
       ```suggestion
       // create session
   ```




-- 
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] jun0315 commented on a change in pull request #3959: [IOTDB-1689] Compatible influxdb protocol

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



##########
File path: iotdb-influxdb/src/test/java/org/apache/iotdb/influxdb/IoTDBInfluxDBTest.java
##########
@@ -0,0 +1,154 @@
+/*
+ * 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.
+ */
+
+package org.apache.iotdb.influxdb;
+
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.session.Session;
+import org.apache.iotdb.session.SessionDataSet;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+
+import org.junit.Before;
+
+import java.util.*;
+
+public class IoTDBInfluxDBTest {
+  private IoTDBInfluxDB iotDBInfluxDB;
+
+  private static final String LOCAL_HOST = "127.0.0.1";
+  private static Session session;
+  private static final String ROOT_T1 = "root.teststress.test1";
+  private static final String ROOT_T2 = "root.teststress.test2";
+
+  @Before
+  public void setUp() throws IoTDBConnectionException {
+    // 创建 连接

Review comment:
       I have changed all the Chinese in the project into English  :D :D




-- 
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] jun0315 commented on a change in pull request #3959: [IOTDB-1689] Compatible influxdb protocol

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



##########
File path: iotdb-influxdb/src/test/java/org/apache/iotdb/influxdb/IoTDBInfluxDBTest.java
##########
@@ -0,0 +1,154 @@
+/*
+ * 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.
+ */
+
+package org.apache.iotdb.influxdb;
+
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.session.Session;
+import org.apache.iotdb.session.SessionDataSet;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+
+import org.junit.Before;
+
+import java.util.*;
+
+public class IoTDBInfluxDBTest {
+  private IoTDBInfluxDB iotDBInfluxDB;
+
+  private static final String LOCAL_HOST = "127.0.0.1";
+  private static Session session;
+  private static final String ROOT_T1 = "root.teststress.test1";
+  private static final String ROOT_T2 = "root.teststress.test2";
+
+  @Before
+  public void setUp() throws IoTDBConnectionException {
+    // 创建 连接

Review comment:
       I have changed all the Chinese in the project into English  :D :D




-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43139207/badge)](https://coveralls.io/builds/43139207)
   
   Coverage increased (+0.01%) to 67.548% when pulling **26b61e39085af8bb64eb37a8afa67050ff91d4dc on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43017570/badge)](https://coveralls.io/builds/43017570)
   
   Coverage increased (+0.1%) to 67.49% when pulling **df8c6db30d1a2a2d64f7c28d5b1507c23857ed9e on jun0315:influxdb-connect** into **511cb00e948a3dfa9d435daf8ffa4ba9a5d9317f 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43317659/badge)](https://coveralls.io/builds/43317659)
   
   Coverage increased (+0.2%) to 67.777% when pulling **32a899a0151d6e5564534b0ee0daf8d630e05438 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43053934/badge)](https://coveralls.io/builds/43053934)
   
   Coverage decreased (-0.02%) to 67.516% when pulling **4ed43a9b865e5f7eb465cf630d4d69023c40dff8 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/42881026/badge)](https://coveralls.io/builds/42881026)
   
   Coverage increased (+0.007%) to 67.396% when pulling **d5ac11e8392f3592624692336950e5534ca99b49 on jun0315:influxdb-connect** into **511cb00e948a3dfa9d435daf8ffa4ba9a5d9317f 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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



##########
File path: docs/zh/UserGuide/API/IoTDB-InfluxDB.md
##########
@@ -0,0 +1,855 @@
+<!--
+
+    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-InfluxDB适配器
+
+
+## 1.背景
+
+InfluxDB是当前世界排名第一的时序数据库,具有繁荣的生态系统,目前很多用户使用它来作为自己的第一选择。但是,实际上线后,会有高可用,高扩展的需求。如果换成别的数据库,会有比较高的迁移成本。
+
+## 2.目标 
+
+开发一套Java版本的适配器可以使IoTDB兼容InfluxDB协议,完善IoTDB的功能。
+
+1. IoTDB-InfluxDB:支持InfluxDB写入;支持InfluxDB部分查询;支持完整的InfluxDB查询。
+2. 对正确性和性能的测试,不仅要适配InfluxDB,也要知道在繁重的负载下是否可以很好的工作,例如:以非常高的频率生成数据
+   1. 正确性测试:通过适配器以influxdb的协议插入数据,然后查询IoTDB数据库,将我们认为发送的内容与我们希望存储的内容进行比较。进行正确性测试
+   2. 性能测试:以多线程的方式或者以Fiber多协程方式并发写入和读取,进行性能测试,类似的 demo:https://github.com/Tencent/TencentKona-8/tree/KonaFiber/demo/fiber/iotdb-sync-stress-demo
+
+
+## 3.方案一
+
+### 3.1 IoTDB-InfluxDb适配器

Review comment:
       ```suggestion
   ### 3.1 IoTDB-InfluxDB适配器
   ```




-- 
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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   We have disassembled this PR into several small PRs. 
   
   For more details, see https://issues.apache.org/jira/browse/IOTDB-1689 
   


-- 
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 closed pull request #3959: [IOTDB-1689] Compatible influxdb protocol

Posted by GitBox <gi...@apache.org>.
SteveYurongSu closed pull request #3959:
URL: https://github.com/apache/iotdb/pull/3959


   


-- 
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] jun0315 commented on pull request #3959: [IOTDB-1689] Compatible influxdb protocol

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


   @SteveYurongSu Thanks for your review,I have fixed the above problem.


-- 
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 #3959: Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/42862079/badge)](https://coveralls.io/builds/42862079)
   
   Coverage increased (+0.1%) to 67.495% when pulling **d5e0a2e3dc1e91f3e90186c06d52b2d2c58ab439 on jun0315:influxdb-connect** into **511cb00e948a3dfa9d435daf8ffa4ba9a5d9317f 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43053293/badge)](https://coveralls.io/builds/43053293)
   
   Coverage increased (+0.003%) to 67.538% when pulling **4ed43a9b865e5f7eb465cf630d4d69023c40dff8 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43085364/badge)](https://coveralls.io/builds/43085364)
   
   Coverage decreased (-0.08%) to 67.452% when pulling **2a83a443310acbb4bd0354b05ab39f84a414e092 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43053040/badge)](https://coveralls.io/builds/43053040)
   
   Coverage decreased (-0.02%) to 67.514% when pulling **bb5e4a8b9e467ee471c34d6a4d95a18d51d3e546 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43041486/badge)](https://coveralls.io/builds/43041486)
   
   Coverage increased (+0.1%) to 67.533% when pulling **916514f61ba860d1fc5825df996958e2c29a0c5f on jun0315:influxdb-connect** into **511cb00e948a3dfa9d435daf8ffa4ba9a5d9317f 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43055213/badge)](https://coveralls.io/builds/43055213)
   
   Coverage increased (+0.03%) to 67.566% when pulling **e063be214159b8b0ee04ba3c24b7077c4c570fd4 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43077100/badge)](https://coveralls.io/builds/43077100)
   
   Coverage decreased (-0.06%) to 67.479% when pulling **ce0181b96c15dfb9fd3f833f8de0b00ecd193c01 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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 #3959: [IOTDB-1689] Compatible influxdb protocol

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


   
   [![Coverage Status](https://coveralls.io/builds/43053894/badge)](https://coveralls.io/builds/43053894)
   
   Coverage increased (+0.005%) to 67.541% when pulling **4ed43a9b865e5f7eb465cf630d4d69023c40dff8 on jun0315:influxdb-connect** into **96b5269f0fc6e02927563d4481da3bfb310fc7b1 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