You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by jf...@apache.org on 2021/12/31 22:44:45 UTC

[iotdb] 01/01: Initial commit for code generation feature.

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

jfeinauer pushed a commit to branch experimental/code-generation
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit a0739bde47808b9b70b8e1ea8c78e2baea4d1d9f
Author: julian <j....@pragmaticminds.de>
AuthorDate: Fri Dec 31 23:40:33 2021 +0100

    Initial commit for code generation feature.
---
 pom.xml                                            | 4220 +++++++++++++-------
 server/pom.xml                                     |    6 +
 tsfile/pom.xml                                     |   35 +
 .../tsfile/read/filter/codegen/DynamicFilter.java  |   52 +
 .../read/filter/codegen/GenerableFilter.java       |   12 +
 .../tsfile/read/filter/codegen/Generator.java      |   69 +
 .../tsfile/read/filter/operator/AndFilter.java     |   19 +-
 .../iotdb/tsfile/read/filter/operator/Eq.java      |   25 +-
 .../iotdb/tsfile/read/filter/operator/Gt.java      |   27 +-
 .../iotdb/tsfile/read/filter/operator/GtEq.java    |   27 +-
 .../iotdb/tsfile/read/filter/operator/Lt.java      |   26 +-
 .../iotdb/tsfile/read/filter/operator/LtEq.java    |   26 +-
 .../iotdb/tsfile/read/filter/operator/NotEq.java   |   25 +-
 .../tsfile/read/filter/operator/OrFilter.java      |   18 +-
 .../iotdb/tsfile/read/filter/operator/Regexp.java  |   20 +-
 .../read/reader/series/FileSeriesReader.java       |    5 +-
 .../tsfile/read/filter/operator/GeneratorTest.java |   87 +
 .../org/apache/iotdb/tsfile/write/PerformTest.java |   24 +
 .../tsfile/write/TsFilterPerformanceTest.java      |  410 ++
 19 files changed, 3717 insertions(+), 1416 deletions(-)

diff --git a/pom.xml b/pom.xml
index e07dc38..c82840e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!--
 
     Licensed to the Apache Software Foundation (ASF) under one
@@ -18,774 +18,1518 @@
     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</groupId>
-        <artifactId>apache</artifactId>
-        <version>23</version>
-    </parent>
-    <groupId>org.apache.iotdb</groupId>
-    <artifactId>iotdb-parent</artifactId>
-    <version>0.13.0-SNAPSHOT</version>
-    <packaging>pom</packaging>
-    <name>Apache IoTDB Project Parent POM</name>
-    <description>This is the top level project that builds, packages the tsfile, iotdb engine, jdbc, and integration libs.</description>
-    <licenses>
-        <license>
-            <name>The Apache License, Version 2.0</name>
-            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-        </license>
-    </licenses>
-    <scm>
-        <connection>scm:git:ssh://git@github.com/apache/iotdb.git</connection>
-        <developerConnection>scm:git:ssh://git@github.com/apache/iotdb.git</developerConnection>
-        <url>ssh://git@github.com:apache/iotdb.git</url>
-        <tag>rel/0.10</tag>
-    </scm>
-    <!-- Only configure the site distribution as the rest is handled by the apache parent -->
-    <distributionManagement>
-        <site>
-            <id>apache.website</id>
-            <url>scm:git:https://gitbox.apache.org/repos/asf/iotdb-website.git</url>
-        </site>
-    </distributionManagement>
-    <issueManagement>
-        <system>Jira</system>
-        <url>https://issues.apache.org/jira/browse/iotdb</url>
-    </issueManagement>
-    <mailingLists>
-        <mailingList>
-            <name>Apache IoTDB Developer List</name>
-            <subscribe>mailto:dev-subscribe@iotdb.apache.org</subscribe>
-            <unsubscribe>mailto:dev-unsubscribe@iotdb.apache.org</unsubscribe>
-            <post>mailto:dev@iotdb.apache.org</post>
-            <archive>http://mail-archives.apache.org/mod_mbox/iotdb-dev/</archive>
-        </mailingList>
-        <mailingList>
-            <name>IoTDB Commits List</name>
-            <subscribe>mailto:commit-subscribe@iotdb.apache.org</subscribe>
-            <unsubscribe>mailto:commits-unsubscribe@iotdb.apache.org</unsubscribe>
-            <post>mailto:commits@iotdb.apache.org</post>
-            <archive>http://mail-archives.apache.org/mod_mbox/iotdb-commits/</archive>
-        </mailingList>
-        <mailingList>
-            <name>IoTDB Jira Notifications List</name>
-            <subscribe>mailto:notifications-subscribe@iotdb.apache.org</subscribe>
-            <unsubscribe>mailto:notifications-unsubscribe@iotdb.apache.org</unsubscribe>
-            <post>mailto:notifications@iotdb.apache.org</post>
-            <archive>http://mail-archives.apache.org/mod_mbox/iotdb-notifications/</archive>
-        </mailingList>
-    </mailingLists>
-    <modules>
-        <module>tsfile</module>
-        <module>antlr</module>
-        <module>thrift</module>
-        <module>thrift-cluster</module>
-        <module>thrift-sync</module>
-        <module>thrift-influxdb</module>
-        <module>service-rpc</module>
-        <module>jdbc</module>
-        <module>session</module>
-        <module>cli</module>
-        <module>openapi</module>
-        <module>server</module>
-        <module>example</module>
-        <module>grafana-plugin</module>
-        <module>grafana-connector</module>
-        <module>spark-tsfile</module>
-        <module>hadoop</module>
-        <module>spark-iotdb-connector</module>
-        <module>flink-tsfile-connector</module>
-        <module>flink-iotdb-connector</module>
-        <module>distribution</module>
-        <module>hive-connector</module>
-        <module>cluster</module>
-        <module>cross-tests</module>
-        <module>zeppelin-interpreter</module>
-        <module>client-py</module>
-        <module>compile-tools</module>
-        <module>client-cpp</module>
-        <module>metrics</module>
-        <module>integration</module>
-    </modules>
-    <!-- Properties Management -->
-    <properties>
-        <maven.compiler.source>1.8</maven.compiler.source>
-        <maven.compiler.target>1.8</maven.compiler.target>
-        <maven.assembly.version>3.1.0</maven.assembly.version>
-        <scala.library.version>2.11</scala.library.version>
-        <scala.version>2.11.12</scala.version>
-        <hadoop2.version>2.10.0</hadoop2.version>
-        <hive2.version>2.3.6</hive2.version>
-        <junit.version>4.13.2</junit.version>
-        <slf4j.version>1.7.12</slf4j.version>
-        <logback.version>1.2.10</logback.version>
-        <joda.version>2.9.9</joda.version>
-        <spark.version>2.4.3</spark.version>
-        <flink.version>1.14.0</flink.version>
-        <common.io.version>2.11.0</common.io.version>
-        <commons.collections4>4.4</commons.collections4>
-        <!-- keep consistent with client-cpp/tools/thrift/pom.xml-->
-        <thrift.version>0.14.1</thrift.version>
-        <airline.version>0.8</airline.version>
-        <jackson.version>2.10.5</jackson.version>
-        <antlr4.version>4.8-1</antlr4.version>
-        <common.cli.version>1.3.1</common.cli.version>
-        <common.codec.version>1.13</common.codec.version>
-        <common.collections.version>3.2.2</common.collections.version>
-        <common.lang3.version>3.8.1</common.lang3.version>
-        <common.logging.version>1.1.3</common.logging.version>
-        <common.pool2.version>2.11.1</common.pool2.version>
-        <org.slf4j.version>1.7.32</org.slf4j.version>
-        <guava.version>24.1.1</guava.version>
-        <jline.version>3.21.0</jline.version>
-        <jetty.version>9.4.35.v20201120</jetty.version>
-        <metrics.version>4.2.4</metrics.version>
-        <javax.xml.bind.version>2.4.0-b180830.0359</javax.xml.bind.version>
-        <felix.version>5.1.1</felix.version>
-        <snappy.version>1.1.8.4</snappy.version>
-        <netty.version>4.1.53.Final</netty.version>
-        <!-- URL of the ASF SonarQube server -->
-        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
-        <sonar.organization>apache</sonar.organization>
-        <!-- Exclude all generated code -->
-        <sonar.exclusions>**/generated-sources</sonar.exclusions>
-        <sonar.java.checkstyle.reportPaths>target/checkstyle-report.xml</sonar.java.checkstyle.reportPaths>
-        <sonar.coverage.jacoco.xmlReportPaths>target/jacoco-merged-reports/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
-        <sonar.junit.reportPaths>target/surefire-reports,target/failsafe-reports</sonar.junit.reportPaths>
-        <!-- By default, the argLine is empty-->
-        <gson.version>2.8.8</gson.version>
-        <argLine/>
-        <!-- whether enable compiling the cpp client-->
-        <client-cpp>false</client-cpp>
-        <!-- disable enforcer by default-->
-        <enforcer.skip>true</enforcer.skip>
-        <spotless.version>2.4.2</spotless.version>
-        <httpclient.version>4.5.13</httpclient.version>
-        <httpcore.version>4.4.13</httpcore.version>
-        <!-- for REST service -->
-        <swagger.core.version>1.5.18</swagger.core.version>
-        <servlet.api.version>2.5</servlet.api.version>
-        <openapi.generator.version>5.0.0</openapi.generator.version>
-    </properties>
-    <!--
+--><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</groupId>
+            
+    <artifactId>apache</artifactId>
+            
+    <version>23</version>
+        
+  </parent>
+      
+  <groupId>org.apache.iotdb</groupId>
+      
+  <artifactId>iotdb-parent</artifactId>
+      
+  <version>0.13.0-SNAPSHOT</version>
+      
+  <packaging>pom</packaging>
+      
+  <name>Apache IoTDB Project Parent POM</name>
+      
+  <description>This is the top level project that builds, packages the tsfile, iotdb engine, jdbc, and integration libs.</description>
+      
+  <licenses>
+            
+    <license>
+                  
+      <name>The Apache License, Version 2.0</name>
+                  
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+              
+    </license>
+        
+  </licenses>
+      
+  <scm>
+            
+    <connection>scm:git:ssh://git@github.com/apache/iotdb.git</connection>
+            
+    <developerConnection>scm:git:ssh://git@github.com/apache/iotdb.git</developerConnection>
+            
+    <url>ssh://git@github.com:apache/iotdb.git</url>
+            
+    <tag>rel/0.10</tag>
+        
+  </scm>
+      
+  <!-- Only configure the site distribution as the rest is handled by the apache parent -->
+      
+  <distributionManagement>
+            
+    <site>
+                  
+      <id>apache.website</id>
+                  
+      <url>scm:git:https://gitbox.apache.org/repos/asf/iotdb-website.git</url>
+              
+    </site>
+        
+  </distributionManagement>
+      
+  <issueManagement>
+            
+    <system>Jira</system>
+            
+    <url>https://issues.apache.org/jira/browse/iotdb</url>
+        
+  </issueManagement>
+      
+  <mailingLists>
+            
+    <mailingList>
+                  
+      <name>Apache IoTDB Developer List</name>
+                  
+      <subscribe>mailto:dev-subscribe@iotdb.apache.org</subscribe>
+                  
+      <unsubscribe>mailto:dev-unsubscribe@iotdb.apache.org</unsubscribe>
+                  
+      <post>mailto:dev@iotdb.apache.org</post>
+                  
+      <archive>http://mail-archives.apache.org/mod_mbox/iotdb-dev/</archive>
+              
+    </mailingList>
+            
+    <mailingList>
+                  
+      <name>IoTDB Commits List</name>
+                  
+      <subscribe>mailto:commit-subscribe@iotdb.apache.org</subscribe>
+                  
+      <unsubscribe>mailto:commits-unsubscribe@iotdb.apache.org</unsubscribe>
+                  
+      <post>mailto:commits@iotdb.apache.org</post>
+                  
+      <archive>http://mail-archives.apache.org/mod_mbox/iotdb-commits/</archive>
+              
+    </mailingList>
+            
+    <mailingList>
+                  
+      <name>IoTDB Jira Notifications List</name>
+                  
+      <subscribe>mailto:notifications-subscribe@iotdb.apache.org</subscribe>
+                  
+      <unsubscribe>mailto:notifications-unsubscribe@iotdb.apache.org</unsubscribe>
+                  
+      <post>mailto:notifications@iotdb.apache.org</post>
+                  
+      <archive>http://mail-archives.apache.org/mod_mbox/iotdb-notifications/</archive>
+              
+    </mailingList>
+        
+  </mailingLists>
+      
+  <modules>
+            
+    <module>tsfile</module>
+            
+    <module>antlr</module>
+            
+    <module>thrift</module>
+            
+    <module>thrift-cluster</module>
+            
+    <module>thrift-sync</module>
+            
+    <module>thrift-influxdb</module>
+            
+    <module>service-rpc</module>
+            
+    <module>jdbc</module>
+            
+    <module>session</module>
+            
+    <module>cli</module>
+            
+    <module>openapi</module>
+            
+    <module>server</module>
+            
+    <module>example</module>
+            
+    <module>grafana-plugin</module>
+            
+    <module>grafana-connector</module>
+            
+    <module>spark-tsfile</module>
+            
+    <module>hadoop</module>
+            
+    <module>spark-iotdb-connector</module>
+            
+    <module>flink-tsfile-connector</module>
+            
+    <module>flink-iotdb-connector</module>
+            
+    <module>distribution</module>
+            
+    <module>hive-connector</module>
+            
+    <module>cluster</module>
+            
+    <module>cross-tests</module>
+            
+    <module>zeppelin-interpreter</module>
+            
+    <module>client-py</module>
+            
+    <module>compile-tools</module>
+            
+    <module>client-cpp</module>
+            
+    <module>metrics</module>
+            
+    <module>integration</module>
+          
+    <module>asdf</module>
+      
+  </modules>
+      
+  <!-- Properties Management -->
+      
+  <properties>
+            
+    <maven.compiler.source>1.8</maven.compiler.source>
+            
+    <maven.compiler.target>1.8</maven.compiler.target>
+            
+    <maven.assembly.version>3.1.0</maven.assembly.version>
+            
+    <scala.library.version>2.11</scala.library.version>
+            
+    <scala.version>2.11.12</scala.version>
+            
+    <hadoop2.version>2.10.0</hadoop2.version>
+            
+    <hive2.version>2.3.6</hive2.version>
+            
+    <junit.version>4.13.2</junit.version>
+            
+    <slf4j.version>1.7.12</slf4j.version>
+            
+    <logback.version>1.2.10</logback.version>
+            
+    <joda.version>2.9.9</joda.version>
+            
+    <spark.version>2.4.3</spark.version>
+            
+    <flink.version>1.14.0</flink.version>
+            
+    <common.io.version>2.11.0</common.io.version>
+            
+    <commons.collections4>4.4</commons.collections4>
+            
+    <!-- keep consistent with client-cpp/tools/thrift/pom.xml-->
+            
+    <thrift.version>0.14.1</thrift.version>
+            
+    <airline.version>0.8</airline.version>
+            
+    <jackson.version>2.10.5</jackson.version>
+            
+    <antlr4.version>4.8-1</antlr4.version>
+            
+    <common.cli.version>1.3.1</common.cli.version>
+            
+    <common.codec.version>1.13</common.codec.version>
+            
+    <common.collections.version>3.2.2</common.collections.version>
+            
+    <common.lang3.version>3.8.1</common.lang3.version>
+            
+    <common.logging.version>1.1.3</common.logging.version>
+            
+    <common.pool2.version>2.11.1</common.pool2.version>
+            
+    <org.slf4j.version>1.7.32</org.slf4j.version>
+            
+    <guava.version>24.1.1</guava.version>
+            
+    <jline.version>3.21.0</jline.version>
+            
+    <jetty.version>9.4.35.v20201120</jetty.version>
+            
+    <metrics.version>4.2.4</metrics.version>
+            
+    <javax.xml.bind.version>2.4.0-b180830.0359</javax.xml.bind.version>
+            
+    <felix.version>5.1.1</felix.version>
+            
+    <snappy.version>1.1.8.4</snappy.version>
+            
+    <netty.version>4.1.53.Final</netty.version>
+            
+    <!-- URL of the ASF SonarQube server -->
+            
+    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
+            
+    <sonar.organization>apache</sonar.organization>
+            
+    <!-- Exclude all generated code -->
+            
+    <sonar.exclusions>**/generated-sources</sonar.exclusions>
+            
+    <sonar.java.checkstyle.reportPaths>target/checkstyle-report.xml</sonar.java.checkstyle.reportPaths>
+            
+    <sonar.coverage.jacoco.xmlReportPaths>target/jacoco-merged-reports/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
+            
+    <sonar.junit.reportPaths>target/surefire-reports,target/failsafe-reports</sonar.junit.reportPaths>
+            
+    <!-- By default, the argLine is empty-->
+            
+    <gson.version>2.8.8</gson.version>
+            
+    <argLine/>
+            
+    <!-- whether enable compiling the cpp client-->
+            
+    <client-cpp>false</client-cpp>
+            
+    <!-- disable enforcer by default-->
+            
+    <enforcer.skip>true</enforcer.skip>
+            
+    <spotless.version>2.4.2</spotless.version>
+            
+    <httpclient.version>4.5.13</httpclient.version>
+            
+    <httpcore.version>4.4.13</httpcore.version>
+            
+    <!-- for REST service -->
+            
+    <swagger.core.version>1.5.18</swagger.core.version>
+            
+    <servlet.api.version>2.5</servlet.api.version>
+            
+    <openapi.generator.version>5.0.0</openapi.generator.version>
+        
+  </properties>
+      
+  <!--
         if we claim dependencies in dependencyManagement, then we do not claim
         their version in sub-project's pom, but we have to claim themselves again
         in sub-projects
     -->
-    <dependencyManagement>
-        <dependencies>
-            <!--
+      
+  <dependencyManagement>
+            
+    <dependencies>
+                  
+      <!--
                 in the subprojects, you have to claim logback again, because maybe
                 someone in your dependences uses log4j lib.
             -->
-            <dependency>
-                <groupId>ch.qos.logback</groupId>
-                <artifactId>logback-classic</artifactId>
-                <version>${logback.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.fasterxml.jackson.core</groupId>
-                <artifactId>jackson-annotations</artifactId>
-                <version>${jackson.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.fasterxml.jackson.core</groupId>
-                <artifactId>jackson-core</artifactId>
-                <version>${jackson.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.fasterxml.jackson.core</groupId>
-                <artifactId>jackson-databind</artifactId>
-                <version>${jackson.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.fasterxml.jackson.module</groupId>
-                <artifactId>jackson-module-paranamer</artifactId>
-                <version>${jackson.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.fasterxml.jackson.module</groupId>
-                <artifactId>jackson-module-scala_2.11</artifactId>
-                <version>${jackson.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.google.guava</groupId>
-                <artifactId>guava</artifactId>
-                <version>[${guava.version},)</version>
-            </dependency>
-            <dependency>
-                <groupId>commons-cli</groupId>
-                <artifactId>commons-cli</artifactId>
-                <version>${common.cli.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>commons-codec</groupId>
-                <artifactId>commons-codec</artifactId>
-                <version>${common.codec.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>commons-collections</groupId>
-                <artifactId>commons-collections</artifactId>
-                <version>${common.collections.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>commons-io</groupId>
-                <artifactId>commons-io</artifactId>
-                <version>${common.io.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>commons-logging</groupId>
-                <artifactId>commons-logging</artifactId>
-                <version>${common.logging.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>io.netty</groupId>
-                <artifactId>netty</artifactId>
-                <version>3.9.9.Final</version>
-            </dependency>
-            <dependency>
-                <groupId>io.netty</groupId>
-                <artifactId>netty-all</artifactId>
-                <version>${netty.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>io.netty</groupId>
-                <artifactId>netty-buffer</artifactId>
-                <version>${netty.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>io.netty</groupId>
-                <artifactId>netty-common</artifactId>
-                <version>${netty.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>javax.annotation</groupId>
-                <artifactId>javax.annotation-api</artifactId>
-                <version>1.3.2</version>
-            </dependency>
-            <dependency>
-                <groupId>javax.xml.bind</groupId>
-                <artifactId>jaxb-api</artifactId>
-                <version>${javax.xml.bind.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.jline</groupId>
-                <artifactId>jline</artifactId>
-                <version>${jline.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>junit</groupId>
-                <artifactId>junit</artifactId>
-                <version>${junit.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>log4j</groupId>
-                <artifactId>log4j</artifactId>
-                <version>1.2.17</version>
-            </dependency>
-            <dependency>
-                <groupId>org.lz4</groupId>
-                <artifactId>lz4-java</artifactId>
-                <version>1.8.0</version>
-            </dependency>
-            <dependency>
-                <groupId>org.eclipse.jetty</groupId>
-                <artifactId>jetty-server</artifactId>
-                <version>${jetty.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.eclipse.jetty</groupId>
-                <artifactId>jetty-webapp</artifactId>
-                <version>${jetty.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>io.dropwizard.metrics</groupId>
-                <artifactId>metrics-core</artifactId>
-                <version>${metrics.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>io.dropwizard.metrics</groupId>
-                <artifactId>metrics-jvm</artifactId>
-                <version>${metrics.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>io.dropwizard.metrics</groupId>
-                <artifactId>metrics-json</artifactId>
-                <version>${metrics.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>me.tongfei</groupId>
-                <artifactId>progressbar</artifactId>
-                <version>0.9.2</version>
-                <exclusions>
-                    <!-- This transitive dependency duplicates classes from jline:jline:jar:2.14.5:compile -->
-                    <exclusion>
-                        <groupId>org.fusesource.jansi</groupId>
-                        <artifactId>jansi</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-            <dependency>
-                <groupId>org.antlr</groupId>
-                <artifactId>antlr4-runtime</artifactId>
-                <version>${antlr4.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.commons</groupId>
-                <artifactId>commons-collections4</artifactId>
-                <version>${commons.collections4}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.commons</groupId>
-                <artifactId>commons-lang3</artifactId>
-                <version>${common.lang3.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.commons</groupId>
-                <artifactId>commons-pool2</artifactId>
-                <version>${common.pool2.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.hadoop</groupId>
-                <artifactId>hadoop-client</artifactId>
-                <version>${hadoop2.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.hive</groupId>
-                <artifactId>hive-serde</artifactId>
-                <version>${hive2.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.hive</groupId>
-                <artifactId>hive-exec</artifactId>
-                <version>${hive2.version}</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>org.pentaho</groupId>
-                        <artifactId>pentaho-aggdesigner-algorithm</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.spark</groupId>
-                <artifactId>spark-core_2.11</artifactId>
-                <version>${spark.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.spark</groupId>
-                <artifactId>spark-sql_2.11</artifactId>
-                <version>${spark.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.codehaus.jackson</groupId>
-                <artifactId>jackson-core-asl</artifactId>
-                <version>1.9.13</version>
-            </dependency>
-            <dependency>
-                <groupId>org.codehaus.jackson</groupId>
-                <artifactId>jackson-mapper-asl</artifactId>
-                <version>1.9.13</version>
-            </dependency>
-            <dependency>
-                <groupId>org.glassfish.jaxb</groupId>
-                <artifactId>jaxb-runtime</artifactId>
-                <version>3.0.0</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>jakarta.activation</groupId>
-                        <artifactId>jakarta.activation-api</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-            <dependency>
-                <groupId>org.javassist</groupId>
-                <artifactId>javassist</artifactId>
-                <version>3.24.1-GA</version>
-            </dependency>
-            <dependency>
-                <groupId>org.mockito</groupId>
-                <artifactId>mockito-core</artifactId>
-                <version>2.23.0</version>
-            </dependency>
-            <dependency>
-                <groupId>org.objenesis</groupId>
-                <artifactId>objenesis</artifactId>
-                <version>3.0.1</version>
-            </dependency>
-            <dependency>
-                <groupId>org.powermock</groupId>
-                <artifactId>powermock-core</artifactId>
-                <version>2.0.2</version>
-            </dependency>
-            <dependency>
-                <groupId>org.powermock</groupId>
-                <artifactId>powermock-api-mockito2</artifactId>
-                <version>2.0.9</version>
-            </dependency>
-            <dependency>
-                <groupId>org.powermock</groupId>
-                <artifactId>powermock-module-junit4</artifactId>
-                <version>2.0.2</version>
-            </dependency>
-            <dependency>
-                <groupId>org.scala-lang</groupId>
-                <artifactId>scala-library</artifactId>
-                <version>${scala.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.scala-lang</groupId>
-                <artifactId>scala-reflect</artifactId>
-                <version>${scala.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.scalatest</groupId>
-                <artifactId>scalatest_2.11</artifactId>
-                <version>3.0.5</version>
-            </dependency>
-            <dependency>
-                <groupId>org.slf4j</groupId>
-                <artifactId>jcl-over-slf4j</artifactId>
-                <version>${org.slf4j.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.slf4j</groupId>
-                <artifactId>jul-to-slf4j</artifactId>
-                <version>${org.slf4j.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.slf4j</groupId>
-                <artifactId>slf4j-api</artifactId>
-                <version>${org.slf4j.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.slf4j</groupId>
-                <artifactId>slf4j-log4j12</artifactId>
-                <version>${org.slf4j.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.xerial.snappy</groupId>
-                <artifactId>snappy-java</artifactId>
-                <version>${snappy.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.thrift</groupId>
-                <artifactId>libthrift</artifactId>
-                <version>${thrift.version}</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>org.apache.httpcomponents</groupId>
-                        <artifactId>httpclient</artifactId>
-                    </exclusion>
-                    <exclusion>
-                        <groupId>org.apache.httpcomponents</groupId>
-                        <artifactId>httpcore</artifactId>
-                    </exclusion>
-                    <exclusion>
-                        <groupId>org.apache.tomcat.embed</groupId>
-                        <artifactId>tomcat-embed-core</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-            <dependency>
-                <groupId>io.airlift</groupId>
-                <artifactId>airline</artifactId>
-                <version>${airline.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.fusesource.mqtt-client</groupId>
-                <artifactId>mqtt-client</artifactId>
-                <version>1.12</version>
-            </dependency>
-            <!-- many dependencies (hadoop, spark, hive, flink) use findbugs but with different version...-->
-            <dependency>
-                <groupId>com.google.code.findbugs</groupId>
-                <artifactId>jsr305</artifactId>
-                <!-- spark uses the lastest version than hive, flink and hadoop-->
-                <version>3.0.2</version>
-            </dependency>
-            <dependency>
-                <groupId>com.google.code.gson</groupId>
-                <artifactId>gson</artifactId>
-                <version>${gson.version}</version>
-            </dependency>
-            <!-- for cli and test container -->
-            <dependency>
-                <groupId>net.java.dev.jna</groupId>
-                <artifactId>jna</artifactId>
-                <version>5.5.0</version>
-            </dependency>
-            <!-- for hadoop connector -->
-            <dependency>
-                <groupId>org.apache.zookeeper</groupId>
-                <artifactId>zookeeper</artifactId>
-                <version>3.4.9</version>
-            </dependency>
-            <dependency>
-                <groupId>commons-beanutils</groupId>
-                <artifactId>commons-beanutils</artifactId>
-                <version>1.9.4</version>
-            </dependency>
-            <!-- for test-container and hadoop conflict-->
-            <dependency>
-                <groupId>org.apache.commons</groupId>
-                <artifactId>commons-compress</artifactId>
-                <version>1.21</version>
-            </dependency>
-            <!-- for spark-iotdb-connector and hadoop connector conflict -->
-            <dependency>
-                <groupId>org.apache.httpcomponents</groupId>
-                <artifactId>httpclient</artifactId>
-                <version>${httpclient.version}</version>
-            </dependency>
-            <!-- for spark-iotdb conflict -->
-            <dependency>
-                <groupId>com.google.errorprone</groupId>
-                <artifactId>error_prone_annotations</artifactId>
-                <version>2.7.1</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.httpcomponents</groupId>
-                <artifactId>httpcore</artifactId>
-                <version>${httpcore.version}</version>
-            </dependency>
-            <!-- for hive connector-->
-            <dependency>
-                <groupId>org.eclipse.jetty</groupId>
-                <artifactId>jetty-server</artifactId>
-                <version>11.0.6</version>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-    <dependencies>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.testcontainers</groupId>
-            <artifactId>testcontainers</artifactId>
-            <version>1.15.2</version>
-            <scope>test</scope>
-        </dependency>
+                  
+      <dependency>
+                        
+        <groupId>ch.qos.logback</groupId>
+                        
+        <artifactId>logback-classic</artifactId>
+                        
+        <version>${logback.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>com.fasterxml.jackson.core</groupId>
+                        
+        <artifactId>jackson-annotations</artifactId>
+                        
+        <version>${jackson.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>com.fasterxml.jackson.core</groupId>
+                        
+        <artifactId>jackson-core</artifactId>
+                        
+        <version>${jackson.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>com.fasterxml.jackson.core</groupId>
+                        
+        <artifactId>jackson-databind</artifactId>
+                        
+        <version>${jackson.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>com.fasterxml.jackson.module</groupId>
+                        
+        <artifactId>jackson-module-paranamer</artifactId>
+                        
+        <version>${jackson.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>com.fasterxml.jackson.module</groupId>
+                        
+        <artifactId>jackson-module-scala_2.11</artifactId>
+                        
+        <version>${jackson.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>com.google.guava</groupId>
+                        
+        <artifactId>guava</artifactId>
+                        
+        <version>[${guava.version},)</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>commons-cli</groupId>
+                        
+        <artifactId>commons-cli</artifactId>
+                        
+        <version>${common.cli.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>commons-codec</groupId>
+                        
+        <artifactId>commons-codec</artifactId>
+                        
+        <version>${common.codec.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>commons-collections</groupId>
+                        
+        <artifactId>commons-collections</artifactId>
+                        
+        <version>${common.collections.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>commons-io</groupId>
+                        
+        <artifactId>commons-io</artifactId>
+                        
+        <version>${common.io.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>commons-logging</groupId>
+                        
+        <artifactId>commons-logging</artifactId>
+                        
+        <version>${common.logging.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>io.netty</groupId>
+                        
+        <artifactId>netty</artifactId>
+                        
+        <version>3.9.9.Final</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>io.netty</groupId>
+                        
+        <artifactId>netty-all</artifactId>
+                        
+        <version>${netty.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>io.netty</groupId>
+                        
+        <artifactId>netty-buffer</artifactId>
+                        
+        <version>${netty.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>io.netty</groupId>
+                        
+        <artifactId>netty-common</artifactId>
+                        
+        <version>${netty.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>javax.annotation</groupId>
+                        
+        <artifactId>javax.annotation-api</artifactId>
+                        
+        <version>1.3.2</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>javax.xml.bind</groupId>
+                        
+        <artifactId>jaxb-api</artifactId>
+                        
+        <version>${javax.xml.bind.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.jline</groupId>
+                        
+        <artifactId>jline</artifactId>
+                        
+        <version>${jline.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>junit</groupId>
+                        
+        <artifactId>junit</artifactId>
+                        
+        <version>${junit.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>log4j</groupId>
+                        
+        <artifactId>log4j</artifactId>
+                        
+        <version>1.2.17</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.lz4</groupId>
+                        
+        <artifactId>lz4-java</artifactId>
+                        
+        <version>1.8.0</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.eclipse.jetty</groupId>
+                        
+        <artifactId>jetty-server</artifactId>
+                        
+        <version>${jetty.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.eclipse.jetty</groupId>
+                        
+        <artifactId>jetty-webapp</artifactId>
+                        
+        <version>${jetty.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>io.dropwizard.metrics</groupId>
+                        
+        <artifactId>metrics-core</artifactId>
+                        
+        <version>${metrics.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>io.dropwizard.metrics</groupId>
+                        
+        <artifactId>metrics-jvm</artifactId>
+                        
+        <version>${metrics.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>io.dropwizard.metrics</groupId>
+                        
+        <artifactId>metrics-json</artifactId>
+                        
+        <version>${metrics.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>me.tongfei</groupId>
+                        
+        <artifactId>progressbar</artifactId>
+                        
+        <version>0.9.2</version>
+                        
+        <exclusions>
+                              
+          <!-- This transitive dependency duplicates classes from jline:jline:jar:2.14.5:compile -->
+                              
+          <exclusion>
+                                    
+            <groupId>org.fusesource.jansi</groupId>
+                                    
+            <artifactId>jansi</artifactId>
+                                
+          </exclusion>
+                          
+        </exclusions>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.antlr</groupId>
+                        
+        <artifactId>antlr4-runtime</artifactId>
+                        
+        <version>${antlr4.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.apache.commons</groupId>
+                        
+        <artifactId>commons-collections4</artifactId>
+                        
+        <version>${commons.collections4}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.apache.commons</groupId>
+                        
+        <artifactId>commons-lang3</artifactId>
+                        
+        <version>${common.lang3.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.apache.commons</groupId>
+                        
+        <artifactId>commons-pool2</artifactId>
+                        
+        <version>${common.pool2.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.apache.hadoop</groupId>
+                        
+        <artifactId>hadoop-client</artifactId>
+                        
+        <version>${hadoop2.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.apache.hive</groupId>
+                        
+        <artifactId>hive-serde</artifactId>
+                        
+        <version>${hive2.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.apache.hive</groupId>
+                        
+        <artifactId>hive-exec</artifactId>
+                        
+        <version>${hive2.version}</version>
+                        
+        <exclusions>
+                              
+          <exclusion>
+                                    
+            <groupId>org.pentaho</groupId>
+                                    
+            <artifactId>pentaho-aggdesigner-algorithm</artifactId>
+                                
+          </exclusion>
+                          
+        </exclusions>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.apache.spark</groupId>
+                        
+        <artifactId>spark-core_2.11</artifactId>
+                        
+        <version>${spark.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.apache.spark</groupId>
+                        
+        <artifactId>spark-sql_2.11</artifactId>
+                        
+        <version>${spark.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.codehaus.jackson</groupId>
+                        
+        <artifactId>jackson-core-asl</artifactId>
+                        
+        <version>1.9.13</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.codehaus.jackson</groupId>
+                        
+        <artifactId>jackson-mapper-asl</artifactId>
+                        
+        <version>1.9.13</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.glassfish.jaxb</groupId>
+                        
+        <artifactId>jaxb-runtime</artifactId>
+                        
+        <version>3.0.0</version>
+                        
+        <exclusions>
+                              
+          <exclusion>
+                                    
+            <groupId>jakarta.activation</groupId>
+                                    
+            <artifactId>jakarta.activation-api</artifactId>
+                                
+          </exclusion>
+                          
+        </exclusions>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.javassist</groupId>
+                        
+        <artifactId>javassist</artifactId>
+                        
+        <version>3.24.1-GA</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.mockito</groupId>
+                        
+        <artifactId>mockito-core</artifactId>
+                        
+        <version>2.23.0</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.objenesis</groupId>
+                        
+        <artifactId>objenesis</artifactId>
+                        
+        <version>3.0.1</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.powermock</groupId>
+                        
+        <artifactId>powermock-core</artifactId>
+                        
+        <version>2.0.2</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.powermock</groupId>
+                        
+        <artifactId>powermock-api-mockito2</artifactId>
+                        
+        <version>2.0.9</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.powermock</groupId>
+                        
+        <artifactId>powermock-module-junit4</artifactId>
+                        
+        <version>2.0.2</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.scala-lang</groupId>
+                        
+        <artifactId>scala-library</artifactId>
+                        
+        <version>${scala.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.scala-lang</groupId>
+                        
+        <artifactId>scala-reflect</artifactId>
+                        
+        <version>${scala.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.scalatest</groupId>
+                        
+        <artifactId>scalatest_2.11</artifactId>
+                        
+        <version>3.0.5</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.slf4j</groupId>
+                        
+        <artifactId>jcl-over-slf4j</artifactId>
+                        
+        <version>${org.slf4j.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.slf4j</groupId>
+                        
+        <artifactId>jul-to-slf4j</artifactId>
+                        
+        <version>${org.slf4j.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.slf4j</groupId>
+                        
+        <artifactId>slf4j-api</artifactId>
+                        
+        <version>${org.slf4j.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.slf4j</groupId>
+                        
+        <artifactId>slf4j-log4j12</artifactId>
+                        
+        <version>${org.slf4j.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.xerial.snappy</groupId>
+                        
+        <artifactId>snappy-java</artifactId>
+                        
+        <version>${snappy.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.apache.thrift</groupId>
+                        
+        <artifactId>libthrift</artifactId>
+                        
+        <version>${thrift.version}</version>
+                        
+        <exclusions>
+                              
+          <exclusion>
+                                    
+            <groupId>org.apache.httpcomponents</groupId>
+                                    
+            <artifactId>httpclient</artifactId>
+                                
+          </exclusion>
+                              
+          <exclusion>
+                                    
+            <groupId>org.apache.httpcomponents</groupId>
+                                    
+            <artifactId>httpcore</artifactId>
+                                
+          </exclusion>
+                              
+          <exclusion>
+                                    
+            <groupId>org.apache.tomcat.embed</groupId>
+                                    
+            <artifactId>tomcat-embed-core</artifactId>
+                                
+          </exclusion>
+                          
+        </exclusions>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>io.airlift</groupId>
+                        
+        <artifactId>airline</artifactId>
+                        
+        <version>${airline.version}</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.fusesource.mqtt-client</groupId>
+                        
+        <artifactId>mqtt-client</artifactId>
+                        
+        <version>1.12</version>
+                    
+      </dependency>
+                  
+      <!-- many dependencies (hadoop, spark, hive, flink) use findbugs but with different version...-->
+                  
+      <dependency>
+                        
+        <groupId>com.google.code.findbugs</groupId>
+                        
+        <artifactId>jsr305</artifactId>
+                        
+        <!-- spark uses the lastest version than hive, flink and hadoop-->
+                        
+        <version>3.0.2</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>com.google.code.gson</groupId>
+                        
+        <artifactId>gson</artifactId>
+                        
+        <version>${gson.version}</version>
+                    
+      </dependency>
+                  
+      <!-- for cli and test container -->
+                  
+      <dependency>
+                        
+        <groupId>net.java.dev.jna</groupId>
+                        
+        <artifactId>jna</artifactId>
+                        
+        <version>5.5.0</version>
+                    
+      </dependency>
+                  
+      <!-- for hadoop connector -->
+                  
+      <dependency>
+                        
+        <groupId>org.apache.zookeeper</groupId>
+                        
+        <artifactId>zookeeper</artifactId>
+                        
+        <version>3.4.9</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>commons-beanutils</groupId>
+                        
+        <artifactId>commons-beanutils</artifactId>
+                        
+        <version>1.9.4</version>
+                    
+      </dependency>
+                  
+      <!-- for test-container and hadoop conflict-->
+                  
+      <dependency>
+                        
+        <groupId>org.apache.commons</groupId>
+                        
+        <artifactId>commons-compress</artifactId>
+                        
+        <version>1.21</version>
+                    
+      </dependency>
+                  
+      <!-- for spark-iotdb-connector and hadoop connector conflict -->
+                  
+      <dependency>
+                        
+        <groupId>org.apache.httpcomponents</groupId>
+                        
+        <artifactId>httpclient</artifactId>
+                        
+        <version>${httpclient.version}</version>
+                    
+      </dependency>
+                  
+      <!-- for spark-iotdb conflict -->
+                  
+      <dependency>
+                        
+        <groupId>com.google.errorprone</groupId>
+                        
+        <artifactId>error_prone_annotations</artifactId>
+                        
+        <version>2.7.1</version>
+                    
+      </dependency>
+                  
+      <dependency>
+                        
+        <groupId>org.apache.httpcomponents</groupId>
+                        
+        <artifactId>httpcore</artifactId>
+                        
+        <version>${httpcore.version}</version>
+                    
+      </dependency>
+                  
+      <!-- for hive connector-->
+                  
+      <dependency>
+                        
+        <groupId>org.eclipse.jetty</groupId>
+                        
+        <artifactId>jetty-server</artifactId>
+                        
+        <version>11.0.6</version>
+                    
+      </dependency>
+              
     </dependencies>
-    <build>
-        <pluginManagement>
-            <plugins>
-                <!-- using `mvn -N versions:update-child-modules` can update the version
+        
+  </dependencyManagement>
+      
+  <dependencies>
+            
+    <dependency>
+                  
+      <groupId>ch.qos.logback</groupId>
+                  
+      <artifactId>logback-classic</artifactId>
+              
+    </dependency>
+            
+    <dependency>
+                  
+      <groupId>org.slf4j</groupId>
+                  
+      <artifactId>slf4j-api</artifactId>
+              
+    </dependency>
+            
+    <dependency>
+                  
+      <groupId>junit</groupId>
+                  
+      <artifactId>junit</artifactId>
+                  
+      <scope>test</scope>
+              
+    </dependency>
+            
+    <dependency>
+                  
+      <groupId>org.testcontainers</groupId>
+                  
+      <artifactId>testcontainers</artifactId>
+                  
+      <version>1.15.2</version>
+                  
+      <scope>test</scope>
+              
+    </dependency>
+        
+  </dependencies>
+      
+  <build>
+            
+    <pluginManagement>
+                  
+      <plugins>
+                        
+        <!-- using `mvn -N versions:update-child-modules` can update the version
                 of child modules to what their parent claims -->
-                <plugin>
-                    <groupId>org.codehaus.mojo</groupId>
-                    <artifactId>versions-maven-plugin</artifactId>
-                    <version>2.3</version>
-                    <configuration>
-                        <generateBackupPoms>false</generateBackupPoms>
-                    </configuration>
-                </plugin>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-javadoc-plugin</artifactId>
-                    <configuration>
-                        <excludePackageNames>*thrift*</excludePackageNames>
-                        <!--
+                        
+        <plugin>
+                              
+          <groupId>org.codehaus.mojo</groupId>
+                              
+          <artifactId>versions-maven-plugin</artifactId>
+                              
+          <version>2.3</version>
+                              
+          <configuration>
+                                    
+            <generateBackupPoms>false</generateBackupPoms>
+                                
+          </configuration>
+                          
+        </plugin>
+                        
+        <plugin>
+                              
+          <groupId>org.apache.maven.plugins</groupId>
+                              
+          <artifactId>maven-javadoc-plugin</artifactId>
+                              
+          <configuration>
+                                    
+            <excludePackageNames>*thrift*</excludePackageNames>
+                                    
+            <!--
                           This will suppress the generation of a hidden timestamp at the top of each generated html page
                           and hopefully let the site generation nod to too big updates every time.
                         -->
-                        <notimestamp>true</notimestamp>
-                        <!--Don't fail the build, just because there were issues in the JavaDoc generation.-->
-                        <failOnError>false</failOnError>
-                    </configuration>
-                </plugin>
-                <!--
+                                    
+            <notimestamp>true</notimestamp>
+                                    
+            <!--Don't fail the build, just because there were issues in the JavaDoc generation.-->
+                                    
+            <failOnError>false</failOnError>
+                                
+          </configuration>
+                          
+        </plugin>
+                        
+        <!--
                   We need to increase the memory available to tests as we were
                   getting out-of-memory errors when building on windows machines.
                 -->
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-surefire-plugin</artifactId>
-                    <configuration>
-                        <argLine>${argLine} -Xmx1024m</argLine>
-                    </configuration>
-                </plugin>
-                <!--
+                        
+        <plugin>
+                              
+          <groupId>org.apache.maven.plugins</groupId>
+                              
+          <artifactId>maven-surefire-plugin</artifactId>
+                              
+          <configuration>
+                                    
+            <argLine>${argLine} -Xmx1024m</argLine>
+                                
+          </configuration>
+                          
+        </plugin>
+                        
+        <!--
                     Plugin for doing the code analysis.
                 -->
-                <plugin>
-                    <groupId>org.sonarsource.scanner.maven</groupId>
-                    <artifactId>sonar-maven-plugin</artifactId>
-                    <version>3.6.1.1688</version>
-                </plugin>
-                <plugin>
-                    <groupId>org.apache.rat</groupId>
-                    <artifactId>apache-rat-plugin</artifactId>
-                    <configuration>
-                        <consoleOutput>true</consoleOutput>
-                        <excludes>
-                            <!-- Git related files -->
-                            <exclude>**/.git/**</exclude>
-                            <exclude>**/.mvn/**</exclude>
-                            <exclude>**/.gitignore</exclude>
-                            <exclude>**/.gitmodules</exclude>
-                            <exclude>**/.git-blame-ignore-revs</exclude>
-                            <!-- Maven related files -->
-                            <exclude>**/target/**</exclude>
-                            <!-- Eclipse related files -->
-                            <exclude>**/.project</exclude>
-                            <exclude>**/.settings/**</exclude>
-                            <exclude>**/.classpath</exclude>
-                            <!-- IntelliJ related files -->
-                            <exclude>**/.idea/**</exclude>
-                            <exclude>**/*.iml</exclude>
-                            <!-- Runtime log -->
-                            <exclude>**/*.log</exclude>
-                            <!-- Exclude CVS files -->
-                            <exclude>**/*.cvs</exclude>
-                            <!-- licenses -->
-                            <exclude>licenses/*</exclude>
-                            <!-- only for Travis CI with WinOS-->
-                            <exclude>hadoopbin</exclude>
-                            <exclude>windowssystem32</exclude>
-                            <!-- generated by Github -->
-                            <exclude>**/.github/**</exclude>
-                            <!-- figures -->
-                            <exclude>**/.eps</exclude>
-                            <exclude>**/.png</exclude>
-                            <exclude>**/.jpg</exclude>
-                            <exclude>**/.jpeg</exclude>
-                            <!--Generated by Apache Release -->
-                            <exclude>local-snapshots-dir/**</exclude>
-                            <!-- JSON can't contain comments and therefore no Apache header -->
-                            <exclude>*.json</exclude>
-                            <!-- visualization plans -->
-                            <exclude>**/*.plan</exclude>
-                            <exclude>**/NOTICE-binary</exclude>
-                            <exclude>**/LICENSE-binary</exclude>
-                            <!-- json does not support comments-->
-                            <exclude>**/*.json</exclude>
-                            <!-- the zeppelin export file format-->
-                            <exclude>**/*.zpln</exclude>
-                            <!-- exclude go.mod and go.sum in iotdb-client-go submodule-->
-                            <exclude>**/go.mod</exclude>
-                            <exclude>**/go.sum</exclude>
-                            <!-- python -->
-                            <exclude>.pytest_cache/**</exclude>
-                            <exclude>venv/**</exclude>
-                            <exclude>apache_iotdb.egg-info/**</exclude>
-                            <!-- Java SPI uses files in resources/META-INF/services-->
-                            <exclude>**/resources/META-INF/services/**</exclude>
-                        </excludes>
-                    </configuration>
-                </plugin>
-                <plugin>
-                    <groupId>com.diffplug.spotless</groupId>
-                    <artifactId>spotless-maven-plugin</artifactId>
-                    <version>${spotless.version}</version>
-                    <configuration>
-                        <java>
-                            <googleJavaFormat>
-                                <version>1.7</version>
-                                <style>GOOGLE</style>
-                            </googleJavaFormat>
-                            <importOrder>
-                                <order>org.apache.iotdb,,javax,java,\#</order>
-                            </importOrder>
-                            <removeUnusedImports/>
-                        </java>
-                        <lineEndings>UNIX</lineEndings>
-                    </configuration>
-                    <executions>
-                        <execution>
-                            <id>spotless-check</id>
-                            <phase>validate</phase>
-                            <goals>
-                                <goal>check</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                </plugin>
-            </plugins>
-        </pluginManagement>
-        <plugins>
-            <plugin>
-                <groupId>org.eluder.coveralls</groupId>
-                <artifactId>coveralls-maven-plugin</artifactId>
-                <version>4.3.0</version>
-                <configuration>
-                    <jacocoReports>
-                        <jacocoReport>code-coverage/target/jacoco-merged-reports/jacoco.xml</jacocoReport>
-                    </jacocoReports>
-                    <sourceEncoding>UTF-8</sourceEncoding>
-                    <sourceDirectories>
-                        <!-- put all source folders not in src/main/java here-->
-                        <sourceDirectory>antlr/target/generated-sources/antlr4</sourceDirectory>
-                        <sourceDirectory>thrift/target/generated-sources/thrift</sourceDirectory>
-                        <sourceDirectory>thrift-sync/target/generated-sources/thrift</sourceDirectory>
-                        <sourceDirectory>thrift-cluster/target/generated-sources/thrift</sourceDirectory>
-                        <sourceDirectory>openapi/target/generated-sources/java/src/gen/java</sourceDirectory>
-                        <sourceDirectory>openapi/target/generated-sources/java/src/main/java</sourceDirectory>
-                        <sourceDirectory>spark-iotdb-connector/src/main/scala</sourceDirectory>
-                        <sourceDirectory>spark-tsfile/src/main/scala</sourceDirectory>
-                    </sourceDirectories>
-                </configuration>
-                <!-- JDK11 removes the following libs. We have to add them-->
-                <dependencies>
-                    <dependency>
-                        <groupId>javax.xml.bind</groupId>
-                        <artifactId>jaxb-api</artifactId>
-                        <version>2.4.0-b180830.0359</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>com.sun.xml.bind</groupId>
-                        <artifactId>jaxb-core</artifactId>
-                        <version>2.3.0</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>com.sun.xml.bind</groupId>
-                        <artifactId>jaxb-impl</artifactId>
-                        <version>2.3.0</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-            <!--
+                        
+        <plugin>
+                              
+          <groupId>org.sonarsource.scanner.maven</groupId>
+                              
+          <artifactId>sonar-maven-plugin</artifactId>
+                              
+          <version>3.6.1.1688</version>
+                          
+        </plugin>
+                        
+        <plugin>
+                              
+          <groupId>org.apache.rat</groupId>
+                              
+          <artifactId>apache-rat-plugin</artifactId>
+                              
+          <configuration>
+                                    
+            <consoleOutput>true</consoleOutput>
+                                    
+            <excludes>
+                                          
+              <!-- Git related files -->
+                                          
+              <exclude>**/.git/**</exclude>
+                                          
+              <exclude>**/.mvn/**</exclude>
+                                          
+              <exclude>**/.gitignore</exclude>
+                                          
+              <exclude>**/.gitmodules</exclude>
+                                          
+              <exclude>**/.git-blame-ignore-revs</exclude>
+                                          
+              <!-- Maven related files -->
+                                          
+              <exclude>**/target/**</exclude>
+                                          
+              <!-- Eclipse related files -->
+                                          
+              <exclude>**/.project</exclude>
+                                          
+              <exclude>**/.settings/**</exclude>
+                                          
+              <exclude>**/.classpath</exclude>
+                                          
+              <!-- IntelliJ related files -->
+                                          
+              <exclude>**/.idea/**</exclude>
+                                          
+              <exclude>**/*.iml</exclude>
+                                          
+              <!-- Runtime log -->
+                                          
+              <exclude>**/*.log</exclude>
+                                          
+              <!-- Exclude CVS files -->
+                                          
+              <exclude>**/*.cvs</exclude>
+                                          
+              <!-- licenses -->
+                                          
+              <exclude>licenses/*</exclude>
+                                          
+              <!-- only for Travis CI with WinOS-->
+                                          
+              <exclude>hadoopbin</exclude>
+                                          
+              <exclude>windowssystem32</exclude>
+                                          
+              <!-- generated by Github -->
+                                          
+              <exclude>**/.github/**</exclude>
+                                          
+              <!-- figures -->
+                                          
+              <exclude>**/.eps</exclude>
+                                          
+              <exclude>**/.png</exclude>
+                                          
+              <exclude>**/.jpg</exclude>
+                                          
+              <exclude>**/.jpeg</exclude>
+                                          
+              <!--Generated by Apache Release -->
+                                          
+              <exclude>local-snapshots-dir/**</exclude>
+                                          
+              <!-- JSON can't contain comments and therefore no Apache header -->
+                                          
+              <exclude>*.json</exclude>
+                                          
+              <!-- visualization plans -->
+                                          
+              <exclude>**/*.plan</exclude>
+                                          
+              <exclude>**/NOTICE-binary</exclude>
+                                          
+              <exclude>**/LICENSE-binary</exclude>
+                                          
+              <!-- json does not support comments-->
+                                          
+              <exclude>**/*.json</exclude>
+                                          
+              <!-- the zeppelin export file format-->
+                                          
+              <exclude>**/*.zpln</exclude>
+                                          
+              <!-- exclude go.mod and go.sum in iotdb-client-go submodule-->
+                                          
+              <exclude>**/go.mod</exclude>
+                                          
+              <exclude>**/go.sum</exclude>
+                                          
+              <!-- python -->
+                                          
+              <exclude>.pytest_cache/**</exclude>
+                                          
+              <exclude>venv/**</exclude>
+                                          
+              <exclude>apache_iotdb.egg-info/**</exclude>
+                                          
+              <!-- Java SPI uses files in resources/META-INF/services-->
+                                          
+              <exclude>**/resources/META-INF/services/**</exclude>
+                                      
+            </excludes>
+                                
+          </configuration>
+                          
+        </plugin>
+                        
+        <plugin>
+                              
+          <groupId>com.diffplug.spotless</groupId>
+                              
+          <artifactId>spotless-maven-plugin</artifactId>
+                              
+          <version>${spotless.version}</version>
+                              
+          <configuration>
+                                    
+            <java>
+                                          
+              <googleJavaFormat>
+                                                
+                <version>1.7</version>
+                                                
+                <style>GOOGLE</style>
+                                            
+              </googleJavaFormat>
+                                          
+              <importOrder>
+                                                
+                <order>org.apache.iotdb,,javax,java,\#</order>
+                                            
+              </importOrder>
+                                          
+              <removeUnusedImports/>
+                                      
+            </java>
+                                    
+            <lineEndings>UNIX</lineEndings>
+                                
+          </configuration>
+                              
+          <executions>
+                                    
+            <execution>
+                                          
+              <id>spotless-check</id>
+                                          
+              <phase>validate</phase>
+                                          
+              <goals>
+                                                
+                <goal>check</goal>
+                                            
+              </goals>
+                                      
+            </execution>
+                                
+          </executions>
+                          
+        </plugin>
+                    
+      </plugins>
+              
+    </pluginManagement>
+            
+    <plugins>
+                  
+      <plugin>
+                        
+        <groupId>org.eluder.coveralls</groupId>
+                        
+        <artifactId>coveralls-maven-plugin</artifactId>
+                        
+        <version>4.3.0</version>
+                        
+        <configuration>
+                              
+          <jacocoReports>
+                                    
+            <jacocoReport>code-coverage/target/jacoco-merged-reports/jacoco.xml</jacocoReport>
+                                
+          </jacocoReports>
+                              
+          <sourceEncoding>UTF-8</sourceEncoding>
+                              
+          <sourceDirectories>
+                                    
+            <!-- put all source folders not in src/main/java here-->
+                                    
+            <sourceDirectory>antlr/target/generated-sources/antlr4</sourceDirectory>
+                                    
+            <sourceDirectory>thrift/target/generated-sources/thrift</sourceDirectory>
+                                    
+            <sourceDirectory>thrift-sync/target/generated-sources/thrift</sourceDirectory>
+                                    
+            <sourceDirectory>thrift-cluster/target/generated-sources/thrift</sourceDirectory>
+                                    
+            <sourceDirectory>openapi/target/generated-sources/java/src/gen/java</sourceDirectory>
+                                    
+            <sourceDirectory>openapi/target/generated-sources/java/src/main/java</sourceDirectory>
+                                    
+            <sourceDirectory>spark-iotdb-connector/src/main/scala</sourceDirectory>
+                                    
+            <sourceDirectory>spark-tsfile/src/main/scala</sourceDirectory>
+                                
+          </sourceDirectories>
+                          
+        </configuration>
+                        
+        <!-- JDK11 removes the following libs. We have to add them-->
+                        
+        <dependencies>
+                              
+          <dependency>
+                                    
+            <groupId>javax.xml.bind</groupId>
+                                    
+            <artifactId>jaxb-api</artifactId>
+                                    
+            <version>2.4.0-b180830.0359</version>
+                                
+          </dependency>
+                              
+          <dependency>
+                                    
+            <groupId>com.sun.xml.bind</groupId>
+                                    
+            <artifactId>jaxb-core</artifactId>
+                                    
+            <version>2.3.0</version>
+                                
+          </dependency>
+                              
+          <dependency>
+                                    
+            <groupId>com.sun.xml.bind</groupId>
+                                    
+            <artifactId>jaxb-impl</artifactId>
+                                    
+            <version>2.3.0</version>
+                                
+          </dependency>
+                          
+        </dependencies>
+                    
+      </plugin>
+                  
+      <!--
                       Strange things usually happen if you run with a too low Java version.
                       This plugin not only checks the minimum java version of 1.8, but also
                       checks all dependencies (and transitive dependencies) for reported CVEs.
                     -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-enforcer-plugin</artifactId>
-                <version>3.0.0-M2</version>
-                <!--$NO-MVN-MAN-VER$-->
-                <executions>
-                    <!-- Ensure we're not mixing dependency versions -->
-                    <execution>
-                        <id>enforce-version-convergence</id>
-                        <phase>validate</phase>
-                        <configuration>
-                            <rules>
-                                <dependencyConvergence/>
-                            </rules>
-                        </configuration>
-                        <goals>
-                            <goal>enforce</goal>
-                        </goals>
-                    </execution>
-                    <!--
+                  
+      <plugin>
+                        
+        <groupId>org.apache.maven.plugins</groupId>
+                        
+        <artifactId>maven-enforcer-plugin</artifactId>
+                        
+        <version>3.0.0-M2</version>
+                        
+        <!--$NO-MVN-MAN-VER$-->
+                        
+        <executions>
+                              
+          <!-- Ensure we're not mixing dependency versions -->
+                              
+          <execution>
+                                    
+            <id>enforce-version-convergence</id>
+                                    
+            <phase>validate</phase>
+                                    
+            <configuration>
+                                          
+              <rules>
+                                                
+                <dependencyConvergence/>
+                                            
+              </rules>
+                                      
+            </configuration>
+                                    
+            <goals>
+                                          
+              <goal>enforce</goal>
+                                      
+            </goals>
+                                
+          </execution>
+                              
+          <!--
                         Fails the build if classes are included from multiple
                         artifacts and these are not identical.
                     -->
-                    <!--execution>
+                              
+          <!--execution>
                         <id>enforce-ban-duplicate-classes</id>
                         <goals>
                             <goal>enforce</goal>
@@ -804,41 +1548,76 @@
                             <fail>true</fail>
                         </configuration>
                     </execution-->
-                    <!-- Make sure no dependencies are used for which known vulnerabilities exist. -->
-                    <execution>
-                        <id>vulnerability-checks</id>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>enforce</goal>
-                        </goals>
-                        <configuration>
-                            <!-- Just generate warnings for now -->
-                            <fail>false</fail>
-                            <rules>
-                                <requireJavaVersion>
-                                    <version>1.8.0</version>
-                                </requireJavaVersion>
-                                <!-- Disabled for now as it breaks the ability to build single modules -->
-                                <!--reactorModuleConvergence/-->
-                                <banVulnerable implementation="org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies"/>
-                            </rules>
-                        </configuration>
-                    </execution>
-                </executions>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.sonatype.ossindex.maven</groupId>
-                        <artifactId>ossindex-maven-enforcer-rules</artifactId>
-                        <version>1.0.0</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>extra-enforcer-rules</artifactId>
-                        <version>1.4</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-            <!--
+                              
+          <!-- Make sure no dependencies are used for which known vulnerabilities exist. -->
+                              
+          <execution>
+                                    
+            <id>vulnerability-checks</id>
+                                    
+            <phase>validate</phase>
+                                    
+            <goals>
+                                          
+              <goal>enforce</goal>
+                                      
+            </goals>
+                                    
+            <configuration>
+                                          
+              <!-- Just generate warnings for now -->
+                                          
+              <fail>false</fail>
+                                          
+              <rules>
+                                                
+                <requireJavaVersion>
+                                                      
+                  <version>1.8.0</version>
+                                                  
+                </requireJavaVersion>
+                                                
+                <!-- Disabled for now as it breaks the ability to build single modules -->
+                                                
+                <!--reactorModuleConvergence/-->
+                                                
+                <banVulnerable implementation="org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies"/>
+                                            
+              </rules>
+                                      
+            </configuration>
+                                
+          </execution>
+                          
+        </executions>
+                        
+        <dependencies>
+                              
+          <dependency>
+                                    
+            <groupId>org.sonatype.ossindex.maven</groupId>
+                                    
+            <artifactId>ossindex-maven-enforcer-rules</artifactId>
+                                    
+            <version>1.0.0</version>
+                                
+          </dependency>
+                              
+          <dependency>
+                                    
+            <groupId>org.codehaus.mojo</groupId>
+                                    
+            <artifactId>extra-enforcer-rules</artifactId>
+                                    
+            <version>1.4</version>
+                                
+          </dependency>
+                          
+        </dependencies>
+                    
+      </plugin>
+                  
+      <!--
               Even if Maven transitively pulls in dependencies, relying on these can
               quite often cause hard to find problems. So it's a good practice to make
               sure everything directly required is also directly added as a dependency.
@@ -847,311 +1626,607 @@
               what we need and only that and that runtime dependencies are correctly
               imported with runtime scope.
             -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>check-dependencies</id>
-                        <phase>verify</phase>
-                        <goals>
-                            <goal>analyze-only</goal>
-                        </goals>
-                        <configuration>
-                            <failOnWarning>false</failOnWarning>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>net.revelc.code.formatter</groupId>
-                <artifactId>formatter-maven-plugin</artifactId>
-                <version>2.8.1</version>
-            </plugin>
-            <!--for code style check -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-checkstyle-plugin</artifactId>
-                <version>3.0.0</version>
-                <dependencies>
-                    <dependency>
-                        <groupId>com.puppycrawl.tools</groupId>
-                        <artifactId>checkstyle</artifactId>
-                        <version>8.18</version>
-                    </dependency>
-                </dependencies>
-                <executions>
-                    <execution>
-                        <id>validate</id>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>check</goal>
-                        </goals>
-                        <configuration>
-                            <outputFile>target/checkstyle-report.xml</outputFile>
-                            <configLocation>checkstyle.xml</configLocation>
-                        </configuration>
-                    </execution>
-                </executions>
-                <configuration>
-                    <configLocation>checkstyle.xml</configLocation>
-                </configuration>
-            </plugin>
-            <!--
+                  
+      <plugin>
+                        
+        <groupId>org.apache.maven.plugins</groupId>
+                        
+        <artifactId>maven-dependency-plugin</artifactId>
+                        
+        <executions>
+                              
+          <execution>
+                                    
+            <id>check-dependencies</id>
+                                    
+            <phase>verify</phase>
+                                    
+            <goals>
+                                          
+              <goal>analyze-only</goal>
+                                      
+            </goals>
+                                    
+            <configuration>
+                                          
+              <failOnWarning>false</failOnWarning>
+                                      
+            </configuration>
+                                
+          </execution>
+                          
+        </executions>
+                    
+      </plugin>
+                  
+      <plugin>
+                        
+        <groupId>net.revelc.code.formatter</groupId>
+                        
+        <artifactId>formatter-maven-plugin</artifactId>
+                        
+        <version>2.8.1</version>
+                    
+      </plugin>
+                  
+      <!--for code style check -->
+                  
+      <plugin>
+                        
+        <groupId>org.apache.maven.plugins</groupId>
+                        
+        <artifactId>maven-checkstyle-plugin</artifactId>
+                        
+        <version>3.0.0</version>
+                        
+        <dependencies>
+                              
+          <dependency>
+                                    
+            <groupId>com.puppycrawl.tools</groupId>
+                                    
+            <artifactId>checkstyle</artifactId>
+                                    
+            <version>8.18</version>
+                                
+          </dependency>
+                          
+        </dependencies>
+                        
+        <executions>
+                              
+          <execution>
+                                    
+            <id>validate</id>
+                                    
+            <phase>validate</phase>
+                                    
+            <goals>
+                                          
+              <goal>check</goal>
+                                      
+            </goals>
+                                    
+            <configuration>
+                                          
+              <outputFile>target/checkstyle-report.xml</outputFile>
+                                          
+              <configLocation>checkstyle.xml</configLocation>
+                                      
+            </configuration>
+                                
+          </execution>
+                          
+        </executions>
+                        
+        <configuration>
+                              
+          <configLocation>checkstyle.xml</configLocation>
+                          
+        </configuration>
+                    
+      </plugin>
+                  
+      <!--
               Check if all files contain Apache headers in them.
               Ignore this plugin, we use license-maven-plugin to check apache header.
             -->
-            <plugin>
-                <groupId>org.apache.rat</groupId>
-                <artifactId>apache-rat-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>license-check</id>
-                        <phase>verify</phase>
-                        <goals>
-                            <goal>check</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>au.com.acegi</groupId>
-                <artifactId>xml-format-maven-plugin</artifactId>
-                <version>3.0.7</version>
-                <executions>
-                    <execution>
-                        <id>xml-format</id>
-                        <phase>compile</phase>
-                        <goals>
-                            <goal>xml-format</goal>
-                        </goals>
-                        <configuration>
-                            <!-- configure your formatting preferences here (see link below) -->
-                            <indentSize>4</indentSize>
-                            <excludes>**/target/**</excludes>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <!--
+                  
+      <plugin>
+                        
+        <groupId>org.apache.rat</groupId>
+                        
+        <artifactId>apache-rat-plugin</artifactId>
+                        
+        <executions>
+                              
+          <execution>
+                                    
+            <id>license-check</id>
+                                    
+            <phase>verify</phase>
+                                    
+            <goals>
+                                          
+              <goal>check</goal>
+                                      
+            </goals>
+                                
+          </execution>
+                          
+        </executions>
+                    
+      </plugin>
+                  
+      <plugin>
+                        
+        <groupId>au.com.acegi</groupId>
+                        
+        <artifactId>xml-format-maven-plugin</artifactId>
+                        
+        <version>3.0.7</version>
+                        
+        <executions>
+                              
+          <execution>
+                                    
+            <id>xml-format</id>
+                                    
+            <phase>compile</phase>
+                                    
+            <goals>
+                                          
+              <goal>xml-format</goal>
+                                      
+            </goals>
+                                    
+            <configuration>
+                                          
+              <!-- configure your formatting preferences here (see link below) -->
+                                          
+              <indentSize>4</indentSize>
+                                          
+              <excludes>**/target/**</excludes>
+                                      
+            </configuration>
+                                
+          </execution>
+                          
+        </executions>
+                    
+      </plugin>
+                  
+      <!--
               Generate the legally required text files in the jars
             -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-remote-resources-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>process-resource-bundles</id>
-                        <goals>
-                            <goal>process</goal>
-                        </goals>
-                        <configuration>
-                            <resourceBundles>
-                                <!-- Will generate META-INF/{DEPENDENCIES,LICENSE,NOTICE} -->
-                                <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
-                            </resourceBundles>
-                            <!-- Content in this directory will be appended to generated resources -->
-                            <appendedResourcesDirectory>${basedir}/src/remote-resources</appendedResourcesDirectory>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <!-- Separates the unit tests from the integration tests. -->
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>unit-tests</id>
-                        <phase>test</phase>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                        <configuration>
-                            <includes>
-                                <!-- Include unit tests within integration-test phase. -->
-                                <include>src/test/**/*Test.java</include>
-                            </includes>
-                            <excludes>
-                                <!-- Exclude integration tests within (unit) test phase. -->
-                                <exclude>src/test/**/*IT.java</exclude>
-                            </excludes>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>integration-tests</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                        <configuration>
-                            <includes>
-                                <!-- Include integration tests within integration-test phase. -->
-                                <include>src/test/**/*IT.java</include>
-                            </includes>
-                            <excludes>
-                                <!-- Exclude unit tests within (unit) test phase. -->
-                                <exclude>src/test/**/*Test.java</exclude>
-                            </excludes>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <!-- Also package the sources as jar -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <version>3.2.0</version>
-                <executions>
-                    <execution>
-                        <id>create-source-package</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
+                  
+      <plugin>
+                        
+        <groupId>org.apache.maven.plugins</groupId>
+                        
+        <artifactId>maven-remote-resources-plugin</artifactId>
+                        
+        <executions>
+                              
+          <execution>
+                                    
+            <id>process-resource-bundles</id>
+                                    
+            <goals>
+                                          
+              <goal>process</goal>
+                                      
+            </goals>
+                                    
+            <configuration>
+                                          
+              <resourceBundles>
+                                                
+                <!-- Will generate META-INF/{DEPENDENCIES,LICENSE,NOTICE} -->
+                                                
+                <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
+                                            
+              </resourceBundles>
+                                          
+              <!-- Content in this directory will be appended to generated resources -->
+                                          
+              <appendedResourcesDirectory>${basedir}/src/remote-resources</appendedResourcesDirectory>
+                                      
+            </configuration>
+                                
+          </execution>
+                          
+        </executions>
+                    
+      </plugin>
+                  
+      <plugin>
+                        
+        <!-- Separates the unit tests from the integration tests. -->
+                        
+        <groupId>org.apache.maven.plugins</groupId>
+                        
+        <artifactId>maven-surefire-plugin</artifactId>
+                        
+        <executions>
+                              
+          <execution>
+                                    
+            <id>unit-tests</id>
+                                    
+            <phase>test</phase>
+                                    
+            <goals>
+                                          
+              <goal>test</goal>
+                                      
+            </goals>
+                                    
+            <configuration>
+                                          
+              <includes>
+                                                
+                <!-- Include unit tests within integration-test phase. -->
+                                                
+                <include>src/test/**/*Test.java</include>
+                                            
+              </includes>
+                                          
+              <excludes>
+                                                
+                <!-- Exclude integration tests within (unit) test phase. -->
+                                                
+                <exclude>src/test/**/*IT.java</exclude>
+                                            
+              </excludes>
+                                      
+            </configuration>
+                                
+          </execution>
+                              
+          <execution>
+                                    
+            <id>integration-tests</id>
+                                    
+            <phase>integration-test</phase>
+                                    
+            <goals>
+                                          
+              <goal>test</goal>
+                                      
+            </goals>
+                                    
+            <configuration>
+                                          
+              <includes>
+                                                
+                <!-- Include integration tests within integration-test phase. -->
+                                                
+                <include>src/test/**/*IT.java</include>
+                                            
+              </includes>
+                                          
+              <excludes>
+                                                
+                <!-- Exclude unit tests within (unit) test phase. -->
+                                                
+                <exclude>src/test/**/*Test.java</exclude>
+                                            
+              </excludes>
+                                      
+            </configuration>
+                                
+          </execution>
+                          
+        </executions>
+                    
+      </plugin>
+                  
+      <!-- Also package the sources as jar -->
+                  
+      <plugin>
+                        
+        <groupId>org.apache.maven.plugins</groupId>
+                        
+        <artifactId>maven-source-plugin</artifactId>
+                        
+        <version>3.2.0</version>
+                        
+        <executions>
+                              
+          <execution>
+                                    
+            <id>create-source-package</id>
+                                    
+            <phase>package</phase>
+                                    
+            <goals>
+                                          
+              <goal>jar</goal>
+                                      
+            </goals>
+                                
+          </execution>
+                          
+        </executions>
+                    
+      </plugin>
+              
+    </plugins>
+        
+  </build>
+      
+  <profiles>
+            
+    <!-- spotless is too slow, so we put it into a profile to skip it if needed -->
+            
+    <!-- currently spotless cannot run on jdk16, due to JEP 396: Strongly Encapsulate JDK Internals by Default-->
+            
+    <profile>
+                  
+      <id>spotless</id>
+                  
+      <activation>
+                        
+        <!-- activeByDefault does not take effect-->
+                        
+        <jdk>[1.8,16)</jdk>
+                        
+        <file>
+                              
+          <exists>.</exists>
+                          
+        </file>
+                    
+      </activation>
+                  
+      <build>
+                        
+        <plugins>
+                              
+          <plugin>
+                                    
+            <groupId>com.diffplug.spotless</groupId>
+                                    
+            <artifactId>spotless-maven-plugin</artifactId>
+                                
+          </plugin>
+                          
         </plugins>
-    </build>
-    <profiles>
-        <!-- spotless is too slow, so we put it into a profile to skip it if needed -->
-        <!-- currently spotless cannot run on jdk16, due to JEP 396: Strongly Encapsulate JDK Internals by Default-->
-        <profile>
-            <id>spotless</id>
-            <activation>
-                <!-- activeByDefault does not take effect-->
-                <jdk>[1.8,16)</jdk>
-                <file>
-                    <exists>.</exists>
-                </file>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>com.diffplug.spotless</groupId>
-                        <artifactId>spotless-maven-plugin</artifactId>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-        <!--
+                    
+      </build>
+              
+    </profile>
+            
+    <!--
           A set of profiles defining the different properties needed to download and run thrift
           They are automatically activated depending on the OS you are using.
         -->
-        <profile>
-            <id>windows</id>
-            <activation>
-                <os>
-                    <family>windows</family>
-                </os>
-            </activation>
-            <properties>
-                <os.classifier>windows-x86_64</os.classifier>
-                <thrift.download-url>http://artfiles.org/apache.org/thrift/${thrift.version}/thrift-${thrift.version}.exe</thrift.download-url>
-                <thrift.executable>thrift-${thrift.version}-win-x86_64.exe</thrift.executable>
-                <thrift.skip-making-executable>true</thrift.skip-making-executable>
-                <thrift.exec-cmd.executable>echo</thrift.exec-cmd.executable>
-                <thrift.exec-cmd.args>"Do nothing"</thrift.exec-cmd.args>
-            </properties>
-        </profile>
-        <!-- Has to be listed before "mac" as it seems a mac is both "mac" and "unix" -->
-        <profile>
-            <id>unix</id>
-            <activation>
-                <os>
-                    <family>unix</family>
-                </os>
-            </activation>
-            <properties>
-                <os.classifier>linux-x86_64</os.classifier>
-                <thrift.download-url>https://github.com/apache/iotdb-bin-resources/raw/main/compile-tools/thrift-0.14-ubuntu</thrift.download-url>
-                <thrift.executable>thrift_0.14.1_linux.exe</thrift.executable>
-                <thrift.skip-making-executable>false</thrift.skip-making-executable>
-                <thrift.exec-cmd.executable>chmod</thrift.exec-cmd.executable>
-                <thrift.exec-cmd.args>+x ${project.build.directory}/tools/${thrift.executable}</thrift.exec-cmd.args>
-            </properties>
-        </profile>
-        <profile>
-            <id>mac</id>
-            <activation>
-                <os>
-                    <family>mac</family>
-                </os>
-            </activation>
-            <properties>
-                <os.classifier>mac-x86_64</os.classifier>
-                <thrift.download-url>https://github.com/apache/iotdb-bin-resources/raw/main/compile-tools/thrift-0.14-MacOS</thrift.download-url>
-                <thrift.executable>thrift_0.14.1_mac.exe</thrift.executable>
-                <thrift.skip-making-executable>false</thrift.skip-making-executable>
-                <thrift.exec-cmd.executable>chmod</thrift.exec-cmd.executable>
-                <thrift.exec-cmd.args>+x ${project.build.directory}/tools/${thrift.executable}</thrift.exec-cmd.args>
-            </properties>
-        </profile>
-        <!-- for TestContainer. As it requires docker, we have to detect whether docker exists.-->
-        <profile>
-            <!-- Mac and Unix-->
-            <id>unixDockerCheck</id>
-            <activation>
-                <file>
-                    <exists>/var/run/docker.sock</exists>
-                </file>
-            </activation>
-            <modules>
-                <module>testcontainer</module>
-            </modules>
-        </profile>
-        <profile>
-            <id>WinDockerCheck</id>
-            <activation>
-                <file>
-                    <exists>C:\Program Files\Docker\Docker\resources\bin\docker.exe</exists>
-                </file>
-            </activation>
-            <modules>
-                <module>testcontainer</module>
-            </modules>
-        </profile>
-        <!-- Some APIs were removed in Java 11, so we need to add replacements -->
-        <profile>
-            <id>java-11-and-above</id>
-            <activation>
-                <!-- This needs to be updated as soon as Java 20 is shipped -->
-                <jdk>[11,20)</jdk>
-            </activation>
-            <properties>
-                <maven.compiler.release>8</maven.compiler.release>
-            </properties>
-            <dependencies>
-                <!-- for jdk-11 -->
-                <dependency>
-                    <groupId>javax.annotation</groupId>
-                    <artifactId>javax.annotation-api</artifactId>
-                </dependency>
-                <dependency>
-                    <groupId>javax.xml.bind</groupId>
-                    <artifactId>jaxb-api</artifactId>
-                </dependency>
-                <dependency>
-                    <groupId>org.glassfish.jaxb</groupId>
-                    <artifactId>jaxb-runtime</artifactId>
-                </dependency>
-            </dependencies>
-        </profile>
-        <!-- Add argLine for Java 16 and above, due to [JEP 396: Strongly Encapsulate JDK Internals by Default]
+            
+    <profile>
+                  
+      <id>windows</id>
+                  
+      <activation>
+                        
+        <os>
+                              
+          <family>windows</family>
+                          
+        </os>
+                    
+      </activation>
+                  
+      <properties>
+                        
+        <os.classifier>windows-x86_64</os.classifier>
+                        
+        <thrift.download-url>http://artfiles.org/apache.org/thrift/${thrift.version}/thrift-${thrift.version}.exe</thrift.download-url>
+                        
+        <thrift.executable>thrift-${thrift.version}-win-x86_64.exe</thrift.executable>
+                        
+        <thrift.skip-making-executable>true</thrift.skip-making-executable>
+                        
+        <thrift.exec-cmd.executable>echo</thrift.exec-cmd.executable>
+                        
+        <thrift.exec-cmd.args>"Do nothing"</thrift.exec-cmd.args>
+                    
+      </properties>
+              
+    </profile>
+            
+    <!-- Has to be listed before "mac" as it seems a mac is both "mac" and "unix" -->
+            
+    <profile>
+                  
+      <id>unix</id>
+                  
+      <activation>
+                        
+        <os>
+                              
+          <family>unix</family>
+                          
+        </os>
+                    
+      </activation>
+                  
+      <properties>
+                        
+        <os.classifier>linux-x86_64</os.classifier>
+                        
+        <thrift.download-url>https://github.com/apache/iotdb-bin-resources/raw/main/compile-tools/thrift-0.14-ubuntu</thrift.download-url>
+                        
+        <thrift.executable>thrift_0.14.1_linux.exe</thrift.executable>
+                        
+        <thrift.skip-making-executable>false</thrift.skip-making-executable>
+                        
+        <thrift.exec-cmd.executable>chmod</thrift.exec-cmd.executable>
+                        
+        <thrift.exec-cmd.args>+x ${project.build.directory}/tools/${thrift.executable}</thrift.exec-cmd.args>
+                    
+      </properties>
+              
+    </profile>
+            
+    <profile>
+                  
+      <id>mac</id>
+                  
+      <activation>
+                        
+        <os>
+                              
+          <family>mac</family>
+                          
+        </os>
+                    
+      </activation>
+                  
+      <properties>
+                        
+        <os.classifier>mac-x86_64</os.classifier>
+                        
+        <thrift.download-url>https://github.com/apache/iotdb-bin-resources/raw/main/compile-tools/thrift-0.14-MacOS</thrift.download-url>
+                        
+        <thrift.executable>thrift_0.14.1_mac.exe</thrift.executable>
+                        
+        <thrift.skip-making-executable>false</thrift.skip-making-executable>
+                        
+        <thrift.exec-cmd.executable>chmod</thrift.exec-cmd.executable>
+                        
+        <thrift.exec-cmd.args>+x ${project.build.directory}/tools/${thrift.executable}</thrift.exec-cmd.args>
+                    
+      </properties>
+              
+    </profile>
+            
+    <!-- for TestContainer. As it requires docker, we have to detect whether docker exists.-->
+            
+    <profile>
+                  
+      <!-- Mac and Unix-->
+                  
+      <id>unixDockerCheck</id>
+                  
+      <activation>
+                        
+        <file>
+                              
+          <exists>/var/run/docker.sock</exists>
+                          
+        </file>
+                    
+      </activation>
+                  
+      <modules>
+                        
+        <module>testcontainer</module>
+                    
+      </modules>
+              
+    </profile>
+            
+    <profile>
+                  
+      <id>WinDockerCheck</id>
+                  
+      <activation>
+                        
+        <file>
+                              
+          <exists>C:\Program Files\Docker\Docker\resources\bin\docker.exe</exists>
+                          
+        </file>
+                    
+      </activation>
+                  
+      <modules>
+                        
+        <module>testcontainer</module>
+                    
+      </modules>
+              
+    </profile>
+            
+    <!-- Some APIs were removed in Java 11, so we need to add replacements -->
+            
+    <profile>
+                  
+      <id>java-11-and-above</id>
+                  
+      <activation>
+                        
+        <!-- This needs to be updated as soon as Java 20 is shipped -->
+                        
+        <jdk>[11,20)</jdk>
+                    
+      </activation>
+                  
+      <properties>
+                        
+        <maven.compiler.release>8</maven.compiler.release>
+                    
+      </properties>
+                  
+      <dependencies>
+                        
+        <!-- for jdk-11 -->
+                        
+        <dependency>
+                              
+          <groupId>javax.annotation</groupId>
+                              
+          <artifactId>javax.annotation-api</artifactId>
+                          
+        </dependency>
+                        
+        <dependency>
+                              
+          <groupId>javax.xml.bind</groupId>
+                              
+          <artifactId>jaxb-api</artifactId>
+                          
+        </dependency>
+                        
+        <dependency>
+                              
+          <groupId>org.glassfish.jaxb</groupId>
+                              
+          <artifactId>jaxb-runtime</artifactId>
+                          
+        </dependency>
+                    
+      </dependencies>
+              
+    </profile>
+            
+    <!-- Add argLine for Java 16 and above, due to [JEP 396: Strongly Encapsulate JDK Internals by Default]
           (https://openjdk.java.net/jeps/396) -->
-        <profile>
-            <id>java-16-and-above</id>
-            <activation>
-                <!-- This needs to be updated as soon as Java 20 is shipped -->
-                <jdk>[16,20)</jdk>
-            </activation>
-            <properties>
-                <maven.compiler.release>8</maven.compiler.release>
-                <argLine>--illegal-access=permit --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.java [...]
-            </properties>
-        </profile>
-        <!--
+            
+    <profile>
+                  
+      <id>java-16-and-above</id>
+                  
+      <activation>
+                        
+        <!-- This needs to be updated as soon as Java 20 is shipped -->
+                        
+        <jdk>[16,20)</jdk>
+                    
+      </activation>
+                  
+      <properties>
+                        
+        <maven.compiler.release>8</maven.compiler.release>
+                        
+        <argLine>--illegal-access=permit --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.file=A [...]
+                    
+      </properties>
+              
+    </profile>
+            
+    <!--
           Self activating profile, that activates itself as soon as a "src/main/thrift" directory is found.
           The different plugins here download the thrift executable matching the current os, make that
           executable (on mac and unix/linux) and run the code generation.
@@ -1160,344 +2235,677 @@
           and only downloads each file once. It caches downloaded files in:
           {maven local repo}/.cache/download-maven-plugin
         -->
-        <profile>
-            <id>thrift-generation</id>
-            <activation>
-                <file>
-                    <exists>src/main/thrift</exists>
-                </file>
-            </activation>
-            <properties>
-                <thrift.exec.absolute.path>${project.build.directory}/tools/${thrift.executable}</thrift.exec.absolute.path>
-            </properties>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>com.googlecode.maven-download-plugin</groupId>
-                        <artifactId>download-maven-plugin</artifactId>
-                        <version>1.6.7</version>
-                        <executions>
-                            <execution>
-                                <id>get-thrift-executable</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>wget</goal>
-                                </goals>
-                                <configuration>
-                                    <url>${thrift.download-url}</url>
-                                    <outputDirectory>${project.build.directory}/tools</outputDirectory>
-                                    <outputFileName>${thrift.executable}</outputFileName>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>exec-maven-plugin</artifactId>
-                        <version>1.6.0</version>
-                        <executions>
-                            <execution>
-                                <id>make-thrift-executable-executable</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>exec</goal>
-                                </goals>
-                                <configuration>
-                                    <skip>${thrift.skip-making-executable}</skip>
-                                    <executable>${thrift.exec-cmd.executable}</executable>
-                                    <commandlineArgs>${thrift.exec-cmd.args}</commandlineArgs>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                    <plugin>
-                        <groupId>org.apache.thrift.tools</groupId>
-                        <artifactId>maven-thrift-plugin</artifactId>
-                        <version>0.1.11</version>
-                        <executions>
-                            <execution>
-                                <id>generate-thrift-sources-java</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>compile</goal>
-                                </goals>
-                                <configuration>
-                                    <generator>java</generator>
-                                    <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
-                                    <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>generate-thrift-sources-python</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>compile</goal>
-                                </goals>
-                                <configuration>
-                                    <generator>py</generator>
-                                    <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
-                                    <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
-                                    <outputDirectory>${project.build.directory}/generated-sources-python/</outputDirectory>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>generate-thrift-sources-go</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>compile</goal>
-                                </goals>
-                                <configuration>
-                                    <generator>go</generator>
-                                    <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
-                                    <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
-                                    <outputDirectory>${project.build.directory}/generated-sources-go</outputDirectory>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-        <!-- Make sure the source assembly has the right name -->
-        <profile>
-            <id>apache-release</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-assembly-plugin</artifactId>
-                        <version>${maven.assembly.version}</version>
-                        <executions>
-                            <execution>
-                                <id>source-release-assembly</id>
-                                <phase>package</phase>
-                                <goals>
-                                    <goal>single</goal>
-                                </goals>
-                                <!-- heads up: combine.self in the following is highlighted
+            
+    <profile>
+                  
+      <id>thrift-generation</id>
+                  
+      <activation>
+                        
+        <file>
+                              
+          <exists>src/main/thrift</exists>
+                          
+        </file>
+                    
+      </activation>
+                  
+      <properties>
+                        
+        <thrift.exec.absolute.path>${project.build.directory}/tools/${thrift.executable}</thrift.exec.absolute.path>
+                    
+      </properties>
+                  
+      <build>
+                        
+        <plugins>
+                              
+          <plugin>
+                                    
+            <groupId>com.googlecode.maven-download-plugin</groupId>
+                                    
+            <artifactId>download-maven-plugin</artifactId>
+                                    
+            <version>1.6.7</version>
+                                    
+            <executions>
+                                          
+              <execution>
+                                                
+                <id>get-thrift-executable</id>
+                                                
+                <phase>generate-sources</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>wget</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <url>${thrift.download-url}</url>
+                                                      
+                  <outputDirectory>${project.build.directory}/tools</outputDirectory>
+                                                      
+                  <outputFileName>${thrift.executable}</outputFileName>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                      
+            </executions>
+                                
+          </plugin>
+                              
+          <plugin>
+                                    
+            <groupId>org.codehaus.mojo</groupId>
+                                    
+            <artifactId>exec-maven-plugin</artifactId>
+                                    
+            <version>1.6.0</version>
+                                    
+            <executions>
+                                          
+              <execution>
+                                                
+                <id>make-thrift-executable-executable</id>
+                                                
+                <phase>generate-sources</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>exec</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <skip>${thrift.skip-making-executable}</skip>
+                                                      
+                  <executable>${thrift.exec-cmd.executable}</executable>
+                                                      
+                  <commandlineArgs>${thrift.exec-cmd.args}</commandlineArgs>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                      
+            </executions>
+                                
+          </plugin>
+                              
+          <plugin>
+                                    
+            <groupId>org.apache.thrift.tools</groupId>
+                                    
+            <artifactId>maven-thrift-plugin</artifactId>
+                                    
+            <version>0.1.11</version>
+                                    
+            <executions>
+                                          
+              <execution>
+                                                
+                <id>generate-thrift-sources-java</id>
+                                                
+                <phase>generate-sources</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>compile</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <generator>java</generator>
+                                                      
+                  <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+                                                      
+                  <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                          
+              <execution>
+                                                
+                <id>generate-thrift-sources-python</id>
+                                                
+                <phase>generate-sources</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>compile</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <generator>py</generator>
+                                                      
+                  <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+                                                      
+                  <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+                                                      
+                  <outputDirectory>${project.build.directory}/generated-sources-python/</outputDirectory>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                          
+              <execution>
+                                                
+                <id>generate-thrift-sources-go</id>
+                                                
+                <phase>generate-sources</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>compile</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <generator>go</generator>
+                                                      
+                  <thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
+                                                      
+                  <thriftSourceRoot>${basedir}/src/main/thrift</thriftSourceRoot>
+                                                      
+                  <outputDirectory>${project.build.directory}/generated-sources-go</outputDirectory>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                      
+            </executions>
+                                
+          </plugin>
+                          
+        </plugins>
+                    
+      </build>
+              
+    </profile>
+            
+    <!-- Make sure the source assembly has the right name -->
+            
+    <profile>
+                  
+      <id>apache-release</id>
+                  
+      <build>
+                        
+        <plugins>
+                              
+          <plugin>
+                                    
+            <groupId>org.apache.maven.plugins</groupId>
+                                    
+            <artifactId>maven-assembly-plugin</artifactId>
+                                    
+            <version>${maven.assembly.version}</version>
+                                    
+            <executions>
+                                          
+              <execution>
+                                                
+                <id>source-release-assembly</id>
+                                                
+                <phase>package</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>single</goal>
+                                                  
+                </goals>
+                                                
+                <!-- heads up: combine.self in the following is highlighted
                                     as an error in Eclipse's xml editor view.
                                     Just ignore that.
                                     See  https://issues.apache.org/jira/browse/MNG-5454  sigh.
                                  -->
-                                <configuration combine.self="append">
-                                    <finalName>apache-iotdb-${project.version}</finalName>
-                                    <archive>
-                                        <manifest>
-                                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
-                                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
-                                        </manifest>
-                                    </archive>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                    <!--
+                                                
+                <configuration combine.self="append">
+                                                      
+                  <finalName>apache-iotdb-${project.version}</finalName>
+                                                      
+                  <archive>
+                                                            
+                    <manifest>
+                                                                  
+                      <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                                                                  
+                      <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+                                                              
+                    </manifest>
+                                                        
+                  </archive>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                      
+            </executions>
+                                
+          </plugin>
+                              
+          <!--
                       Create SHA512 checksum files for the release artifacts.
                     -->
-                    <plugin>
-                        <groupId>net.nicoulaj.maven.plugins</groupId>
-                        <artifactId>checksum-maven-plugin</artifactId>
-                        <version>1.8</version>
-                        <executions>
-                            <execution>
-                                <id>sign-source-release</id>
-                                <phase>package</phase>
-                                <goals>
-                                    <goal>files</goal>
-                                </goals>
-                                <configuration>
-                                    <algorithms>
-                                        <algorithm>SHA-512</algorithm>
-                                    </algorithms>
-                                    <fileSets>
-                                        <fileSet>
-                                            <directory>${project.build.directory}</directory>
-                                            <includes>
-                                                <include>apache-iotdb-${project.version}-source-release.zip</include>
-                                            </includes>
-                                        </fileSet>
-                                    </fileSets>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-        <!-- enable site-->
-        <!-- use `mvn package -P site -pl site` to compile the site module only -->
-        <profile>
-            <id>site</id>
-            <modules>
-                <module>site</module>
-            </modules>
-        </profile>
-        <!-- code coverage for ut and it, and then merge them together.-->
-        <profile>
-            <id>code-coverage</id>
-            <modules>
-                <module>code-coverage</module>
-            </modules>
-            <build>
-                <plugins>
-                    <!-- Jacoco is a code coverage analysis plugin when tests run.
+                              
+          <plugin>
+                                    
+            <groupId>net.nicoulaj.maven.plugins</groupId>
+                                    
+            <artifactId>checksum-maven-plugin</artifactId>
+                                    
+            <version>1.8</version>
+                                    
+            <executions>
+                                          
+              <execution>
+                                                
+                <id>sign-source-release</id>
+                                                
+                <phase>package</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>files</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <algorithms>
+                                                            
+                    <algorithm>SHA-512</algorithm>
+                                                        
+                  </algorithms>
+                                                      
+                  <fileSets>
+                                                            
+                    <fileSet>
+                                                                  
+                      <directory>${project.build.directory}</directory>
+                                                                  
+                      <includes>
+                                                                        
+                        <include>apache-iotdb-${project.version}-source-release.zip</include>
+                                                                    
+                      </includes>
+                                                              
+                    </fileSet>
+                                                        
+                  </fileSets>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                      
+            </executions>
+                                
+          </plugin>
+                          
+        </plugins>
+                    
+      </build>
+              
+    </profile>
+            
+    <!-- enable site-->
+            
+    <!-- use `mvn package -P site -pl site` to compile the site module only -->
+            
+    <profile>
+                  
+      <id>site</id>
+                  
+      <modules>
+                        
+        <module>site</module>
+                    
+      </modules>
+              
+    </profile>
+            
+    <!-- code coverage for ut and it, and then merge them together.-->
+            
+    <profile>
+                  
+      <id>code-coverage</id>
+                  
+      <modules>
+                        
+        <module>code-coverage</module>
+                    
+      </modules>
+                  
+      <build>
+                        
+        <plugins>
+                              
+          <!-- Jacoco is a code coverage analysis plugin when tests run.
                     (not a static code analysis tool)-->
-                    <plugin>
-                        <groupId>org.jacoco</groupId>
-                        <artifactId>jacoco-maven-plugin</artifactId>
-                        <version>0.8.5</version>
-                        <configuration>
-                            <excludes>
-                                <exclude>org/apache/iotdb/service/sync/thrift/*</exclude>
-                                <exclude>org/apache/iotdb/service/rpc/thrift/*</exclude>
-                                <exclude>org/apache/iotdb/cluster/rpc/thrift/*</exclude>
-                                <exclude>org/apache/iotdb/protocol/influxdb/rpc/thrift/*</exclude>
-                                <exclude>org/apache/iotdb/db/qp/sql/*</exclude>
-                            </excludes>
-                            <rules>
-                                <rule implementation="org.jacoco.maven.RuleConfiguration">
-                                    <element>BUNDLE</element>
-                                    <limits>  
-                                        <!-- Cover methodes >=30%. (the plugin does not support
+                              
+          <plugin>
+                                    
+            <groupId>org.jacoco</groupId>
+                                    
+            <artifactId>jacoco-maven-plugin</artifactId>
+                                    
+            <version>0.8.5</version>
+                                    
+            <configuration>
+                                          
+              <excludes>
+                                                
+                <exclude>org/apache/iotdb/service/sync/thrift/*</exclude>
+                                                
+                <exclude>org/apache/iotdb/service/rpc/thrift/*</exclude>
+                                                
+                <exclude>org/apache/iotdb/cluster/rpc/thrift/*</exclude>
+                                                
+                <exclude>org/apache/iotdb/protocol/influxdb/rpc/thrift/*</exclude>
+                                                
+                <exclude>org/apache/iotdb/db/qp/sql/*</exclude>
+                                            
+              </excludes>
+                                          
+              <rules>
+                                                
+                <rule implementation="org.jacoco.maven.RuleConfiguration">
+                                                      
+                  <element>BUNDLE</element>
+                                                      
+                  <limits>
+                      
+                                        
+                    <!-- Cover methodes >=30%. (the plugin does not support
                                         ignore getter and setter and toString etc..) -->
-                                        <limit implementation="org.jacoco.report.check.Limit">
-                                            <counter>METHOD</counter>
-                                            <value>COVEREDRATIO</value>
-                                            <minimum>0.00</minimum>
-                                        </limit>
-                                        <!-- if-else, swtich etc.. >=70% -->
-                                        <limit implementation="org.jacoco.report.check.Limit">
-                                            <counter>BRANCH</counter>
-                                            <value>COVEREDRATIO</value>
-                                            <minimum>0.00</minimum>
-                                        </limit>
-                                        <!-- class files >=95% -->
-                                        <limit implementation="org.jacoco.report.check.Limit">
-                                            <counter>CLASS</counter>
-                                            <value>COVEREDRATIO</value>
-                                            <minimum>0.00</minimum>
-                                        </limit>
-                                    </limits>
-                                </rule>
-                            </rules>
-                        </configuration>
-                        <executions>
-                            <!-- see https://natritmeyer.com/howto/reporting-aggregated-unit-and-integration-test-coverage-with-jacoco/-->
-                            <!-- For UT-->
-                            <execution>
-                                <id>prepare-ut</id>
-                                <goals>
-                                    <goal>prepare-agent</goal>
-                                </goals>
-                                <configuration>
-                                    <destFile>${project.build.directory}/${project.build.finalName}-jacoco-unit-tests.exec</destFile>
-                                    <propertyName>surefire.jacoco.args</propertyName>
-                                </configuration>
-                            </execution>
-                            <!-- attached to Maven test phase -->
-                            <execution>
-                                <id>ut-report</id>
-                                <phase>test</phase>
-                                <goals>
-                                    <goal>report</goal>
-                                    <goal>check</goal>
-                                </goals>
-                                <configuration>
-                                    <dataFile>${project.build.directory}/${project.build.finalName}-jacoco-unit-tests.exec</dataFile>
-                                    <outputDirectory>${project.build.directory}/jacoco-unit-reports</outputDirectory>
-                                </configuration>
-                            </execution>
-                            <!-- For IT-->
-                            <execution>
-                                <id>before-integration-test-execution</id>
-                                <phase>pre-integration-test</phase>
-                                <goals>
-                                    <goal>prepare-agent</goal>
-                                </goals>
-                                <configuration>
-                                    <destFile>${project.build.directory}/${project.build.finalName}-jacoco-integration-tests.exec</destFile>
-                                    <propertyName>failsafe.jacoco.args</propertyName>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>after-integration-test-execution</id>
-                                <phase>integration-test</phase>
-                                <goals>
-                                    <goal>report</goal>
-                                    <goal>check</goal>
-                                </goals>
-                                <configuration>
-                                    <dataFile>${project.build.directory}/${project.build.finalName}-jacoco-integration-tests.exec</dataFile>
-                                    <outputDirectory>${project.build.directory}/jacoco-integration-reports</outputDirectory>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>merge-unit-and-integration</id>
-                                <phase>post-integration-test</phase>
-                                <goals>
-                                    <goal>merge</goal>
-                                </goals>
-                                <configuration>
-                                    <fileSets>
-                                        <fileSet>
-                                            <directory>${project.build.directory}/</directory>
-                                            <includes>
-                                                <include>*.exec</include>
-                                            </includes>
-                                        </fileSet>
-                                    </fileSets>
-                                    <destFile>${project.build.directory}/${project.build.finalName}-merged.exec</destFile>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>create-merged-report</id>
-                                <phase>post-integration-test</phase>
-                                <goals>
-                                    <goal>report</goal>
-                                    <goal>check</goal>
-                                </goals>
-                                <configuration>
-                                    <dataFile>${project.build.directory}/${project.build.finalName}-merged.exec</dataFile>
-                                    <outputDirectory>${project.build.directory}/jacoco-merged-reports</outputDirectory>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                    <!-- overwrite argLine-->
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-surefire-plugin</artifactId>
-                        <configuration>
-                            <argLine>@{surefire.jacoco.args} -Xmx1024m</argLine>
-                        </configuration>
-                    </plugin>
-                    <!-- for IT-->
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-failsafe-plugin</artifactId>
-                        <configuration>
-                            <argLine>@{failsafe.jacoco.args} -Xmx1024m</argLine>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>integration-test</goal>
-                                    <goal>verify</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-        <!-- upload code coverage report to coveralls.io-->
-        <!-- to enable coveralls locally, you need to get the repoToken from https://coveralls.io/github/apache/iotdb.
+                                                            
+                    <limit implementation="org.jacoco.report.check.Limit">
+                                                                  
+                      <counter>METHOD</counter>
+                                                                  
+                      <value>COVEREDRATIO</value>
+                                                                  
+                      <minimum>0.00</minimum>
+                                                              
+                    </limit>
+                                                            
+                    <!-- if-else, swtich etc.. >=70% -->
+                                                            
+                    <limit implementation="org.jacoco.report.check.Limit">
+                                                                  
+                      <counter>BRANCH</counter>
+                                                                  
+                      <value>COVEREDRATIO</value>
+                                                                  
+                      <minimum>0.00</minimum>
+                                                              
+                    </limit>
+                                                            
+                    <!-- class files >=95% -->
+                                                            
+                    <limit implementation="org.jacoco.report.check.Limit">
+                                                                  
+                      <counter>CLASS</counter>
+                                                                  
+                      <value>COVEREDRATIO</value>
+                                                                  
+                      <minimum>0.00</minimum>
+                                                              
+                    </limit>
+                                                        
+                  </limits>
+                                                  
+                </rule>
+                                            
+              </rules>
+                                      
+            </configuration>
+                                    
+            <executions>
+                                          
+              <!-- see https://natritmeyer.com/howto/reporting-aggregated-unit-and-integration-test-coverage-with-jacoco/-->
+                                          
+              <!-- For UT-->
+                                          
+              <execution>
+                                                
+                <id>prepare-ut</id>
+                                                
+                <goals>
+                                                      
+                  <goal>prepare-agent</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <destFile>${project.build.directory}/${project.build.finalName}-jacoco-unit-tests.exec</destFile>
+                                                      
+                  <propertyName>surefire.jacoco.args</propertyName>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                          
+              <!-- attached to Maven test phase -->
+                                          
+              <execution>
+                                                
+                <id>ut-report</id>
+                                                
+                <phase>test</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>report</goal>
+                                                      
+                  <goal>check</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <dataFile>${project.build.directory}/${project.build.finalName}-jacoco-unit-tests.exec</dataFile>
+                                                      
+                  <outputDirectory>${project.build.directory}/jacoco-unit-reports</outputDirectory>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                          
+              <!-- For IT-->
+                                          
+              <execution>
+                                                
+                <id>before-integration-test-execution</id>
+                                                
+                <phase>pre-integration-test</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>prepare-agent</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <destFile>${project.build.directory}/${project.build.finalName}-jacoco-integration-tests.exec</destFile>
+                                                      
+                  <propertyName>failsafe.jacoco.args</propertyName>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                          
+              <execution>
+                                                
+                <id>after-integration-test-execution</id>
+                                                
+                <phase>integration-test</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>report</goal>
+                                                      
+                  <goal>check</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <dataFile>${project.build.directory}/${project.build.finalName}-jacoco-integration-tests.exec</dataFile>
+                                                      
+                  <outputDirectory>${project.build.directory}/jacoco-integration-reports</outputDirectory>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                          
+              <execution>
+                                                
+                <id>merge-unit-and-integration</id>
+                                                
+                <phase>post-integration-test</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>merge</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <fileSets>
+                                                            
+                    <fileSet>
+                                                                  
+                      <directory>${project.build.directory}/</directory>
+                                                                  
+                      <includes>
+                                                                        
+                        <include>*.exec</include>
+                                                                    
+                      </includes>
+                                                              
+                    </fileSet>
+                                                        
+                  </fileSets>
+                                                      
+                  <destFile>${project.build.directory}/${project.build.finalName}-merged.exec</destFile>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                          
+              <execution>
+                                                
+                <id>create-merged-report</id>
+                                                
+                <phase>post-integration-test</phase>
+                                                
+                <goals>
+                                                      
+                  <goal>report</goal>
+                                                      
+                  <goal>check</goal>
+                                                  
+                </goals>
+                                                
+                <configuration>
+                                                      
+                  <dataFile>${project.build.directory}/${project.build.finalName}-merged.exec</dataFile>
+                                                      
+                  <outputDirectory>${project.build.directory}/jacoco-merged-reports</outputDirectory>
+                                                  
+                </configuration>
+                                            
+              </execution>
+                                      
+            </executions>
+                                
+          </plugin>
+                              
+          <!-- overwrite argLine-->
+                              
+          <plugin>
+                                    
+            <groupId>org.apache.maven.plugins</groupId>
+                                    
+            <artifactId>maven-surefire-plugin</artifactId>
+                                    
+            <configuration>
+                                          
+              <argLine>@{surefire.jacoco.args} -Xmx1024m</argLine>
+                                      
+            </configuration>
+                                
+          </plugin>
+                              
+          <!-- for IT-->
+                              
+          <plugin>
+                                    
+            <groupId>org.apache.maven.plugins</groupId>
+                                    
+            <artifactId>maven-failsafe-plugin</artifactId>
+                                    
+            <configuration>
+                                          
+              <argLine>@{failsafe.jacoco.args} -Xmx1024m</argLine>
+                                      
+            </configuration>
+                                    
+            <executions>
+                                          
+              <execution>
+                                                
+                <goals>
+                                                      
+                  <goal>integration-test</goal>
+                                                      
+                  <goal>verify</goal>
+                                                  
+                </goals>
+                                            
+              </execution>
+                                      
+            </executions>
+                                
+          </plugin>
+                          
+        </plugins>
+                    
+      </build>
+              
+    </profile>
+            
+    <!-- upload code coverage report to coveralls.io-->
+            
+    <!-- to enable coveralls locally, you need to get the repoToken from https://coveralls.io/github/apache/iotdb.
              use `mvn post-integration-test -Pcode-coverage -DrepoToken=TOKEN`-->
-        <profile>
-            <id>enforce</id>
-            <properties>
-                <enforcer.skip>false</enforcer.skip>
-            </properties>
-        </profile>
-    </profiles>
+            
+    <profile>
+                  
+      <id>enforce</id>
+                  
+      <properties>
+                        
+        <enforcer.skip>false</enforcer.skip>
+                    
+      </properties>
+              
+    </profile>
+        
+  </profiles>
+  
 </project>
diff --git a/server/pom.xml b/server/pom.xml
index 8530d66..0abc23e 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -232,6 +232,12 @@
             <artifactId>micrometer-metrics</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <!-- Experimental -->
+        <dependency>
+            <groupId>org.codehaus.janino</groupId>
+            <artifactId>janino</artifactId>
+            <version>3.1.6</version>
+        </dependency>
     </dependencies>
     <build>
         <plugins>
diff --git a/tsfile/pom.xml b/tsfile/pom.xml
index 10a39ad..3b31590 100644
--- a/tsfile/pom.xml
+++ b/tsfile/pom.xml
@@ -58,6 +58,41 @@
             <groupId>com.google.code.gson</groupId>
             <artifactId>gson</artifactId>
         </dependency>
+        <!-- https://mvnrepository.com/artifact/org.apache.calcite/calcite-linq4j -->
+        <dependency>
+            <groupId>org.apache.calcite</groupId>
+            <artifactId>calcite-linq4j</artifactId>
+            <version>1.29.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.calcite.avatica</groupId>
+            <artifactId>avatica</artifactId>
+            <version>1.8.0</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.janino</groupId>
+            <artifactId>janino</artifactId>
+            <version>3.1.6</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.janino</groupId>
+            <artifactId>janino</artifactId>
+            <version>3.1.6</version>
+            <scope>compile</scope>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/org.openjdk.jmh/jmh-core -->
+        <dependency>
+            <groupId>org.openjdk.jmh</groupId>
+            <artifactId>jmh-core</artifactId>
+            <version>1.34</version>
+        </dependency>
+        <dependency>
+            <groupId>org.openjdk.jmh</groupId>
+            <artifactId>jmh-generator-annprocess</artifactId>
+            <version>1.34</version>
+        </dependency>
     </dependencies>
     <build>
         <plugins>
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/codegen/DynamicFilter.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/codegen/DynamicFilter.java
new file mode 100644
index 0000000..4b3ef3b
--- /dev/null
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/codegen/DynamicFilter.java
@@ -0,0 +1,52 @@
+package org.apache.iotdb.tsfile.read.filter.codegen;
+
+import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.filter.factory.FilterSerializeId;
+
+import java.io.DataOutputStream;
+import java.nio.ByteBuffer;
+
+public abstract class DynamicFilter implements Filter {
+
+  protected final Filter delegate;
+
+  public DynamicFilter(Filter delegate) {
+    this.delegate = delegate;
+  }
+
+  @Override
+  public boolean satisfy(Statistics statistics) {
+    return this.delegate.satisfy(statistics);
+  }
+
+  @Override
+  public boolean satisfyStartEndTime(long startTime, long endTime) {
+    return this.delegate.satisfyStartEndTime(startTime, endTime);
+  }
+
+  @Override
+  public boolean containStartEndTime(long startTime, long endTime) {
+    return this.delegate.containStartEndTime(startTime, endTime);
+  }
+
+  @Override
+  public Filter copy() {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
+  public void serialize(DataOutputStream outputStream) {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
+  public void deserialize(ByteBuffer buffer) {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
+  public FilterSerializeId getSerializeId() {
+    throw new UnsupportedOperationException();
+  }
+}
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/codegen/GenerableFilter.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/codegen/GenerableFilter.java
new file mode 100644
index 0000000..4b7d8b6
--- /dev/null
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/codegen/GenerableFilter.java
@@ -0,0 +1,12 @@
+package org.apache.iotdb.tsfile.read.filter.codegen;
+
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+
+public interface GenerableFilter extends Filter {
+
+  boolean canGenerate();
+
+  Expression generate();
+
+}
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/codegen/Generator.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/codegen/Generator.java
new file mode 100644
index 0000000..497a2c6
--- /dev/null
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/codegen/Generator.java
@@ -0,0 +1,69 @@
+package org.apache.iotdb.tsfile.read.filter.codegen;
+
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.calcite.linq4j.tree.MethodDeclaration;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+
+import org.codehaus.commons.compiler.CompileException;
+import org.codehaus.janino.ClassBodyEvaluator;
+import org.codehaus.janino.Scanner;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.xml.stream.FactoryConfigurationError;
+import java.io.IOException;
+import java.io.StringReader;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Arrays;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
+
+public class Generator {
+
+  private static Logger logger = LoggerFactory.getLogger(Generator.class);
+
+  public static AtomicBoolean active = new AtomicBoolean(true);
+  private static AtomicLong count = new AtomicLong(1);
+
+  public static Filter generate(GenerableFilter filter) {
+    if (active.get() == false) {
+      return filter;
+    }
+    long start = System.nanoTime();
+    if (filter.canGenerate() == false) {
+      return filter;
+    }
+
+    Expression e = filter.generate();
+
+    // Build a method (public -> modifier 1)
+    MethodDeclaration m = Expressions.methodDecl(1, Boolean.TYPE, "satisfy", Arrays.asList(Expressions.parameter(Long.TYPE, "time"), Expressions.parameter(Object.class, "v")), Expressions.block(Expressions.return_(null, e)));
+
+    String s = Expressions.toString(m);
+
+    logger.debug("Generated Filter expression is: \n" + s);
+
+    String className = "DynamicFilter" + count.getAndIncrement();
+
+    String s2 = "import org.apache.iotdb.tsfile.read.filter.basic.Filter;" +
+        "" +
+        "public " + className + "(Filter delegate) {\nsuper(delegate);\n}\n\n" + s;
+
+    try {
+      Scanner scanner = new Scanner("", new StringReader(s2));
+      ClassBodyEvaluator ev = new ClassBodyEvaluator(scanner, className, DynamicFilter.class, new Class[]{Filter.class}, null);
+
+      Filter f = (Filter) ev.getClazz().getConstructors()[0].newInstance(filter);
+
+      long end = System.nanoTime();
+
+      logger.debug("Generation time took {} ms", (end - start) / 1e6);
+
+      return f;
+    } catch (CompileException | IllegalAccessException | InstantiationException | InvocationTargetException | IOException ex) {
+      ex.printStackTrace();
+      return filter;
+    }
+  }
+}
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/AndFilter.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/AndFilter.java
index 9fe6a60..b9c6501 100755
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/AndFilter.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/AndFilter.java
@@ -18,13 +18,16 @@
  */
 package org.apache.iotdb.tsfile.read.filter.operator;
 
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
 import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
 import org.apache.iotdb.tsfile.read.filter.basic.BinaryFilter;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterSerializeId;
 
 /** Both the left and right operators of AndExpression must satisfy the condition. */
-public class AndFilter extends BinaryFilter {
+public class AndFilter extends BinaryFilter implements GenerableFilter {
 
   private static final long serialVersionUID = -8212850098906044102L;
 
@@ -70,4 +73,18 @@ public class AndFilter extends BinaryFilter {
   public FilterSerializeId getSerializeId() {
     return FilterSerializeId.AND;
   }
+
+
+  @Override
+  public boolean canGenerate() {
+    return (left instanceof GenerableFilter) && (right instanceof GenerableFilter);
+  }
+
+  @Override
+  public Expression generate() {
+    if (!this.canGenerate()) {
+      throw new RuntimeException("Children are no generable filters!");
+    }
+    return Expressions.and(((GenerableFilter) left).generate(), ((GenerableFilter) right).generate());
+  }
 }
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Eq.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Eq.java
index 7a69be9..794bc46 100755
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Eq.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Eq.java
@@ -18,10 +18,14 @@
  */
 package org.apache.iotdb.tsfile.read.filter.operator;
 
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.iotdb.tsfile.exception.NotImplementedException;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
 import org.apache.iotdb.tsfile.read.filter.basic.UnaryFilter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterSerializeId;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
 
@@ -30,7 +34,7 @@ import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
  *
  * @param <T> comparable data type
  */
-public class Eq<T extends Comparable<T>> extends UnaryFilter<T> {
+public class Eq<T extends Comparable<T>> extends UnaryFilter<T> implements GenerableFilter {
 
   private static final long serialVersionUID = -6668083116644568248L;
 
@@ -94,4 +98,23 @@ public class Eq<T extends Comparable<T>> extends UnaryFilter<T> {
   public FilterSerializeId getSerializeId() {
     return FilterSerializeId.EQ;
   }
+
+  @Override
+  public boolean canGenerate() {
+    return true;
+  }
+
+  @Override
+  public Expression generate() {
+    if (filterType == FilterType.TIME_FILTER) {
+      return Expressions.equal(Expressions.parameter(Object.class, "time"), Expressions.constant(value));
+    } else if (filterType == FilterType.VALUE_FILTER) {
+      try {
+        return Expressions.call(Expressions.parameter(Object.class, "v"), Object.class.getMethod("equals", Object.class), Expressions.constant(value));
+      } catch (NoSuchMethodException e) {
+        throw new IllegalStateException();
+      }
+    }
+    throw new NotImplementedException();
+  }
 }
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Gt.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Gt.java
index 0719397..da07282 100755
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Gt.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Gt.java
@@ -18,10 +18,14 @@
  */
 package org.apache.iotdb.tsfile.read.filter.operator;
 
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.iotdb.tsfile.exception.NotImplementedException;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
 import org.apache.iotdb.tsfile.read.filter.basic.UnaryFilter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterSerializeId;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
 
@@ -30,7 +34,7 @@ import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
  *
  * @param <T> comparable data type
  */
-public class Gt<T extends Comparable<T>> extends UnaryFilter<T> {
+public class Gt<T extends Comparable<T>> extends UnaryFilter<T> implements GenerableFilter {
 
   private static final long serialVersionUID = -2088181659871608986L;
 
@@ -92,4 +96,25 @@ public class Gt<T extends Comparable<T>> extends UnaryFilter<T> {
   public FilterSerializeId getSerializeId() {
     return FilterSerializeId.GT;
   }
+
+  @Override
+  public boolean canGenerate() {
+    return true;
+  }
+
+  @Override
+  public Expression generate() {
+    if (filterType == FilterType.TIME_FILTER) {
+      return Expressions.greaterThan(Expressions.parameter(Object.class, "time"), Expressions.constant(value));
+    } else if (filterType == FilterType.VALUE_FILTER) {
+      try {
+        // return this.value.compareTo((T) v) < 0;
+        return Expressions.lessThan(Expressions.call(Expressions.box(Expressions.constant(value)), Comparable.class.getMethod("compareTo", Object.class), Expressions.parameter(Object.class, "v")),Expressions.constant(0));
+      } catch (NoSuchMethodException e) {
+        e.printStackTrace();
+        throw new IllegalStateException();
+      }
+    }
+    throw new NotImplementedException();
+  }
 }
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/GtEq.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/GtEq.java
index 4e811e1..3a3d772 100755
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/GtEq.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/GtEq.java
@@ -18,10 +18,14 @@
  */
 package org.apache.iotdb.tsfile.read.filter.operator;
 
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.iotdb.tsfile.exception.NotImplementedException;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
 import org.apache.iotdb.tsfile.read.filter.basic.UnaryFilter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterSerializeId;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
 
@@ -30,7 +34,7 @@ import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
  *
  * @param <T> comparable data type
  */
-public class GtEq<T extends Comparable<T>> extends UnaryFilter<T> {
+public class GtEq<T extends Comparable<T>> extends UnaryFilter<T> implements GenerableFilter {
 
   private static final long serialVersionUID = -2088181659871608986L;
 
@@ -92,4 +96,25 @@ public class GtEq<T extends Comparable<T>> extends UnaryFilter<T> {
   public FilterSerializeId getSerializeId() {
     return FilterSerializeId.GTEQ;
   }
+
+  @Override
+  public boolean canGenerate() {
+    return true;
+  }
+
+  @Override
+  public Expression generate() {
+    if (filterType == FilterType.TIME_FILTER) {
+      return Expressions.greaterThanOrEqual(Expressions.parameter(Object.class, "time"), Expressions.constant(value));
+    } else if (filterType == FilterType.VALUE_FILTER) {
+      try {
+        // return this.value.compareTo((T) v) < 0;
+        return Expressions.lessThanOrEqual(Expressions.call(Expressions.box(Expressions.constant(value)), Comparable.class.getMethod("compareTo", Object.class), Expressions.parameter(Object.class, "v")),Expressions.constant(0));
+      } catch (NoSuchMethodException e) {
+        e.printStackTrace();
+        throw new IllegalStateException();
+      }
+    }
+    throw new NotImplementedException();
+  }
 }
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Lt.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Lt.java
index 9c83b72..98f32d9 100755
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Lt.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Lt.java
@@ -18,10 +18,14 @@
  */
 package org.apache.iotdb.tsfile.read.filter.operator;
 
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.iotdb.tsfile.exception.NotImplementedException;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
 import org.apache.iotdb.tsfile.read.filter.basic.UnaryFilter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterSerializeId;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
 
@@ -30,7 +34,7 @@ import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
  *
  * @param <T> comparable data type
  */
-public class Lt<T extends Comparable<T>> extends UnaryFilter<T> {
+public class Lt<T extends Comparable<T>> extends UnaryFilter<T> implements GenerableFilter {
 
   private static final long serialVersionUID = -2088181659871608986L;
 
@@ -92,4 +96,24 @@ public class Lt<T extends Comparable<T>> extends UnaryFilter<T> {
   public FilterSerializeId getSerializeId() {
     return FilterSerializeId.LT;
   }
+
+  @Override
+  public boolean canGenerate() {
+    return true;
+  }
+
+  @Override
+  public Expression generate() {
+    if (filterType == FilterType.TIME_FILTER) {
+      return Expressions.lessThan(Expressions.parameter(Object.class, "time"), Expressions.constant(value));
+    } else if (filterType == FilterType.VALUE_FILTER) {
+      try {
+        // return this.value.compareTo((T) v) > 0;
+        return Expressions.greaterThan(Expressions.call(Expressions.box(Expressions.constant(value)), Comparable.class.getMethod("compareTo", Object.class), Expressions.parameter(Object.class, "v")),Expressions.constant(0));
+      } catch (NoSuchMethodException e) {
+        throw new IllegalStateException();
+      }
+    }
+    throw new NotImplementedException();
+  }
 }
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/LtEq.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/LtEq.java
index b68b1b4..a3ce54c 100755
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/LtEq.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/LtEq.java
@@ -18,10 +18,14 @@
  */
 package org.apache.iotdb.tsfile.read.filter.operator;
 
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.iotdb.tsfile.exception.NotImplementedException;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
 import org.apache.iotdb.tsfile.read.filter.basic.UnaryFilter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterSerializeId;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
 
@@ -30,7 +34,7 @@ import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
  *
  * @param <T> comparable data type
  */
-public class LtEq<T extends Comparable<T>> extends UnaryFilter<T> {
+public class LtEq<T extends Comparable<T>> extends UnaryFilter<T> implements GenerableFilter {
 
   private static final long serialVersionUID = -2088181659871608986L;
 
@@ -92,4 +96,24 @@ public class LtEq<T extends Comparable<T>> extends UnaryFilter<T> {
   public FilterSerializeId getSerializeId() {
     return FilterSerializeId.LTEQ;
   }
+
+  @Override
+  public boolean canGenerate() {
+    return true;
+  }
+
+  @Override
+  public Expression generate() {
+    if (filterType == FilterType.TIME_FILTER) {
+      return Expressions.lessThanOrEqual(Expressions.parameter(Object.class, "time"), Expressions.constant(value));
+    } else if (filterType == FilterType.VALUE_FILTER) {
+      try {
+        // return this.value.compareTo((T) v) > 0;
+        return Expressions.greaterThanOrEqual(Expressions.call(Expressions.box(Expressions.constant(value)), Comparable.class.getMethod("compareTo", Object.class), Expressions.parameter(Object.class, "v")),Expressions.constant(0));
+      } catch (NoSuchMethodException e) {
+        throw new IllegalStateException();
+      }
+    }
+    throw new NotImplementedException();
+  }
 }
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/NotEq.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/NotEq.java
index 55abda1..fe08921 100755
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/NotEq.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/NotEq.java
@@ -18,10 +18,14 @@
  */
 package org.apache.iotdb.tsfile.read.filter.operator;
 
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.iotdb.tsfile.exception.NotImplementedException;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
 import org.apache.iotdb.tsfile.read.filter.basic.UnaryFilter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterSerializeId;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
 
@@ -30,7 +34,7 @@ import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
  *
  * @param <T> comparable data type
  */
-public class NotEq<T extends Comparable<T>> extends UnaryFilter<T> {
+public class NotEq<T extends Comparable<T>> extends UnaryFilter<T> implements GenerableFilter {
 
   private static final long serialVersionUID = 2574090797476500965L;
 
@@ -94,4 +98,23 @@ public class NotEq<T extends Comparable<T>> extends UnaryFilter<T> {
   public FilterSerializeId getSerializeId() {
     return FilterSerializeId.NEQ;
   }
+
+  @Override
+  public boolean canGenerate() {
+    return true;
+  }
+
+  @Override
+  public Expression generate() {
+    if (filterType == FilterType.TIME_FILTER) {
+      return Expressions.notEqual(Expressions.parameter(Object.class, "time"), Expressions.constant(value));
+    } else if (filterType == FilterType.VALUE_FILTER) {
+      try {
+        return Expressions.negate(Expressions.call(Expressions.parameter(Object.class, "v"), Object.class.getMethod("equals", Object.class), Expressions.constant(value)));
+      } catch (NoSuchMethodException e) {
+        throw new IllegalStateException();
+      }
+    }
+    throw new NotImplementedException();
+  }
 }
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/OrFilter.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/OrFilter.java
index 32e4593..cc0c7ae 100755
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/OrFilter.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/OrFilter.java
@@ -18,15 +18,18 @@
  */
 package org.apache.iotdb.tsfile.read.filter.operator;
 
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
 import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
 import org.apache.iotdb.tsfile.read.filter.basic.BinaryFilter;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterSerializeId;
 
 import java.io.Serializable;
 
 /** Either of the left and right operators of AndExpression must satisfy the condition. */
-public class OrFilter extends BinaryFilter implements Serializable {
+public class OrFilter extends BinaryFilter implements Serializable, GenerableFilter {
 
   private static final long serialVersionUID = -968055896528472694L;
 
@@ -72,4 +75,17 @@ public class OrFilter extends BinaryFilter implements Serializable {
   public FilterSerializeId getSerializeId() {
     return FilterSerializeId.OR;
   }
+
+  @Override
+  public boolean canGenerate() {
+    return (left instanceof GenerableFilter) && (right instanceof GenerableFilter);
+  }
+
+  @Override
+  public Expression generate() {
+    if (!this.canGenerate()) {
+      throw new RuntimeException("Children are no generable filters!");
+    }
+    return Expressions.or(((GenerableFilter) left).generate(), ((GenerableFilter) right).generate());
+  }
 }
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Regexp.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Regexp.java
index 646b51b..703114e 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Regexp.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/operator/Regexp.java
@@ -18,8 +18,11 @@
  */
 package org.apache.iotdb.tsfile.read.filter.operator;
 
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
 import org.apache.iotdb.tsfile.file.metadata.statistics.Statistics;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterSerializeId;
 import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
 import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
@@ -27,6 +30,7 @@ import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.util.Arrays;
 import java.util.Objects;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
@@ -36,7 +40,7 @@ import java.util.regex.PatternSyntaxException;
  *
  * @param <T> comparable data type
  */
-public class Regexp<T extends Comparable<T>> implements Filter {
+public class Regexp<T extends Comparable<T>> implements Filter, GenerableFilter {
 
   protected String value;
 
@@ -124,4 +128,18 @@ public class Regexp<T extends Comparable<T>> implements Filter {
   public FilterSerializeId getSerializeId() {
     return FilterSerializeId.REGEXP;
   }
+
+  @Override
+  public boolean canGenerate() {
+    return true;
+  }
+
+  @Override
+  public Expression generate() {
+    // Simply access the delegate
+    return Expressions.call(Expressions.parameter(Filter.class, "delegate"), "satisfy", Arrays.asList(
+        Expressions.parameter(Long.TYPE, "time"),
+        Expressions.parameter(Object.class, "v")
+    ));
+  }
 }
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/series/FileSeriesReader.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/series/FileSeriesReader.java
index 9318839..6a7e46d 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/series/FileSeriesReader.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/series/FileSeriesReader.java
@@ -24,6 +24,8 @@ import org.apache.iotdb.tsfile.file.metadata.IChunkMetadata;
 import org.apache.iotdb.tsfile.read.common.Chunk;
 import org.apache.iotdb.tsfile.read.controller.IChunkLoader;
 import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
+import org.apache.iotdb.tsfile.read.filter.codegen.Generator;
 import org.apache.iotdb.tsfile.read.reader.chunk.AlignedChunkReader;
 import org.apache.iotdb.tsfile.read.reader.chunk.ChunkReader;
 
@@ -39,7 +41,8 @@ public class FileSeriesReader extends AbstractFileSeriesReader {
 
   public FileSeriesReader(
       IChunkLoader chunkLoader, List<IChunkMetadata> chunkMetadataList, Filter filter) {
-    super(chunkLoader, chunkMetadataList, filter);
+    super(chunkLoader, chunkMetadataList, Generator.generate((GenerableFilter) filter));
+//    super(chunkLoader, chunkMetadataList, filter);
   }
 
   @Override
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/read/filter/operator/GeneratorTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/read/filter/operator/GeneratorTest.java
new file mode 100644
index 0000000..37d5433
--- /dev/null
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/read/filter/operator/GeneratorTest.java
@@ -0,0 +1,87 @@
+package org.apache.iotdb.tsfile.read.filter.operator;
+
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.filter.codegen.GenerableFilter;
+import org.apache.iotdb.tsfile.read.filter.codegen.Generator;
+import org.apache.iotdb.tsfile.read.filter.factory.FilterType;
+import org.codehaus.commons.compiler.CompileException;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class GeneratorTest {
+
+  @Test
+  public void generateEq() throws CompileException, IOException, InstantiationException, IllegalAccessException, InvocationTargetException {
+    Eq<Integer> timeFilter = new Eq<>(5, FilterType.TIME_FILTER);
+
+    Filter f = Generator.generate(timeFilter);
+
+
+    assertTrue(f.satisfy(5L, null));
+    assertFalse(f.satisfy(4L, null));
+  }
+
+  @Test
+  public void generateGt() throws CompileException, IOException, InstantiationException, IllegalAccessException, InvocationTargetException {
+    Gt<Integer> timeFilter = new Gt<>(5, FilterType.TIME_FILTER);
+
+    Filter f = Generator.generate(timeFilter);
+
+
+    assertFalse(f.satisfy(5L, null));
+    assertTrue(f.satisfy(4L, null));
+  }
+
+  @Test
+  public void generateAnd() throws CompileException, IOException, InstantiationException, IllegalAccessException, InvocationTargetException {
+    GenerableFilter filter = new AndFilter(new Eq<>(5, FilterType.TIME_FILTER), new Eq<>(6, FilterType.VALUE_FILTER));
+
+    Filter f = Generator.generate(filter);
+
+
+    assertTrue(f.satisfy(5L, 6));
+    assertFalse(f.satisfy(4L, 4));
+  }
+
+  @Test
+  public void generateRegex() throws CompileException, IOException, InstantiationException, IllegalAccessException, InvocationTargetException {
+    GenerableFilter filter = new Regexp<>(".*", FilterType.VALUE_FILTER);
+
+    Filter f = Generator.generate(filter);
+
+
+    assertTrue(f.satisfy(5L, "a"));
+  }
+
+  @Test
+  public void generateComplex() throws CompileException, IOException, InstantiationException, IllegalAccessException, InvocationTargetException {
+    GenerableFilter filter = new AndFilter(
+        new AndFilter(
+            new Gt<>(50, FilterType.TIME_FILTER),
+            new Lt<>(100, FilterType.TIME_FILTER)
+        ),
+        new OrFilter(
+            new AndFilter(
+                new Gt<>(4, FilterType.VALUE_FILTER),
+                new Lt<>(6, FilterType.VALUE_FILTER)
+            ),
+            new AndFilter(
+                new Gt<>(9, FilterType.VALUE_FILTER),
+                new Lt<>(13, FilterType.VALUE_FILTER)
+            )
+        )
+    );
+
+    Filter f = Generator.generate(filter);
+
+
+    assertTrue(f.satisfy(51L, 5));
+    assertFalse(f.satisfy(51L, 4));
+    assertFalse(f.satisfy(50L, 5));
+  }
+}
\ No newline at end of file
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/PerformTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/PerformTest.java
new file mode 100644
index 0000000..c8732b5
--- /dev/null
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/PerformTest.java
@@ -0,0 +1,24 @@
+package org.apache.iotdb.tsfile.write;
+
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+
+public class PerformTest {
+
+    @Benchmark
+    public void test() {
+      // todo
+    }
+
+    public static void main(String[] args) throws RunnerException {
+      Options opt = new OptionsBuilder()
+          .include(PerformTest.class.getSimpleName())
+          .build();
+
+      new Runner(opt).run();
+    }
+
+}
diff --git a/tsfile/src/test/java/org/apache/iotdb/tsfile/write/TsFilterPerformanceTest.java b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/TsFilterPerformanceTest.java
new file mode 100644
index 0000000..7d210a3
--- /dev/null
+++ b/tsfile/src/test/java/org/apache/iotdb/tsfile/write/TsFilterPerformanceTest.java
@@ -0,0 +1,410 @@
+/*
+ * 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.tsfile.write;
+
+import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.read.TsFileReader;
+import org.apache.iotdb.tsfile.read.TsFileSequenceReader;
+import org.apache.iotdb.tsfile.read.common.Path;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+import org.apache.iotdb.tsfile.read.expression.IExpression;
+import org.apache.iotdb.tsfile.read.expression.QueryExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.BinaryExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.GlobalTimeExpression;
+import org.apache.iotdb.tsfile.read.expression.impl.SingleSeriesExpression;
+import org.apache.iotdb.tsfile.read.filter.TimeFilter;
+import org.apache.iotdb.tsfile.read.filter.ValueFilter;
+import org.apache.iotdb.tsfile.read.filter.basic.Filter;
+import org.apache.iotdb.tsfile.read.filter.codegen.Generator;
+import org.apache.iotdb.tsfile.read.filter.factory.FilterFactory;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
+import org.apache.iotdb.tsfile.utils.FilePathUtils;
+import org.apache.iotdb.tsfile.utils.TsFileGeneratorForTest;
+import org.apache.iotdb.tsfile.write.record.TSRecord;
+import org.apache.iotdb.tsfile.write.record.datapoint.FloatDataPoint;
+import org.apache.iotdb.tsfile.write.record.datapoint.IntDataPoint;
+import org.apache.iotdb.tsfile.write.schema.UnaryMeasurementSchema;
+import org.junit.Assert;
+import org.junit.Test;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.Warmup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+@State(Scope.Benchmark)
+public class TsFilterPerformanceTest {
+
+  private static Logger logger = LoggerFactory.getLogger(TsFilterPerformanceTest.class);
+
+  public static int runs = 1;
+
+  TsFileWriter writer = null;
+  String fileName = TsFileGeneratorForTest.getTestTsFilePath("root.sg1", 0, 0, 1);
+  boolean closed = false;
+
+  String getFilename() {
+    String filePath =
+        String.format(
+            "/tmp/root.sg1/0/0/",
+            "root.sg1",
+            0,
+            0);
+    String fileName =
+        100
+            + FilePathUtils.FILE_NAME_SEPARATOR
+            + 1
+            + "-0-0.tsfile";
+    return filePath.concat(fileName);
+  }
+
+  /**
+   * Benchmark                                     Mode  Cnt      Score     Error  Units
+   * TsFilterPerformanceTest.getSimpleUnoptimized  avgt   15  10699,176 ± 511,309  ms/op
+   * @throws IOException
+   */
+  @Benchmark
+  @BenchmarkMode(Mode.AverageTime)
+  @OutputTimeUnit(TimeUnit.MILLISECONDS)
+  @Warmup(iterations = 3)
+  @Fork(3)
+  public void getSimpleUnoptimized() throws IOException {
+    List<Filter> filters = getSimpleFilters();
+    runTests(filters, false);
+  }
+
+  /**
+   * Benchmark                                   Mode  Cnt      Score     Error  Units
+   * TsFilterPerformanceTest.getSimpleOptimized  avgt   15  11084,838 ± 331,142  ms/op
+   * @throws IOException
+   */
+  @Benchmark
+  @BenchmarkMode(Mode.AverageTime)
+  @OutputTimeUnit(TimeUnit.MILLISECONDS)
+  @Warmup(iterations = 3)
+  @Fork(3)
+  public void getSimpleOptimized() throws IOException {
+    List<Filter> filters = getSimpleFilters();
+    runTests(filters, true);
+  }
+
+
+  /**
+   * Benchmark                                       Mode  Cnt      Score     Error  Units
+   * TsFilterPerformanceTest.getStandardUnoptimized  avgt   15  10345,496 ± 571,557  ms/op
+   * @throws IOException
+   */
+  @Benchmark
+  @BenchmarkMode(Mode.AverageTime)
+  @OutputTimeUnit(TimeUnit.MILLISECONDS)
+  @Warmup(iterations = 3)
+  @Fork(3)
+  public void getStandardUnoptimized() throws IOException {
+    List<Filter> filters = getStandardFilters();
+    runTests(filters, false);
+  }
+
+  /**
+   * Benchmark                                     Mode  Cnt     Score     Error  Units
+   * TsFilterPerformanceTest.getStandardOptimized  avgt   15  9864,581 ± 591,591  ms/op
+   * -> 4.6%
+   * @throws IOException
+   */
+  @Benchmark
+  @BenchmarkMode(Mode.AverageTime)
+  @OutputTimeUnit(TimeUnit.MILLISECONDS)
+  @Warmup(iterations = 3)
+  @Fork(3)
+  public void getStandardOptimized() throws IOException {
+    List<Filter> filters = getStandardFilters();
+    runTests(filters, true);
+  }
+
+  @Benchmark
+  @BenchmarkMode(Mode.AverageTime)
+  @OutputTimeUnit(TimeUnit.MILLISECONDS)
+  @Warmup(iterations = 3)
+  @Fork(3)
+  public void getComplexUnoptimized() throws IOException {
+    List<Filter> filters = getComplexFilters();
+    runTests(filters, false);
+  }
+
+  @Test
+  public void generate() throws IOException, WriteProcessException {
+    String filename = getFilename();
+
+    System.out.println("Writing to " + filename);
+    File f = new File(filename);
+    if (!f.getParentFile().exists()) {
+      Assert.assertTrue(f.getParentFile().mkdirs());
+    }
+    writer = new TsFileWriter(f);
+    registerTimeseries();
+
+    for (long t = 0; t <= 100_000_000; t++) {
+      if (t % 100 == 0) {
+        System.out.println(t);
+      }
+      // normal
+      TSRecord record = new TSRecord(t, "d1");
+      record.addTuple(new FloatDataPoint("s1", (float) (100.0 * Math.random())));
+      record.addTuple(new IntDataPoint("s2", (int) (100.0 * Math.random())));
+      writer.write(record);
+    }
+
+    writer.close();
+  }
+
+
+  /**
+   * Without optimization: 10798.055595900001 ms
+   * With: 9907.020887499999
+   * Improvement ~ 8%
+   */
+  @Test
+  public void readMany() throws IOException {
+    List<List<Filter>> scenarios = Arrays.asList(
+        getSimpleFilters(),
+        getStandardFilters(),
+        getComplexFilters()
+    );
+
+    ArrayList<Double> results = new ArrayList<>();
+
+    for (int scenarioCount = 0; scenarioCount < scenarios.size(); scenarioCount++) {
+      System.out.println("Starting Scenario " + scenarioCount);
+      List<Filter> filter = scenarios.get(scenarioCount);
+
+      // First, no optimizer
+      double noOptimizer = runTests(filter, false);
+      double optimizer = runTests(filter, true);
+      double improvement = 100.0 * (1 - optimizer / noOptimizer);
+
+      System.out.println("==========================");
+      System.out.println("Scenario " + scenarioCount);
+      System.out.println("==========================");
+      System.out.printf("Duration (no optimizer): %.2f ms\n", noOptimizer);
+      System.out.printf("Duration (optimizer): %.2f ms\n", optimizer);
+      System.out.printf("Improvement: %.2f %%\n\n", improvement);
+
+      results.add(improvement);
+    }
+
+    System.out.println("==========================");
+    System.out.println("Final Result");
+    System.out.println("==========================");
+    for (Double result : results) {
+      System.out.printf("Improvement: %.2f %%\n", result);
+    }
+    System.out.println("==========================");
+  }
+
+  private double runTests(List<Filter> filter, boolean optimizer) throws IOException {
+    Generator.active.set(optimizer);
+    long start = System.nanoTime();
+    for (int i = 1; i <= runs; i++) {
+      logger.info("Round " + i);
+      read(filter);
+    }
+    long end = System.nanoTime();
+
+    double durationMs = (end - start) / 1e6;
+
+    return durationMs;
+  }
+
+  private List<Filter> getSimpleFilters() {
+    Filter filter = TimeFilter.lt(50_000_000);
+    Filter filter2 = ValueFilter.gt(50);
+    Filter filter3 = TimeFilter.ltEq(50_000_000);
+
+    List<Filter> filters = Arrays.asList(
+        filter, filter2, filter3
+    );
+    return filters;
+  }
+
+  private List<Filter> getStandardFilters() {
+    Filter filter = TimeFilter.lt(50_000_000);
+    Filter filter2 = FilterFactory.and(ValueFilter.gt(25), ValueFilter.lt(75));
+    Filter filter3 =
+        FilterFactory.and(TimeFilter.gtEq(10_000_000), TimeFilter.ltEq(40_000_000));
+
+    List<Filter> filters = Arrays.asList(
+        filter, filter2, filter3
+    );
+    return filters;
+  }
+
+  private List<Filter> getComplexFilters() {
+    Filter filter = FilterFactory.and(TimeFilter.gt(10_000_000), TimeFilter.lt(90_000_000));
+    Filter filter2 = FilterFactory.or(FilterFactory.or(
+            FilterFactory.and(ValueFilter.gt(15), ValueFilter.lt(30)),
+            FilterFactory.and(ValueFilter.gt(45), ValueFilter.lt(60))
+        ),
+        FilterFactory.and(ValueFilter.gt(70), ValueFilter.lt(90))
+    );
+    Filter filter3 =
+        FilterFactory.or(
+            FilterFactory.and(TimeFilter.gtEq(10_000_000), TimeFilter.ltEq(20_000_000)),
+            FilterFactory.and(TimeFilter.gtEq(30_000_000), TimeFilter.ltEq(40_000_000))
+        );
+
+    List<Filter> filters = Arrays.asList(
+        filter, filter2, filter3
+    );
+    return filters;
+  }
+
+  public void read(List<Filter> filters) throws IOException {
+    TsFileSequenceReader fileSequenceReader = new TsFileSequenceReader(getFilename());
+    TsFileReader fileReader = new TsFileReader(fileSequenceReader);
+
+    IExpression IExpression =
+        BinaryExpression.or(
+            BinaryExpression.and(
+                new SingleSeriesExpression(new Path("d1", "s1"), filters.get(0)),
+                new SingleSeriesExpression(new Path("d1", "s2"), filters.get(1))),
+            new GlobalTimeExpression(filters.get(2)));
+
+    QueryExpression queryExpression =
+        QueryExpression.create()
+            .addSelectedPath(new Path("d1", "s1"))
+            .addSelectedPath(new Path("d1", "s2"))
+            .setExpression(IExpression);
+
+    fileSequenceReader.getAllDevices();
+
+    logger.debug("Starting query...");
+    QueryDataSet dataSet = fileReader.query(queryExpression);
+
+
+    logger.debug("Query done, start iteration...");
+
+    int count = 0;
+    while (dataSet.hasNext()) {
+      RowRecord rowRecord = dataSet.next();
+      count++;
+    }
+
+    logger.debug("Iterartion done, " + count + " points");
+  }
+
+  private void registerTimeseries() {
+    // register nonAligned timeseries "d1.s1","d1.s2","d1.s3"
+    try {
+      writer.registerTimeseries(
+          new Path("d1"),
+          new UnaryMeasurementSchema(
+              "s1", TSDataType.FLOAT, TSEncoding.RLE, CompressionType.SNAPPY));
+    } catch (WriteProcessException e) {
+      e.printStackTrace();
+      fail(e.getMessage());
+    }
+    try {
+      writer.registerTimeseries(
+          new Path("d1"),
+          new UnaryMeasurementSchema(
+              "s1", TSDataType.FLOAT, TSEncoding.RLE, CompressionType.SNAPPY));
+    } catch (WriteProcessException e) {
+      Assert.assertEquals("given nonAligned timeseries d1.s1 has been registered.", e.getMessage());
+    }
+    try {
+      List<UnaryMeasurementSchema> schemas = new ArrayList<>();
+      schemas.add(
+          new UnaryMeasurementSchema(
+              "s1", TSDataType.FLOAT, TSEncoding.RLE, CompressionType.SNAPPY));
+      writer.registerAlignedTimeseries(new Path("d1"), schemas);
+    } catch (WriteProcessException e) {
+      Assert.assertEquals(
+          "given device d1 has been registered for nonAligned timeseries.", e.getMessage());
+    }
+    List<UnaryMeasurementSchema> schemas = new ArrayList<>();
+    schemas.add(
+        new UnaryMeasurementSchema("s2", TSDataType.INT32, TSEncoding.RLE, CompressionType.SNAPPY));
+    schemas.add(
+        new UnaryMeasurementSchema("s3", TSDataType.INT32, TSEncoding.RLE, CompressionType.SNAPPY));
+    writer.registerTimeseries(new Path("d1"), schemas);
+
+    // Register aligned timeseries "d2.s1" , "d2.s2", "d2.s3"
+    try {
+      List<UnaryMeasurementSchema> measurementSchemas = new ArrayList<>();
+      measurementSchemas.add(new UnaryMeasurementSchema("s1", TSDataType.TEXT, TSEncoding.PLAIN));
+      measurementSchemas.add(new UnaryMeasurementSchema("s2", TSDataType.TEXT, TSEncoding.PLAIN));
+      measurementSchemas.add(new UnaryMeasurementSchema("s3", TSDataType.TEXT, TSEncoding.PLAIN));
+      writer.registerAlignedTimeseries(new Path("d2"), measurementSchemas);
+    } catch (WriteProcessException e) {
+      e.printStackTrace();
+      fail(e.getMessage());
+    }
+    try {
+      List<UnaryMeasurementSchema> measurementSchemas = new ArrayList<>();
+      measurementSchemas.add(new UnaryMeasurementSchema("s4", TSDataType.TEXT, TSEncoding.PLAIN));
+      writer.registerAlignedTimeseries(new Path("d2"), measurementSchemas);
+    } catch (WriteProcessException e) {
+      Assert.assertEquals(
+          "given device d2 has been registered for aligned timeseries and should not be expanded.",
+          e.getMessage());
+    }
+    try {
+      writer.registerTimeseries(
+          new Path("d2"),
+          new UnaryMeasurementSchema(
+              "s5", TSDataType.INT32, TSEncoding.RLE, CompressionType.SNAPPY));
+    } catch (WriteProcessException e) {
+      Assert.assertEquals(
+          "given device d2 has been registered for aligned timeseries.", e.getMessage());
+    }
+
+    /*try {
+      for (int i = 2; i < 3; i++) {
+        writer.registerTimeseries(
+            new Path("d" + i, "s1"),
+            new UnaryMeasurementSchema(
+                "s1", TSDataType.FLOAT, TSEncoding.RLE, CompressionType.SNAPPY));
+      }
+    } catch (WriteProcessException e) {
+      e.printStackTrace();
+      fail(e.getMessage());
+    }*/
+  }
+
+}