You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2020/07/02 06:38:07 UTC

[incubator-iotdb] 01/01: set thrift and antlr as two independent module

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

hxd pushed a commit to branch seperate_thrift_and_antlr
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 2ffc6cf32921d5770dd9627f8df40ec149aea2a5
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Thu Jul 2 14:37:40 2020 +0800

    set thrift and antlr as two independent module
---
 README.md                                          |    2 +-
 README_ZH.md                                       |    2 +-
 antlr/pom.xml                                      |   55 +
 {service-rpc => antlr}/rpc-changelist.md           |    0
 .../org/apache/iotdb/db/qp/strategy/SqlBase.g4     | 1194 ++++++++++++++++++++
 antlr/src/pypi/README.md                           |   61 +
 antlr/src/pypi/setup.py                            |   55 +
 client-py/compile.bat                              |    2 +-
 client-py/compile.sh                               |    2 +-
 client-py/readme.md                                |    2 +-
 client-py/src/client_example.py                    |    2 +-
 docs/Development/ContributeGuide.md                |    6 +-
 docs/SystemDesign/Client/RPC.md                    |   11 +-
 docs/SystemDesign/QueryEngine/Planner.md           |    6 +-
 .../Client/Programming - Other Languages.md        |    2 +-
 docs/UserGuide/Server/Download.md                  |    2 +-
 docs/zh/Development/ContributeGuide.md             |    4 +-
 docs/zh/SystemDesign/Client/RPC.md                 |   12 +-
 docs/zh/SystemDesign/QueryEngine/Planner.md        |    4 +-
 .../Client/Programming - Other Languages.md        |    2 +-
 jdbc/src/main/feature/feature.xml                  |    1 +
 .../iotdb/jdbc/manualtest/CompleteFutureTest.java  |   31 +
 .../manualtest/JDBCRegisterManyTimeSeries.java     |   75 ++
 pom.xml                                            |    2 +
 server/pom.xml                                     |   21 +-
 service-rpc/pom.xml                                |  108 +-
 .../apache/iotdb/session/CompleteFutureTest.java   |   31 +
 site/pom.xml                                       |    4 +-
 {service-rpc => thrift}/pom.xml                    |   69 +-
 {service-rpc => thrift}/rpc-changelist.md          |    0
 thrift/src/main/thrift/cluster.thrift              |  387 +++++++
 thrift/src/main/thrift/rpc.thrift                  |  312 +++++
 thrift/src/main/thrift/sync.thrift                 |   50 +
 thrift/src/pypi/README.md                          |   61 +
 thrift/src/pypi/setup.py                           |   55 +
 35 files changed, 2423 insertions(+), 210 deletions(-)

diff --git a/README.md b/README.md
index 38d652b..2b60983 100644
--- a/README.md
+++ b/README.md
@@ -129,7 +129,7 @@ Under the root path of incubator-iotdb:
 
 Then the binary version (including both server and cli) can be found at **distribution/target/apache-iotdb-{project.version}-incubating-bin.zip**
 
-> NOTE: Directories "service-rpc/target/generated-sources/thrift" and "server/target/generated-sources/antlr4" need to be added to sources roots to avoid compilation errors in the IDE.
+> NOTE: Directories "thrift/target/generated-sources/thrift" and "antlr/target/generated-sources/antlr4" need to be added to sources roots to avoid compilation errors in the IDE.
 
 ### Configurations
 
diff --git a/README_ZH.md b/README_ZH.md
index 4c4566f..07987f3 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -126,7 +126,7 @@ git checkout release/x.x.x
 
 执行完成之后,可以在**distribution/target/apache-iotdb-{project.version}-incubating-bin.zip**找到编译完成的二进制版本(包括服务器和客户端)
 
-> 注意:"service-rpc/target/generated-sources/thrift" 和 "server/target/generated-sources/antlr4" 目录需要添加到源代码根中,以免在 IDE 中产生编译错误。
+> 注意:"thrift/target/generated-sources/thrift" 和 "antlr/target/generated-sources/antlr4" 目录需要添加到源代码根中,以免在 IDE 中产生编译错误。
 
 ### 配置
 
diff --git a/antlr/pom.xml b/antlr/pom.xml
new file mode 100644
index 0000000..3d9da5f
--- /dev/null
+++ b/antlr/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.iotdb</groupId>
+        <artifactId>iotdb-parent</artifactId>
+        <version>0.11.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>iotdb-antlr</artifactId>
+    <name>sql-antlr</name>
+    <description>Antlr parser for IoTDB.</description>
+    <dependencies>
+        <dependency>
+            <groupId>org.antlr</groupId>
+            <artifactId>antlr4-runtime</artifactId>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.antlr</groupId>
+                <artifactId>antlr4-maven-plugin</artifactId>
+                <version>${antlr4.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>antlr4</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/service-rpc/rpc-changelist.md b/antlr/rpc-changelist.md
similarity index 100%
copy from service-rpc/rpc-changelist.md
copy to antlr/rpc-changelist.md
diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
new file mode 100644
index 0000000..e9ae14e
--- /dev/null
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
@@ -0,0 +1,1194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+grammar SqlBase;
+
+singleStatement
+    : statement EOF
+    ;
+
+statement
+    : CREATE TIMESERIES fullPath alias? WITH attributeClauses #createTimeseries
+    | DELETE TIMESERIES prefixPath (COMMA prefixPath)* #deleteTimeseries
+    | ALTER TIMESERIES fullPath alterClause #alterTimeseries
+    | INSERT INTO fullPath insertColumnSpec VALUES insertValuesSpec #insertStatement
+    | UPDATE prefixPath setClause whereClause? #updateStatement
+    | DELETE FROM prefixPath (COMMA prefixPath)* (whereClause)? #deleteStatement
+    | SET STORAGE GROUP TO fullPath #setStorageGroup
+    | DELETE STORAGE GROUP fullPath (COMMA fullPath)* #deleteStorageGroup
+    | SHOW METADATA #showMetadata // not support yet
+    | DESCRIBE prefixPath #describePath // not support yet
+    | CREATE INDEX ON fullPath USING function=ID indexWithClause? whereClause? #createIndex //not support yet
+    | DROP INDEX function=ID ON fullPath #dropIndex //not support yet
+    | MERGE #merge
+    | FLUSH prefixPath? (COMMA prefixPath)* (booleanClause)?#flush
+    | FULL MERGE #fullMerge
+    | CLEAR CACHE #clearcache
+    | CREATE USER userName=ID password=STRING_LITERAL #createUser
+    | ALTER USER userName=(ROOT|ID) SET PASSWORD password=STRING_LITERAL #alterUser
+    | DROP USER userName=ID #dropUser
+    | CREATE ROLE roleName=ID #createRole
+    | DROP ROLE roleName=ID #dropRole
+    | GRANT USER userName=ID PRIVILEGES privileges ON prefixPath #grantUser
+    | GRANT ROLE roleName=ID PRIVILEGES privileges ON prefixPath #grantRole
+    | REVOKE USER userName=ID PRIVILEGES privileges ON prefixPath #revokeUser
+    | REVOKE ROLE roleName=ID PRIVILEGES privileges ON prefixPath #revokeRole
+    | GRANT roleName=ID TO userName=ID #grantRoleToUser
+    | REVOKE roleName = ID FROM userName = ID #revokeRoleFromUser
+    | LOAD TIMESERIES (fileName=STRING_LITERAL) prefixPath #loadStatement
+    | GRANT WATERMARK_EMBEDDING TO rootOrId (COMMA rootOrId)* #grantWatermarkEmbedding
+    | REVOKE WATERMARK_EMBEDDING FROM rootOrId (COMMA rootOrId)* #revokeWatermarkEmbedding
+    | LIST USER #listUser
+    | LIST ROLE #listRole
+    | LIST PRIVILEGES USER username=ID ON prefixPath #listPrivilegesUser
+    | LIST PRIVILEGES ROLE roleName=ID ON prefixPath #listPrivilegesRole
+    | LIST USER PRIVILEGES username = ID #listUserPrivileges
+    | LIST ROLE PRIVILEGES roleName = ID #listRolePrivileges
+    | LIST ALL ROLE OF USER username = ID #listAllRoleOfUser
+    | LIST ALL USER OF ROLE roleName = ID #listAllUserOfRole
+    | SET TTL TO path=prefixPath time=INT #setTTLStatement
+    | UNSET TTL TO path=prefixPath #unsetTTLStatement
+    | SHOW TTL ON prefixPath (COMMA prefixPath)* #showTTLStatement
+    | SHOW ALL TTL #showAllTTLStatement
+    | SHOW FLUSH TASK INFO #showFlushTaskInfo
+    | SHOW DYNAMIC PARAMETER #showDynamicParameter
+    | SHOW VERSION #showVersion
+    | SHOW LATEST? TIMESERIES prefixPath? showWhereClause? limitClause? #showTimeseries
+    | SHOW STORAGE GROUP #showStorageGroup
+    | SHOW CHILD PATHS prefixPath? #showChildPaths
+    | SHOW DEVICES prefixPath? #showDevices
+    | SHOW MERGE #showMergeStatus
+    | TRACING ON #tracingOn
+    | TRACING OFF #tracingOff
+    | COUNT TIMESERIES prefixPath? (GROUP BY LEVEL OPERATOR_EQ INT)? #countTimeseries
+    | COUNT NODES prefixPath LEVEL OPERATOR_EQ INT #countNodes
+    | LOAD CONFIGURATION (MINUS GLOBAL)? #loadConfigurationStatement
+    | LOAD STRING_LITERAL autoCreateSchema? #loadFiles
+    | REMOVE STRING_LITERAL #removeFile
+    | MOVE STRING_LITERAL STRING_LITERAL #moveFile
+    | DELETE PARTITION prefixPath INT(COMMA INT)* #deletePartition
+    | CREATE SNAPSHOT FOR SCHEMA #createSnapshot
+    | SELECT INDEX func=ID //not support yet
+    LR_BRACKET
+    p1=fullPath COMMA p2=fullPath COMMA n1=timeValue COMMA n2=timeValue COMMA
+    epsilon=constant (COMMA alpha=constant COMMA beta=constant)?
+    RR_BRACKET
+    fromClause
+    whereClause?
+    specialClause? #selectIndexStatement
+    | SELECT selectElements
+    fromClause
+    whereClause?
+    specialClause? #selectStatement
+    ;
+
+selectElements
+    : functionCall (COMMA functionCall)* #functionElement
+    | suffixPath (COMMA suffixPath)* #selectElement
+    | STRING_LITERAL (COMMA STRING_LITERAL)* #selectConstElement
+    | lastClause #lastElement
+    ;
+
+functionCall
+    : functionName LR_BRACKET suffixPath RR_BRACKET
+    ;
+
+functionName
+    : MIN_TIME
+    | MAX_TIME
+    | MIN_VALUE
+    | MAX_VALUE
+    | COUNT
+    | AVG
+    | FIRST_VALUE
+    | SUM
+    | LAST_VALUE
+    ;
+
+lastClause
+    : LAST suffixPath (COMMA suffixPath)*
+    ;
+
+alias
+    : LR_BRACKET ID RR_BRACKET
+    ;
+
+alterClause
+    : RENAME beforeName=ID TO currentName=ID
+    | SET property (COMMA property)*
+    | DROP ID (COMMA ID)*
+    | ADD TAGS property (COMMA property)*
+    | ADD ATTRIBUTES property (COMMA property)*
+    | UPSERT aliasClause tagClause attributeClause
+    ;
+
+aliasClause
+    : (ALIAS OPERATOR_EQ ID)?
+    ;
+
+attributeClauses
+    : DATATYPE OPERATOR_EQ dataType COMMA ENCODING OPERATOR_EQ encoding
+    (COMMA (COMPRESSOR | COMPRESSION) OPERATOR_EQ compressor)?
+    (COMMA property)*
+    tagClause
+    attributeClause
+    ;
+
+compressor
+    : UNCOMPRESSED
+    | SNAPPY
+    | GZIP
+    | LZO
+    | SDT
+    | PAA
+    | PLA
+    ;
+
+attributeClause
+    : (ATTRIBUTES LR_BRACKET property (COMMA property)* RR_BRACKET)?
+    ;
+
+tagClause
+    : (TAGS LR_BRACKET property (COMMA property)* RR_BRACKET)?
+    ;
+
+setClause
+    : SET setCol (COMMA setCol)*
+    ;
+
+whereClause
+    : WHERE orExpression
+    ;
+
+showWhereClause
+    : WHERE (property | containsExpression)
+    ;
+containsExpression
+    : name=ID OPERATOR_CONTAINS value=propertyValue
+    ;
+
+orExpression
+    : andExpression (OPERATOR_OR andExpression)*
+    ;
+
+andExpression
+    : predicate (OPERATOR_AND predicate)*
+    ;
+
+predicate
+    : (TIME | TIMESTAMP | suffixPath | fullPath) comparisonOperator constant
+    | (TIME | TIMESTAMP | suffixPath | fullPath) inClause
+    | OPERATOR_NOT? LR_BRACKET orExpression RR_BRACKET
+    ;
+
+inClause
+    : OPERATOR_NOT? OPERATOR_IN LR_BRACKET constant (COMMA constant)* RR_BRACKET
+    ;
+
+fromClause
+    : FROM prefixPath (COMMA prefixPath)*
+    ;
+
+specialClause
+    : specialLimit
+    | groupByTimeClause specialLimit?
+    | groupByFillClause
+    | fillClause slimitClause? alignByDeviceClauseOrDisableAlign?
+    | alignByDeviceClauseOrDisableAlign
+    | groupByLevelClause specialLimit?
+    ;
+
+specialLimit
+    : limitClause slimitClause? alignByDeviceClauseOrDisableAlign?
+    | slimitClause limitClause? alignByDeviceClauseOrDisableAlign?
+    | alignByDeviceClauseOrDisableAlign
+    ;
+
+limitClause
+    : LIMIT INT offsetClause?
+    | offsetClause? LIMIT INT
+    ;
+
+offsetClause
+    : OFFSET INT
+    ;
+
+slimitClause
+    : SLIMIT INT soffsetClause?
+    | soffsetClause? SLIMIT INT
+    ;
+
+soffsetClause
+    : SOFFSET INT
+    ;
+
+alignByDeviceClause
+    : ALIGN BY DEVICE
+    | GROUP BY DEVICE
+    ;
+
+disableAlign
+    : DISABLE ALIGN
+    ;
+
+alignByDeviceClauseOrDisableAlign
+    : alignByDeviceClause
+    | disableAlign
+    ;
+
+fillClause
+    : FILL LR_BRACKET typeClause (COMMA typeClause)* RR_BRACKET
+    ;
+
+groupByTimeClause
+    : GROUP BY LR_BRACKET
+      timeInterval
+      COMMA DURATION
+      (COMMA DURATION)?
+      RR_BRACKET
+    | GROUP BY LR_BRACKET
+            timeInterval
+            COMMA DURATION
+            (COMMA DURATION)?
+            RR_BRACKET
+            COMMA LEVEL OPERATOR_EQ INT
+    ;
+
+groupByFillClause
+    : GROUP BY LR_BRACKET
+      timeInterval
+      COMMA DURATION
+      RR_BRACKET
+      FILL LR_BRACKET typeClause (COMMA typeClause)* RR_BRACKET
+     ;
+
+groupByLevelClause
+    : GROUP BY LEVEL OPERATOR_EQ INT
+    ;
+
+typeClause
+    : dataType LS_BRACKET linearClause RS_BRACKET
+    | dataType LS_BRACKET previousClause RS_BRACKET
+    | dataType LS_BRACKET previousUntilLastClause RS_BRACKET
+    ;
+
+linearClause
+    : LINEAR (COMMA aheadDuration=DURATION COMMA behindDuration=DURATION)?
+    ;
+
+previousClause
+    : PREVIOUS (COMMA DURATION)?
+    ;
+
+previousUntilLastClause
+    : PREVIOUSUNTILLAST (COMMA DURATION)?
+    ;
+
+indexWithClause
+    : WITH indexValue (COMMA indexValue)?
+    ;
+
+indexValue
+    : ID OPERATOR_EQ INT
+    ;
+
+
+comparisonOperator
+    : type = OPERATOR_GT
+    | type = OPERATOR_GTE
+    | type = OPERATOR_LT
+    | type = OPERATOR_LTE
+    | type = OPERATOR_EQ
+    | type = OPERATOR_NEQ
+    ;
+
+insertColumnSpec
+    : LR_BRACKET (TIMESTAMP|TIME) (COMMA nodeNameWithoutStar)* RR_BRACKET
+    ;
+
+insertValuesSpec
+    : LR_BRACKET dateFormat (COMMA constant)* RR_BRACKET
+    | LR_BRACKET INT (COMMA constant)* RR_BRACKET
+    ;
+
+setCol
+    : suffixPath OPERATOR_EQ constant
+    ;
+
+privileges
+    : STRING_LITERAL (COMMA STRING_LITERAL)*
+    ;
+
+rootOrId
+    : ROOT
+    | ID
+    ;
+
+timeInterval
+    : LS_BRACKET startTime=timeValue COMMA endTime=timeValue RR_BRACKET
+    | LR_BRACKET startTime=timeValue COMMA endTime=timeValue RS_BRACKET
+    ;
+
+timeValue
+    : dateFormat
+    | dateExpression
+    | INT
+    ;
+
+propertyValue
+    : INT
+    | ID
+    | STRING_LITERAL
+    | constant
+    ;
+
+fullPath
+    : ROOT (DOT nodeNameWithoutStar)*
+    ;
+
+prefixPath
+    : ROOT (DOT nodeName)*
+    ;
+
+suffixPath
+    : nodeName (DOT nodeName)*
+    ;
+
+nodeName
+    : ID
+    | STAR
+    | STRING_LITERAL
+    | ID STAR
+    | DURATION
+    | encoding
+    | dataType
+    | dateExpression
+    | MINUS? EXPONENT
+    | MINUS? INT
+    | booleanClause
+    | (ID | OPERATOR_IN)? LS_BRACKET ID? RS_BRACKET ID?
+    | compressor
+    ;
+
+nodeNameWithoutStar
+    : ID
+    | STRING_LITERAL
+    | DURATION
+    | encoding
+    | dataType
+    | dateExpression
+    | MINUS? EXPONENT
+    | MINUS? INT
+    | booleanClause
+    | (ID | OPERATOR_IN)? LS_BRACKET ID? RS_BRACKET ID?
+    | compressor
+    ;
+
+dataType
+    : INT32 | INT64 | FLOAT | DOUBLE | BOOLEAN | TEXT | ALL
+    ;
+
+dateFormat
+    : DATETIME
+    | NOW LR_BRACKET RR_BRACKET
+    ;
+
+constant
+    : dateExpression
+    | NaN
+    | MINUS? realLiteral
+    | MINUS? INT
+    | STRING_LITERAL
+    | booleanClause
+    ;
+
+booleanClause
+    : TRUE
+    | FALSE
+    ;
+
+dateExpression
+    : dateFormat ((PLUS | MINUS) DURATION)*
+    ;
+
+encoding
+    : PLAIN | PLAIN_DICTIONARY | RLE | DIFF | TS_2DIFF | GORILLA | REGULAR
+    ;
+
+realLiteral
+    :   INT DOT (INT | EXPONENT)?
+    |   DOT  (INT|EXPONENT)
+    |   EXPONENT
+    ;
+
+property
+    : name=ID OPERATOR_EQ value=propertyValue
+    ;
+
+autoCreateSchema
+    : booleanClause
+    | booleanClause INT
+    ;
+
+//============================
+// Start of the keywords list
+//============================
+CREATE
+    : C R E A T E
+    ;
+
+INSERT
+    : I N S E R T
+    ;
+
+UPDATE
+    : U P D A T E
+    ;
+
+DELETE
+    : D E L E T E
+    ;
+
+SELECT
+    : S E L E C T
+    ;
+
+SHOW
+    : S H O W
+    ;
+
+GRANT
+    : G R A N T
+    ;
+
+INTO
+    : I N T O
+    ;
+
+SET
+    : S E T
+    ;
+
+WHERE
+    : W H E R E
+    ;
+
+FROM
+    : F R O M
+    ;
+
+TO
+    : T O
+    ;
+
+BY
+    : B Y
+    ;
+
+DEVICE
+    : D E V I C E
+    ;
+
+CONFIGURATION
+    : C O N F I G U R A T I O N
+    ;
+
+DESCRIBE
+    : D E S C R I B E
+    ;
+
+SLIMIT
+    : S L I M I T
+    ;
+
+LIMIT
+    : L I M I T
+    ;
+
+UNLINK
+    : U N L I N K
+    ;
+
+OFFSET
+    : O F F S E T
+    ;
+
+SOFFSET
+    : S O F F S E T
+    ;
+
+FILL
+    : F I L L
+    ;
+
+LINEAR
+    : L I N E A R
+    ;
+
+PREVIOUS
+    : P R E V I O U S
+    ;
+
+PREVIOUSUNTILLAST
+    : P R E V I O U S U N T I L L A S T
+    ;
+
+METADATA
+    : M E T A D A T A
+    ;
+
+TIMESERIES
+    : T I M E S E R I E S
+    ;
+
+TIMESTAMP
+    : T I M E S T A M P
+    ;
+
+PROPERTY
+    : P R O P E R T Y
+    ;
+
+WITH
+    : W I T H
+    ;
+
+ROOT
+    : R O O T
+    ;
+
+DATATYPE
+    : D A T A T Y P E
+    ;
+
+COMPRESSOR
+    : C O M P R E S S O R
+    ;
+
+STORAGE
+    : S T O R A G E
+    ;
+
+GROUP
+    : G R O U P
+    ;
+
+LABEL
+    : L A B E L
+    ;
+
+INT32
+    : I N T '3' '2'
+    ;
+
+INT64
+    : I N T '6' '4'
+    ;
+
+FLOAT
+    : F L O A T
+    ;
+
+DOUBLE
+    : D O U B L E
+    ;
+
+BOOLEAN
+    : B O O L E A N
+    ;
+
+TEXT
+    : T E X T
+    ;
+
+ENCODING
+    : E N C O D I N G
+    ;
+
+PLAIN
+    : P L A I N
+    ;
+
+PLAIN_DICTIONARY
+    : P L A I N '_' D I C T I O N A R Y
+    ;
+
+RLE
+    : R L E
+    ;
+
+DIFF
+    : D I F F
+    ;
+
+TS_2DIFF
+    : T S '_' '2' D I F F
+    ;
+
+GORILLA
+    : G O R I L L A
+    ;
+
+
+REGULAR
+    : R E G U L A R
+    ;
+
+BITMAP
+    : B I T M A P
+    ;
+
+ADD
+    : A D D
+    ;
+
+UPSERT
+    : U P S E R T
+    ;
+
+ALIAS
+    : A L I A S
+    ;
+
+VALUES
+    : V A L U E S
+    ;
+
+NOW
+    : N O W
+    ;
+
+LINK
+    : L I N K
+    ;
+
+INDEX
+    : I N D E X
+    ;
+
+USING
+    : U S I N G
+    ;
+
+TRACING
+    : T R A C I N G
+    ;
+
+ON
+    : O N
+    ;
+
+OFF
+    : O F F
+    ;
+
+DROP
+    : D R O P
+    ;
+
+MERGE
+    : M E R G E
+    ;
+
+LIST
+    : L I S T
+    ;
+
+USER
+    : U S E R
+    ;
+
+PRIVILEGES
+    : P R I V I L E G E S
+    ;
+
+ROLE
+    : R O L E
+    ;
+
+ALL
+    : A L L
+    ;
+
+OF
+    : O F
+    ;
+
+ALTER
+    : A L T E R
+    ;
+
+PASSWORD
+    : P A S S W O R D
+    ;
+
+REVOKE
+    : R E V O K E
+    ;
+
+LOAD
+    : L O A D
+    ;
+
+WATERMARK_EMBEDDING
+    : W A T E R M A R K '_' E M B E D D I N G
+    ;
+
+UNSET
+    : U N S E T
+    ;
+
+TTL
+    : T T L
+    ;
+
+FLUSH
+    : F L U S H
+    ;
+
+TASK
+    : T A S K
+    ;
+
+INFO
+    : I N F O
+    ;
+
+DYNAMIC
+    : D Y N A M I C
+    ;
+
+PARAMETER
+    : P A R A M E T E R
+    ;
+
+
+VERSION
+    : V E R S I O N
+    ;
+
+REMOVE
+    : R E M O V E
+    ;
+MOVE
+    : M O V E
+    ;
+
+CHILD
+    : C H I L D
+    ;
+
+PATHS
+    : P A T H S
+    ;
+
+DEVICES
+    : D E V I C E S
+    ;
+
+COUNT
+    : C O U N T
+    ;
+
+NODES
+    : N O D E S
+    ;
+
+LEVEL
+    : L E V E L
+    ;
+
+MIN_TIME
+    : M I N UNDERLINE T I M E
+    ;
+
+MAX_TIME
+    : M A X UNDERLINE T I M E
+    ;
+
+MIN_VALUE
+    : M I N UNDERLINE V A L U E
+    ;
+
+MAX_VALUE
+    : M A X UNDERLINE V A L U E
+    ;
+
+AVG
+    : A V G
+    ;
+
+FIRST_VALUE
+    : F I R S T UNDERLINE V A L U E
+    ;
+
+SUM
+    : S U M
+    ;
+
+LAST_VALUE
+    : L A S T UNDERLINE V A L U E
+    ;
+
+LAST
+    : L A S T
+    ;
+
+DISABLE
+    : D I S A B L E
+    ;
+
+ALIGN
+    : A L I G N
+    ;
+
+COMPRESSION
+    : C O M P R E S S I O N
+    ;
+
+TIME
+    : T I M E
+    ;
+
+ATTRIBUTES
+    : A T T R I B U T E S
+    ;
+
+TAGS
+    : T A G S
+    ;
+
+RENAME
+    : R E N A M E
+    ;
+
+GLOBAL
+  : G L O B A L
+  | G
+  ;
+
+FULL
+    : F U L L
+    ;
+
+CLEAR
+    : C L E A R
+    ;
+
+CACHE
+    : C A C H E
+    ;
+
+TRUE
+    : T R U E
+    ;
+
+FALSE
+    : F A L S E
+    ;
+
+UNCOMPRESSED
+    : U N C O M P R E S S E D
+    ;
+
+SNAPPY
+    : S N A P P Y
+    ;
+
+GZIP
+    : G Z I P
+    ;
+
+LZO
+    : L Z O
+    ;
+
+SDT
+    : S D T
+    ;
+
+PAA
+    : P A A
+    ;
+
+PLA
+   : P L A
+   ;
+
+LATEST
+    : L A T E S T
+    ;
+
+PARTITION
+    : P A R T I T I O N
+    ;
+
+SNAPSHOT
+    : S N A P S H O T
+    ;
+
+FOR
+    : F O R
+    ;
+
+SCHEMA
+    : S C H E M A
+    ;
+
+//============================
+// End of the keywords list
+//============================
+COMMA : ',';
+
+STAR : '*';
+
+OPERATOR_EQ : '=' | '==';
+
+OPERATOR_GT : '>';
+
+OPERATOR_GTE : '>=';
+
+OPERATOR_LT : '<';
+
+OPERATOR_LTE : '<=';
+
+OPERATOR_NEQ : '!=' | '<>';
+
+OPERATOR_IN : I N;
+
+OPERATOR_AND
+    : A N D
+    | '&'
+    | '&&'
+    ;
+
+OPERATOR_OR
+    : O R
+    | '|'
+    | '||'
+    ;
+
+OPERATOR_NOT
+    : N O T | '!'
+    ;
+
+OPERATOR_CONTAINS
+    : C O N T A I N S
+    ;
+
+MINUS : '-';
+
+PLUS : '+';
+
+DOT : '.';
+
+LR_BRACKET : '(';
+
+RR_BRACKET : ')';
+
+LS_BRACKET : '[';
+
+RS_BRACKET : ']';
+
+L_BRACKET : '{';
+
+R_BRACKET : '}';
+
+UNDERLINE : '_';
+
+NaN : 'NaN';
+
+STRING_LITERAL
+   : DOUBLE_QUOTE_STRING_LITERAL
+   | SINGLE_QUOTE_STRING_LITERAL
+   ;
+
+INT : [0-9]+;
+
+EXPONENT : INT ('e'|'E') ('+'|'-')? INT ;
+
+DURATION
+    :
+    (INT+ (Y|M O|W|D|H|M|S|M S|U S|N S))+
+    ;
+
+DATETIME
+    : INT ('-'|'/') INT ('-'|'/') INT
+      ((T | WS)
+      INT ':' INT ':' INT (DOT INT)?
+      (('+' | '-') INT ':' INT)?)?
+    ;
+
+/** Allow unicode rule/token names */
+ID : FIRST_NAME_CHAR NAME_CHAR*;
+
+fragment
+NAME_CHAR
+    :   'A'..'Z'
+    |   'a'..'z'
+    |   '0'..'9'
+    |   '_'
+    |   '-'
+    |   ':'
+    |   '/'
+    |   '@'
+    |   '#'
+    |   '$'
+    |   '%'
+    |   '&'
+    |   '+'
+    |   CN_CHAR
+    ;
+
+fragment
+FIRST_NAME_CHAR
+    :   'A'..'Z'
+    |   'a'..'z'
+    |   '0'..'9'
+    |   '_'
+    |   '/'
+    |   '@'
+    |   '#'
+    |   '$'
+    |   '%'
+    |   '&'
+    |   '+'
+    |   CN_CHAR
+    ;
+
+fragment CN_CHAR
+  : '\u2E80'..'\u9FFF'
+  ;
+
+fragment DOUBLE_QUOTE_STRING_LITERAL
+    : '"' ('\\' . | ~'"' )*? '"'
+    ;
+
+fragment SINGLE_QUOTE_STRING_LITERAL
+    : '\'' ('\\' . | ~'\'' )*? '\''
+    ;
+
+//Characters and write it this way for case sensitivity
+fragment A
+    : 'a' | 'A'
+    ;
+
+fragment B
+    : 'b' | 'B'
+    ;
+
+fragment C
+    : 'c' | 'C'
+    ;
+
+fragment D
+    : 'd' | 'D'
+    ;
+
+fragment E
+    : 'e' | 'E'
+    ;
+
+fragment F
+    : 'f' | 'F'
+    ;
+
+fragment G
+    : 'g' | 'G'
+    ;
+
+fragment H
+    : 'h' | 'H'
+    ;
+
+fragment I
+    : 'i' | 'I'
+    ;
+
+fragment J
+    : 'j' | 'J'
+    ;
+
+fragment K
+    : 'k' | 'K'
+    ;
+
+fragment L
+    : 'l' | 'L'
+    ;
+
+fragment M
+    : 'm' | 'M'
+    ;
+
+fragment N
+    : 'n' | 'N'
+    ;
+
+fragment O
+    : 'o' | 'O'
+    ;
+
+fragment P
+    : 'p' | 'P'
+    ;
+
+fragment Q
+    : 'q' | 'Q'
+    ;
+
+fragment R
+    : 'r' | 'R'
+    ;
+
+fragment S
+    : 's' | 'S'
+    ;
+
+fragment T
+    : 't' | 'T'
+    ;
+
+fragment U
+    : 'u' | 'U'
+    ;
+
+fragment V
+    : 'v' | 'V'
+    ;
+
+fragment W
+    : 'w' | 'W'
+    ;
+
+fragment X
+    : 'x' | 'X'
+    ;
+
+fragment Y
+    : 'y' | 'Y'
+    ;
+
+fragment Z
+    : 'z' | 'Z'
+    ;
+
+WS
+    : [ \r\n\t]+ -> channel(HIDDEN)
+    ;
\ No newline at end of file
diff --git a/antlr/src/pypi/README.md b/antlr/src/pypi/README.md
new file mode 100644
index 0000000..aefc22d
--- /dev/null
+++ b/antlr/src/pypi/README.md
@@ -0,0 +1,61 @@
+<!--
+
+    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.
+
+-->
+
+# Apache IoTDB
+
+[![Build Status](https://www.travis-ci.org/apache/incubator-iotdb.svg?branch=master)](https://www.travis-ci.org/apache/incubator-iotdb)
+[![codecov](https://codecov.io/gh/thulab/incubator-iotdb/branch/master/graph/badge.svg)](https://codecov.io/gh/thulab/incubator-iotdb)
+[![GitHub release](https://img.shields.io/github/release/apache/incubator-iotdb.svg)](https://github.com/apache/incubator-iotdb/releases)
+[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
+![](https://github-size-badge.herokuapp.com/apache/incubator-iotdb.svg)
+![](https://img.shields.io/github/downloads/apache/incubator-iotdb/total.svg)
+![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg)
+![](https://img.shields.io/badge/java--language-1.8-blue.svg)
+[![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/)
+
+
+Apache IoTDB (incubating) (Database for Internet of Things) is an integrated data management engine designed for
+timeseries data. It provides users with services for data collection, storage and analysis. Due to its light-weight
+architecture, high performance and rich feature set together with its deep integration with Apache Hadoop and Spark,
+Apache IoTDB (incubating) can meet the requirements of massive data storage, high-speed data ingestion and complex data
+analysis in the IoT industrial fields.
+
+
+# Apache IoTDB Python Client API
+
+Using the package, you can write data to IoTDB, read data from IoTDB and maintain the schema of IoTDB.
+
+## Requirements
+
+You have to install thrift (>=0.13) before using the package.
+
+## How to use (Example)
+
+You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/incubator-iotdb/blob/release%2F0.9.0/client-py/src/client_example.py)
+
+# DISCLAIMER
+
+Apache IoTDB is an effort undergoing incubation at The Apache Software Foundation (ASF).
+Incubation is required of all newly accepted projects until a further review indicates that the
+infrastructure, communications, and decision making process have stabilized in a manner consistent
+with other successful ASF projects. While incubation status is not necessarily a reflection of the
+completeness or stability of the code, it does indicate that the project has yet to be fully
+endorsed by the ASF.
\ No newline at end of file
diff --git a/antlr/src/pypi/setup.py b/antlr/src/pypi/setup.py
new file mode 100644
index 0000000..29b0124
--- /dev/null
+++ b/antlr/src/pypi/setup.py
@@ -0,0 +1,55 @@
+#  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.
+#
+
+import setuptools
+import io
+
+
+try:
+    with io.open('README.md', encoding='utf-8') as f:
+        long_description = f.read()
+except FileNotFoundError:
+    long_description = ''
+
+
+print(long_description)
+
+setuptools.setup(
+    name="apache-iotdb", # Replace with your own username
+    version="0.11.0",
+    author=" Apache Software Foundation",
+    author_email="dev@iotdb.apache.org",
+    description="Apache IoTDB (incubating) client API",
+    long_description=long_description,
+    long_description_content_type="text/markdown",
+    url="https://github.com/apache/incubator-iotdb",
+    packages=setuptools.find_packages(),
+    install_requires=[
+              'thrift>=0.13.0',
+          ],
+    classifiers=[
+        "Programming Language :: Python :: 3",
+        "License :: OSI Approved :: Apache Software License",
+        "Operating System :: OS Independent",
+        "Topic :: Software Development :: Libraries",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+    ],
+    python_requires='>=3.7',
+    license='Apache License, Version 2.0',
+    website='https://iotdb.apache.org',
+)
diff --git a/client-py/compile.bat b/client-py/compile.bat
index dca7559..7b8532f 100644
--- a/client-py/compile.bat
+++ b/client-py/compile.bat
@@ -20,7 +20,7 @@
 @echo off
 set THRIFT_EXE=D:\software\Thrift\thrift-0.13.0.exe
 set BAT_DIR=%~dp0
-set THRIFT_SCRIPT=%BAT_DIR%..\service-rpc\src\main\thrift\rpc.thrift
+set THRIFT_SCRIPT=%BAT_DIR%..\thrift\src\main\thrift\rpc.thrift
 set THRIFT_OUT=%BAT_DIR%target\iotdb
 
 rmdir /Q /S %THRIFT_OUT%
diff --git a/client-py/compile.sh b/client-py/compile.sh
index 93b107c..63426c6 100644
--- a/client-py/compile.sh
+++ b/client-py/compile.sh
@@ -20,7 +20,7 @@
 
 export THRIFT_EXE=thrift
 export SH_DIR=$(dirname $0)/
-export THRIFT_SCRIPT=${SH_DIR}../service-rpc/src/main/thrift/rpc.thrift
+export THRIFT_SCRIPT=${SH_DIR}../thrift/src/main/thrift/rpc.thrift
 export THRIFT_OUT=${SH_DIR}target/iotdb
 
 rm -rf ${THRIFT_OUT}
diff --git a/client-py/readme.md b/client-py/readme.md
index 576cae7..2c4946d 100644
--- a/client-py/readme.md
+++ b/client-py/readme.md
@@ -42,7 +42,7 @@ locate the thrift source file by relative path, so if you move the scripts else
 no longer valid.
 
 Optionally, if you know the basic usage of thrift, you can only download the thrift source file in
-`service-rpc\src\main\thrift\rpc.thrift`, and simply use `thrift -gen py -out ./target/iotdb rpc.thrift` 
+`thrift\src\main\thrift\rpc.thrift`, and simply use `thrift -gen py -out ./target/iotdb rpc.thrift` 
 to generate the python library.
 
 ## Example
diff --git a/client-py/src/client_example.py b/client-py/src/client_example.py
index f7f79b0..b729e37 100755
--- a/client-py/src/client_example.py
+++ b/client-py/src/client_example.py
@@ -25,7 +25,7 @@ import struct
 # sys.path.append("../target")
 
 #if you use maven to compile the thrift api, just use the follwoing code:
-sys.path.append("../../service-rpc/target/generated-sources-python")
+sys.path.append("../../thrift/target/generated-sources-python")
 
 from thrift.protocol import TBinaryProtocol, TCompactProtocol
 from thrift.transport import TSocket, TTransport
diff --git a/docs/Development/ContributeGuide.md b/docs/Development/ContributeGuide.md
index 959420e..2e5ae1e 100644
--- a/docs/Development/ContributeGuide.md
+++ b/docs/Development/ContributeGuide.md
@@ -19,7 +19,7 @@
 
 -->
 
-# 一、work process
+# 1. work process
 
 ## Main link
 
@@ -95,9 +95,9 @@ You can go to jira to pick up the existing issue or create your own issue and ge
 * Make changes based on other people's reviews and continue to update until merged
 * close jira issue
 
-## 二、IoTDB debugging method
+## 2. IoTDB debugging method
 
-Recommended Use Intellij idea。```mvn clean package -DskipTests``` After putting ```server/target/generated-sources/antlr4``` and ```service-rpc/target/generated-sources/thrift``` marked as ```Source Root```。 
+Recommended Use Intellij idea. ```mvn clean package -DskipTests``` After putting ```antlr/target/generated-sources/antlr4``` and ```thrift/target/generated-sources/thrift``` marked as ```Source Root```。 
 
 * Server main function:```server/src/main/java/org/apache/iotdb/db/service/IoTDB```,Can be started in debug mode
 * Client:```client/src/main/java/org/apache/iotdb/client/```,Use Clinet for linux and WinClint for windows, you can start directly, need the parameter "-h 127.0.0.1 -p 6667 -u root -pw root"
diff --git a/docs/SystemDesign/Client/RPC.md b/docs/SystemDesign/Client/RPC.md
index 68f45ea..a46aada 100644
--- a/docs/SystemDesign/Client/RPC.md
+++ b/docs/SystemDesign/Client/RPC.md
@@ -23,7 +23,7 @@
 
 We use thrift rpc between client and server, the definition file is :
 
-service-rpc/src/main/thrift/rpc.thrift
+thrift/src/main/thrift/rpc.thrift
 
 You can add struct and corresponding method in TSIService (service)
 
@@ -33,9 +33,16 @@ You can add struct and corresponding method in TSIService (service)
 mvn clean compile -pl service-rpc -am -DskipTests
 ```
 
+or
+
+```
+mvn clean compile -pl thrift
+
+```
+
 Generated codes:
 
-service-rpc/target/generated-sources/thrift/org/apache/iotdb/service/rpc/thrift
+thrift/target/generated-sources/thrift/org/apache/iotdb/service/rpc/thrift
 
 ## Implement the new interface
 
diff --git a/docs/SystemDesign/QueryEngine/Planner.md b/docs/SystemDesign/QueryEngine/Planner.md
index d2a63a0..c62dc11 100644
--- a/docs/SystemDesign/QueryEngine/Planner.md
+++ b/docs/SystemDesign/QueryEngine/Planner.md
@@ -29,11 +29,11 @@ Transform the syntax tree parsed by SQL into logical plans, logical optimization
 
 SQL parsing using Antlr4
 
-* server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
+* antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
 
-mvn clean compile 
+`mvn clean compile -pl antlr` 
 
-Generated code location :server/target/generated-sources/antlr4
+Generated code location :antlr/target/generated-sources/antlr4
 
 ## Logical plan generator
 
diff --git a/docs/UserGuide/Client/Programming - Other Languages.md b/docs/UserGuide/Client/Programming - Other Languages.md
index 005289a..4a98dd8 100644
--- a/docs/UserGuide/Client/Programming - Other Languages.md	
+++ b/docs/UserGuide/Client/Programming - Other Languages.md	
@@ -63,7 +63,7 @@ no longer valid.
 #### Option 3: basic usage of thrift
 
 Optionally, if you know the basic usage of thrift, you can only download the thrift source file in
-`service-rpc\src\main\thrift\rpc.thrift`, and simply use `thrift -gen py -out ./target/iotdb rpc.thrift` 
+`thrift\src\main\thrift\rpc.thrift`, and simply use `thrift -gen py -out ./target/iotdb rpc.thrift` 
 to generate the python library.
 
 ### 4. Use Example
diff --git a/docs/UserGuide/Server/Download.md b/docs/UserGuide/Server/Download.md
index c3f6776..f38b4fd 100644
--- a/docs/UserGuide/Server/Download.md
+++ b/docs/UserGuide/Server/Download.md
@@ -59,7 +59,7 @@ Under the root path of incubator-iotdb:
 
 Then the binary version (including both server and client) can be found at **distribution/target/apache-iotdb-{project.version}-incubating-bin.zip**
 
-> NOTE: Directories "service-rpc/target/generated-sources/thrift" and "server/target/generated-sources/antlr4" need to be added to sources roots to avoid compilation errors in IDE.
+> NOTE: Directories "thrift/target/generated-sources/thrift" and "antlr/target/generated-sources/antlr4" need to be added to sources roots to avoid compilation errors in IDE.
 
 If you would like to build the IoTDB server, you can run the following command under the root path of incubator-iotdb:
 
diff --git a/docs/zh/Development/ContributeGuide.md b/docs/zh/Development/ContributeGuide.md
index 1f5871a..3dc82e4 100644
--- a/docs/zh/Development/ContributeGuide.md
+++ b/docs/zh/Development/ContributeGuide.md
@@ -101,7 +101,9 @@ IoTDB 所有官网上的内容都在项目根目录的 docs 中:
 
 ### Intellij idea
 
-推荐使用 Intellij idea。```mvn clean package -DskipTests``` 之后把 ```server/target/generated-sources/antlr4``` 和 ```service-rpc/target/generated-sources/thrift``` 标记为 ```Source Root```。 
+推荐使用 Intellij idea。```mvn clean package -DskipTests``` 
+
+之后把 ```antlr/target/generated-sources/antlr4``` 和 ```thrift/target/generated-sources/thrift``` 标记为 ```Source Root```。 
 
 ### Eclipse
 
diff --git a/docs/zh/SystemDesign/Client/RPC.md b/docs/zh/SystemDesign/Client/RPC.md
index 5a63894..d1406f3 100644
--- a/docs/zh/SystemDesign/Client/RPC.md
+++ b/docs/zh/SystemDesign/Client/RPC.md
@@ -23,7 +23,7 @@
 
 我们使用 Thrift Rpc 框架, thrift 定义文件目录:
 
-service-rpc/src/main/thrift/rpc.thrift
+thrift/src/main/thrift/rpc.thrift
 
 可按需增加 struct 结构,并在 service TSIService 中增加对应方法
 
@@ -33,9 +33,17 @@ service-rpc/src/main/thrift/rpc.thrift
 mvn clean compile -pl service-rpc -am -DskipTests
 ```
 
+或者
+
+
+```
+mvn clean compile -pl thrift
+
+```
+
 生成代码位置:
 
-service-rpc/target/generated-sources/thrift/org/apache/iotdb/service/rpc/thrift
+thrift/target/generated-sources/thrift/org/apache/iotdb/service/rpc/thrift
 
 ## 实现新接口
 
diff --git a/docs/zh/SystemDesign/QueryEngine/Planner.md b/docs/zh/SystemDesign/QueryEngine/Planner.md
index 82640d0..2eb8e1c 100644
--- a/docs/zh/SystemDesign/QueryEngine/Planner.md
+++ b/docs/zh/SystemDesign/QueryEngine/Planner.md
@@ -29,9 +29,9 @@
 
 SQL 解析采用 Antlr4
 
-* server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
+* antlr/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
 
-mvn clean compile 之后生成代码位置:server/target/generated-sources/antlr4
+`mvn clean compile -pl antlr` 之后生成代码位置:antlr/target/generated-sources/antlr4
 
 ## 逻辑计划生成器
 
diff --git a/docs/zh/UserGuide/Client/Programming - Other Languages.md b/docs/zh/UserGuide/Client/Programming - Other Languages.md
index 735c8f4..dc1707f 100644
--- a/docs/zh/UserGuide/Client/Programming - Other Languages.md	
+++ b/docs/zh/UserGuide/Client/Programming - Other Languages.md	
@@ -59,7 +59,7 @@ pip install apache-iotdb
 #### 方案3:thrift的基本用法
 
 或者,如果您了解thrift的基本用法,则只能在以下位置下载Thrift源文件:
-`service-rpc\src\main\thrift\rpc.thrift`,并且只需使用`thrift -gen py -out ./target/iotdb rpc.thrift`生成python库。
+`thrift\src\main\thrift\rpc.thrift`,并且只需使用`thrift -gen py -out ./target/iotdb rpc.thrift`生成python库。
 
 ### 4. 示例代码
 
diff --git a/jdbc/src/main/feature/feature.xml b/jdbc/src/main/feature/feature.xml
index eda59ec..5704a7a 100644
--- a/jdbc/src/main/feature/feature.xml
+++ b/jdbc/src/main/feature/feature.xml
@@ -25,6 +25,7 @@
         <bundle>mvn:org.apache.iotdb/iotdb-jdbc/${project.version}</bundle>
         <bundle>mvn:org.apache.iotdb/tsfile/${project.version}</bundle>
         <bundle>mvn:org.apache.iotdb/service-rpc/${project.version}</bundle>
+        <bundle>mvn:org.apache.iotdb/iotdb-thrift/${project.version}</bundle>
         <bundle>mvn:org.apache.iotdb/hadoop-tsfile/${project.version}</bundle>
         <bundle>mvn:org.apache.thrift/libthrift/0.13.0</bundle>
         <bundle>mvn:org.xerial.snappy/snappy-java/1.1.7.2</bundle>
diff --git a/jdbc/src/test/java/org/apache/iotdb/jdbc/manualtest/CompleteFutureTest.java b/jdbc/src/test/java/org/apache/iotdb/jdbc/manualtest/CompleteFutureTest.java
new file mode 100644
index 0000000..982337b
--- /dev/null
+++ b/jdbc/src/test/java/org/apache/iotdb/jdbc/manualtest/CompleteFutureTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.jdbc.manualtest;
+
+
+
+public class CompleteFutureTest {
+
+  public static void main(String[] args) {
+
+
+  }
+
+}
diff --git a/jdbc/src/test/java/org/apache/iotdb/jdbc/manualtest/JDBCRegisterManyTimeSeries.java b/jdbc/src/test/java/org/apache/iotdb/jdbc/manualtest/JDBCRegisterManyTimeSeries.java
new file mode 100644
index 0000000..34a6e64
--- /dev/null
+++ b/jdbc/src/test/java/org/apache/iotdb/jdbc/manualtest/JDBCRegisterManyTimeSeries.java
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+
+/*
+ * 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.jdbc.manualtest;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import org.apache.iotdb.jdbc.IoTDBSQLException;
+
+public class JDBCRegisterManyTimeSeries {
+
+  public static void main(String[] args) throws ClassNotFoundException, SQLException {
+    Class.forName("org.apache.iotdb.jdbc.IoTDBDriver");
+    try (Connection connection = DriverManager
+        .getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
+        Statement statement = connection.createStatement()) {
+      int total = 10_000_000;
+      try {
+        statement.execute("SET STORAGE GROUP TO root.sg1");
+        for (int i = 0; i < total; i++) {
+          statement.execute(
+              "CREATE TIMESERIES root.sg1.d1.s" + i
+                  + " WITH DATATYPE=INT64, ENCODING=RLE, COMPRESSOR=SNAPPY");
+          if (i % 10_000 == 0) {
+            System.out.println((double) i / total * 100 + "%");
+          }
+        }
+      } catch (IoTDBSQLException e) {
+        System.out.println(e.getMessage());
+      }
+
+    } catch (IoTDBSQLException e) {
+      System.out.println(e.getMessage());
+    }
+  }
+
+}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 2b39876..8e1fa53 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,6 +80,8 @@
     </mailingLists>
     <modules>
         <module>tsfile</module>
+        <module>antlr</module>
+        <module>thrift</module>
         <module>service-rpc</module>
         <module>jdbc</module>
         <module>session</module>
diff --git a/server/pom.xml b/server/pom.xml
index e617d3b..1b01e9b 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -55,6 +55,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-antlr</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
             <artifactId>tsfile</artifactId>
             <version>${project.version}</version>
             <exclusions>
@@ -79,10 +84,6 @@
             <artifactId>commons-lang</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.antlr</groupId>
-            <artifactId>antlr4-runtime</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
@@ -183,18 +184,6 @@
     </dependencies>
     <build>
         <plugins>
-            <plugin>
-                <groupId>org.antlr</groupId>
-                <artifactId>antlr4-maven-plugin</artifactId>
-                <version>${antlr4.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>antlr4</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <!--using `mvn test` to run UT, `mvn verify` to run ITs
                         Reference: https://antoniogoncalves.org/2012/12/13/lets-turn-integration-tests-with-maven-to-a-first-class-citizen/-->
             <plugin>
diff --git a/service-rpc/pom.xml b/service-rpc/pom.xml
index 6a2c57a..beb2a0c 100644
--- a/service-rpc/pom.xml
+++ b/service-rpc/pom.xml
@@ -37,12 +37,13 @@
     </properties>
     <dependencies>
         <dependency>
-            <groupId>org.apache.thrift</groupId>
-            <artifactId>libthrift</artifactId>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>tsfile</artifactId>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.iotdb</groupId>
-            <artifactId>tsfile</artifactId>
+            <artifactId>iotdb-thrift</artifactId>
             <version>${project.version}</version>
         </dependency>
     </dependencies>
@@ -130,111 +131,10 @@
                     <skipITs>${rpc.it.skip}</skipITs>
                 </configuration>
             </plugin>
-            <!-- for pypi distribution -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-resources-plugin</artifactId>
-                <version>2.4.3</version>
-                <configuration>
-                    <encoding>${project.build.sourceEncoding}</encoding>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>copy-pypi-resources</id>
-                        <!-- here the phase you need -->
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <encoding>utf-8</encoding>
-                            <outputDirectory>${project.build.directory}/generated-sources-python</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>${basedir}/src/pypi</directory>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>copy-license-resources</id>
-                        <!-- here the phase you need -->
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <configuration>
-                            <encoding>utf-8</encoding>
-                            <outputDirectory>${project.build.directory}/generated-sources-python</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>${basedir}/../</directory>
-                                    <includes>
-                                        <include>LICENSE</include>
-                                    </includes>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
     <profiles>
         <profile>
-            <id>only-eclipse</id>
-            <activation>
-                <property>
-                    <name>m2e.version</name>
-                </property>
-            </activation>
-            <build>
-                <pluginManagement>
-                    <plugins>
-                        <plugin>
-                            <groupId>org.eclipse.m2e</groupId>
-                            <artifactId>lifecycle-mapping</artifactId>
-                            <version>1.0.0</version>
-                            <configuration>
-                                <lifecycleMappingMetadata>
-                                    <pluginExecutions>
-                                        <pluginExecution>
-                                            <pluginExecutionFilter>
-                                                <groupId>org.apache.maven.plugins</groupId>
-                                                <artifactId>maven-dependency-plugin</artifactId>
-                                                <versionRange>${maven-dependency-plugin.version}</versionRange>
-                                                <goals>
-                                                    <goal>copy-dependencies</goal>
-                                                </goals>
-                                            </pluginExecutionFilter>
-                                            <action>
-                                                <ignore/>
-                                            </action>
-                                        </pluginExecution>
-                                        <pluginExecution>
-                                            <pluginExecutionFilter>
-                                                <groupId>org.apache.thrift.tools</groupId>
-                                                <artifactId>maven-thrift-plugin</artifactId>
-                                                <versionRange>[0.1.10,)</versionRange>
-                                                <goals>
-                                                    <goal>compile</goal>
-                                                </goals>
-                                            </pluginExecutionFilter>
-                                            <action>
-                                                <execute>
-                                                    <runOnIncremental>false</runOnIncremental>
-                                                </execute>
-                                            </action>
-                                        </pluginExecution>
-                                    </pluginExecutions>
-                                </lifecycleMappingMetadata>
-                            </configuration>
-                        </plugin>
-                    </plugins>
-                </pluginManagement>
-            </build>
-        </profile>
-        <profile>
             <id>skipTsfileTests</id>
             <activation>
                 <property>
diff --git a/session/src/test/java/org/apache/iotdb/session/CompleteFutureTest.java b/session/src/test/java/org/apache/iotdb/session/CompleteFutureTest.java
new file mode 100644
index 0000000..206a755
--- /dev/null
+++ b/session/src/test/java/org/apache/iotdb/session/CompleteFutureTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.session;
+
+
+
+public class CompleteFutureTest {
+
+  public static void main(String[] args) {
+    Session session = null;
+
+  }
+
+}
diff --git a/site/pom.xml b/site/pom.xml
index f85a744..c9cd77b 100644
--- a/site/pom.xml
+++ b/site/pom.xml
@@ -103,7 +103,7 @@
                                     </includes>
                                 </resource>
                                 <resource>
-                                    <directory>${basedir}/../service-rpc</directory>
+                                    <directory>${basedir}/../thrift</directory>
                                     <includes>
                                         <include>rpc-changelist.md</include>
                                     </includes>
@@ -129,7 +129,7 @@
                                     </includes>
                                 </resource>
                                 <resource>
-                                    <directory>${basedir}/../service-rpc</directory>
+                                    <directory>${basedir}/../thrift</directory>
                                     <includes>
                                         <include>rpc-changelist.md</include>
                                     </includes>
diff --git a/service-rpc/pom.xml b/thrift/pom.xml
similarity index 77%
copy from service-rpc/pom.xml
copy to thrift/pom.xml
index 6a2c57a..15632c1 100644
--- a/service-rpc/pom.xml
+++ b/thrift/pom.xml
@@ -27,24 +27,14 @@
         <version>0.11.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
-    <artifactId>service-rpc</artifactId>
-    <name>Service-rpc</name>
-    <description>RPC framework for client and server.</description>
-    <properties>
-        <rpc.test.skip>false</rpc.test.skip>
-        <rpc.it.skip>${rpc.test.skip}</rpc.it.skip>
-        <rpc.ut.skip>${rpc.test.skip}</rpc.ut.skip>
-    </properties>
+    <artifactId>iotdb-thrift</artifactId>
+    <name>rpc-thrift</name>
+    <description>RPC (Thrift) framework for client and server.</description>
     <dependencies>
         <dependency>
             <groupId>org.apache.thrift</groupId>
             <artifactId>libthrift</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.iotdb</groupId>
-            <artifactId>tsfile</artifactId>
-            <version>${project.version}</version>
-        </dependency>
     </dependencies>
     <build>
         <plugins>
@@ -103,33 +93,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <!--using `mvn test` to run UT, `mvn verify` to run ITs
-            Reference: https://antoniogoncalves.org/2012/12/13/lets-turn-integration-tests-with-maven-to-a-first-class-citizen/-->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <skipTests>${rpc.ut.skip}</skipTests>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-failsafe-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>run-integration-tests</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>integration-test</goal>
-                            <goal>verify</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <skipTests>${rpc.test.skip}</skipTests>
-                    <skipITs>${rpc.it.skip}</skipITs>
-                </configuration>
-            </plugin>
             <!-- for pypi distribution -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -234,31 +197,5 @@
                 </pluginManagement>
             </build>
         </profile>
-        <profile>
-            <id>skipTsfileTests</id>
-            <activation>
-                <property>
-                    <name>skipTests</name>
-                    <value>true</value>
-                </property>
-            </activation>
-            <properties>
-                <rpc.test.skip>true</rpc.test.skip>
-                <rpc.ut.skip>true</rpc.ut.skip>
-                <rpc.it.skip>true</rpc.it.skip>
-            </properties>
-        </profile>
-        <profile>
-            <id>skipUT_ServiceRPC_Tests</id>
-            <activation>
-                <property>
-                    <name>skipUTs</name>
-                    <value>true</value>
-                </property>
-            </activation>
-            <properties>
-                <rpc.ut.skip>true</rpc.ut.skip>
-            </properties>
-        </profile>
     </profiles>
 </project>
diff --git a/service-rpc/rpc-changelist.md b/thrift/rpc-changelist.md
similarity index 100%
rename from service-rpc/rpc-changelist.md
rename to thrift/rpc-changelist.md
diff --git a/thrift/src/main/thrift/cluster.thrift b/thrift/src/main/thrift/cluster.thrift
new file mode 100644
index 0000000..b59bee8
--- /dev/null
+++ b/thrift/src/main/thrift/cluster.thrift
@@ -0,0 +1,387 @@
+/*
+ * 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.
+ */
+
+include "rpc.thrift"
+namespace java org.apache.iotdb.cluster.rpc.thrift
+
+typedef i32 int 
+typedef i16 short
+typedef i64 long
+
+// TODO-Cluster: update rpc change list when ready to merge
+// leader -> follower
+struct HeartBeatRequest {
+  1: required long term // leader's meta log
+  2: required long commitLogIndex  // leader's meta log
+  3: required long commitLogTerm
+  4: required Node leader
+  // if the leader does not know the follower's id, and require it reports to the leader, then true
+  5: required bool requireIdentifier
+  6: required bool regenerateIdentifier //if the leader finds the follower's id is conflicted,
+  // then true
+  // serialized partitionTable
+  7: optional binary partitionTableBytes
+
+  // because a data server may play many data groups members, this is used to identify which
+  // member should process the request or response. Only used in data group communication.
+  8: optional Node header
+}
+
+// follower -> leader
+struct HeartBeatResponse {
+  1: required long term
+  2: optional long lastLogIndex // follower's meta log
+  3: optional long lastLogTerm // follower's meta log
+  // used to perform a catch up when necessary
+  4: optional Node follower
+  5: optional int followerIdentifier
+  6: required bool requirePartitionTable
+
+  // because a data server may play many data groups members, this is used to identify which
+  // member should process the request or response. Only used in data group communication.
+  7: optional Node header
+}
+
+// node -> node
+struct ElectionRequest {
+  1: required long term
+  2: required long lastLogTerm
+  3: required long lastLogIndex
+  4: required Node elector
+
+  // because a data server may play many data groups members, this is used to identify which
+  // member should process the request or response. Only used in data group communication.
+  5: optional Node header
+  6: optional long dataLogLastIndex
+  7: optional long dataLogLastTerm
+}
+
+// leader -> follower
+struct AppendEntryRequest {
+  1: required long term // leader's
+  2: required Node leader
+  3: required long prevLogIndex
+  4: required long prevLogTerm
+  5: required long leaderCommit
+  6: required binary entry // data
+
+  // because a data server may play many data groups members, this is used to identify which
+  // member should process the request or response. Only used in data group communication.
+  7: optional Node header
+}
+
+// leader -> follower
+struct AppendEntriesRequest {
+  1: required long term // leader's
+  2: required Node leader
+  3: required list<binary> entries // data
+  4: required long prevLogIndex
+  5: required long prevLogTerm
+  6: required long leaderCommit
+
+  // because a data server may play many data groups members, this is used to identify which
+  // member should process the request or response. Only used in data group communication.
+  7: optional Node header
+}
+
+struct AddNodeResponse {
+  // -1: accept to add new node or the node is already in this cluster, otherwise: fail to
+  // add new node
+  1: required int respNum
+  2: optional binary partitionTableBytes
+  3: optional CheckStatusResponse checkStatusResponse
+}
+
+struct Node {
+  1: required string ip
+  2: required int metaPort
+  3: required int nodeIdentifier
+  4: required int dataPort
+}
+
+// leader -> follower
+struct StartUpStatus {
+  1: required long partitionInterval
+  2: required int hashSalt
+  3: required int replicationNumber
+}
+
+// follower -> leader
+struct CheckStatusResponse {
+  1: required bool partitionalIntervalEquals
+  2: required bool hashSaltEquals
+  3: required bool replicationNumEquals
+}
+
+struct SendSnapshotRequest {
+  1: required binary snapshotBytes
+  // for data group
+  2: optional Node header
+}
+
+struct PullSnapshotRequest {
+  1: required list<int> requiredSlots
+  // for data group
+  2: optional Node header
+  // set to true if the previous holder has been removed from the cluster.
+  // This will make the previous holder read-only so that different new
+  // replicas can pull the same snapshot.
+  3: required bool requireReadOnly
+}
+
+struct PullSnapshotResp {
+  1: optional map<int, binary> snapshotBytes
+}
+
+struct ExecutNonQueryReq {
+  1: required binary planBytes
+  2: optional Node header
+}
+
+struct PullSchemaRequest {
+  1: required list<string> prefixPaths
+  2: optional Node header
+}
+
+struct PullSchemaResp {
+  1: required binary schemaBytes
+}
+
+struct SingleSeriesQueryRequest {
+  1: required string path
+  2: optional binary timeFilterBytes
+  3: optional binary valueFilterBytes
+  4: required long queryId
+  5: required Node requester
+  6: required Node header
+  7: required int dataTypeOrdinal
+  8: required set<string> deviceMeasurements
+}
+
+struct PreviousFillRequest {
+  1: required string path
+  2: required long queryTime
+  3: required long beforeRange
+  4: required long queryId
+  5: required Node requester
+  6: required Node header
+  7: required int dataTypeOrdinal
+  8: required set<string> deviceMeasurements
+}
+
+// the spec and load of a node, for query coordinating
+struct TNodeStatus {
+
+}
+
+struct GetAggrResultRequest {
+  1: required string path
+  2: required list<string> aggregations
+  3: required int dataTypeOrdinal
+  4: optional binary timeFilterBytes
+  5: required Node header
+  6: required long queryId
+  7: required Node requestor
+  8: required set<string> deviceMeasurements
+}
+
+struct GroupByRequest {
+  1: required string path
+  2: required int dataTypeOrdinal
+  3: optional binary timeFilterBytes
+  4: required long queryId
+  5: required list<int> aggregationTypeOrdinals
+  6: required Node header
+  7: required Node requestor
+  8: required set<string> deviceMeasurements
+}
+
+service RaftService {
+  /**
+  * Leader will call this method to all followers to ensure its authority.
+  * <br>For the receiver,
+  * The method will check the authority of the leader.
+  *
+  * @param request information of the leader
+  * @return if the leader is valid, HeartBeatResponse.term will set -1, and the follower will tell
+  * leader its lastLogIndex; otherwise, the follower will tell the fake leader its term.
+  **/
+  HeartBeatResponse sendHeartbeat(1:HeartBeatRequest request);
+
+	/**
+  * If a node wants to be a leader, it'll call the method to other nodes to get a vote.
+  * <br>For the receiver,
+  * The method will check whether the node can be a leader.
+  *
+  * @param voteRequest a candidate that wants to be a leader.
+  * @return -1 means agree, otherwise return the voter's term
+  **/
+  long startElection(1:ElectionRequest request);
+
+  /**
+  * Leader will call this method to send a batch of entries to all followers.
+  * <br>For the receiver,
+  * The method will check the authority of the leader and if the local log is complete.
+  * If the leader is valid and local log is complete, the follower will append these entries to local log.
+  *
+  * @param request entries that need to be appended and the information of the leader.
+  * @return -1: agree, -2: log index mismatch , otherwise return the follower's term
+  **/
+  long appendEntries(1:AppendEntriesRequest request)
+
+  /**
+  * Leader will call this method to send a entry to all followers.
+  * <br>For the receiver,
+  * The method will check the authority of the leader and if the local log is complete.
+  * If the leader is valid and local log is complete, the follower will append the entry to local log.
+  *
+  * @param request entry that needs to be appended and the information of the leader.
+  * @return -1: agree, -2: log index mismatch , otherwise return the follower's term
+  **/
+  long appendEntry(1:AppendEntryRequest request)
+
+  void sendSnapshot(1:SendSnapshotRequest request)
+
+  /**
+  * Execute a binarized non-query PhysicalPlan
+  **/
+  rpc.TSStatus executeNonQueryPlan(1:ExecutNonQueryReq request)
+
+  /**
+  * Ask the leader for its commit index, used to check whether the node has caught up with the
+  * leader.
+  **/
+  long requestCommitIndex(1:Node header)
+
+  binary readFile(1:string filePath, 2:i64 offset, 3:i32 length)
+}
+
+
+
+service TSDataService extends RaftService {
+
+  /**
+  * Query a time series without value filter.
+  * @return a readerId >= 0 if the query succeeds, otherwise the query fails
+  * TODO-Cluster: support query multiple series in a request
+  **/
+  long querySingleSeries(1:SingleSeriesQueryRequest request)
+
+  /**
+  * Fetch at max fetchSize time-value pairs using the resultSetId generated by querySingleSeries.
+  * @return a ByteBuffer containing the serialized time-value pairs or an empty buffer if there
+  * are not more results.
+  **/
+  binary fetchSingleSeries(1:Node header, 2:long readerId)
+
+   /**
+   * Query a time series and generate an IReaderByTimestamp.
+   * @return a readerId >= 0 if the query succeeds, otherwise the query fails
+   **/
+  long querySingleSeriesByTimestamp(1:SingleSeriesQueryRequest request)
+
+   /**
+   * Fetch one value at given timestamp using the resultSetId generated by
+   * querySingleSeriesByTimestamp.
+   * @return a ByteBuffer containing the serialized value or an empty buffer if there
+   * are not more results.
+   **/
+   binary fetchSingleSeriesByTimestamp(1:Node header, 2:long readerId, 3:long timestamp)
+
+  /**
+  * Find the local query established for the remote query and release all its resource.
+  **/
+  void endQuery(1:Node header, 2:Node thisNode, 3:long queryId)
+
+  /**
+  * Given path patterns (paths with wildcard), return all paths they match.
+  **/
+  list<string> getAllPaths(1:Node header, 2:list<string> path)
+
+  /**
+   * Given path patterns (paths with wildcard), return all devices they match.
+   **/
+  set<string> getAllDevices(1:Node header, 2:list<string> path)
+
+  list<string> getNodeList(1:Node header, 2:string path, 3:int nodeLevel)
+
+  set<string> getChildNodePathInNextLevel(1: Node header, 2: string path)
+
+  binary getAllMeasurementSchema(1: Node header, 2: binary planBinary)
+
+
+  list<binary> getAggrResult(1:GetAggrResultRequest request)
+
+  PullSnapshotResp pullSnapshot(1:PullSnapshotRequest request)
+
+  /**
+  * Create a GroupByExecutor for a path, executing the given aggregations.
+  * @return the executorId
+  **/
+  long getGroupByExecutor(1:GroupByRequest request)
+
+  /**
+  * Fetch the group by result in the interval [startTime, endTime) from the given executor.
+  * @return the serialized AggregationResults, each is the result of one of the previously
+  * required aggregations, and their orders are the same.
+  **/
+  list<binary> getGroupByResult(1:Node header, 2:long executorId, 3:long startTime, 4:long endTime)
+
+
+  /**
+  * Pull all timeseries schemas prefixed by a given path.
+  **/
+  PullSchemaResp pullTimeSeriesSchema(1: PullSchemaRequest request)
+
+  /**
+  * Perform a previous fill and return the timevalue pair in binary.
+  **/
+  binary previousFill(1: PreviousFillRequest request)
+}
+
+service TSMetaService extends RaftService {
+  /**
+  * Node which is not leader will call this method to try to add itself into the cluster as a new node.
+  * <br>For the receiver,
+  * If the local node is leader, it'll check whether the cluster can add this new node;
+  * otherwise, the local node will transfer the request to the leader.
+  *
+  * @param node a new node that needs to be added
+  **/
+  AddNodeResponse addNode(1: Node node, 2: StartUpStatus startUpStatus)
+
+  /**
+  * Remove a node from the cluster. If the node is not in the cluster or the cluster size will
+  * less than replication number, the request will be rejected.
+  * return -1(RESPONSE_AGREE) or -3(RESPONSE_REJECT) or -9(RESPONSE_CLUSTER_TOO_SMALL)
+  **/
+  long removeNode(1: Node node)
+
+  /**
+  * When a node is removed from the cluster, if it is not the meta leader, it cannot receive
+  * the commit command by heartbeat since it has been removed, so the leader should tell it
+  * directly that it is no longer in the cluster.
+  **/
+  void exile()
+
+  TNodeStatus queryNodeStatus()
+
+  Node checkAlive()
+
+}
diff --git a/thrift/src/main/thrift/rpc.thrift b/thrift/src/main/thrift/rpc.thrift
new file mode 100644
index 0000000..64cb9ee
--- /dev/null
+++ b/thrift/src/main/thrift/rpc.thrift
@@ -0,0 +1,312 @@
+/*
+ * 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.
+ */
+namespace java org.apache.iotdb.service.rpc.thrift
+
+// The return status code and message in each response.
+struct TSStatus {
+  1: required i32 code
+  2: optional string message
+  3: optional list<TSStatus> subStatus
+}
+
+struct TSExecuteStatementResp {
+	1: required TSStatus status
+	2: optional i64 queryId
+  // Column names in select statement of SQL
+	3: optional list<string> columns
+	4: optional string operationType
+	5: optional bool ignoreTimeStamp
+  // Data type list of columns in select statement of SQL
+  6: optional list<string> dataTypeList
+  7: optional TSQueryDataSet queryDataSet
+  // for disable align statements, queryDataSet is null and nonAlignQueryDataSet is not null
+  8: optional TSQueryNonAlignDataSet nonAlignQueryDataSet
+  9: optional map<string, i32> columnNameIndexMap
+}
+
+enum TSProtocolVersion {
+  IOTDB_SERVICE_PROTOCOL_V1,
+  IOTDB_SERVICE_PROTOCOL_V2,//V2 is the first version that we can check version compatibility
+  IOTDB_SERVICE_PROTOCOL_V3,//V3 is incompatible with V2
+}
+
+struct TSOpenSessionResp {
+  1: required TSStatus status
+
+  // The protocol version that the server is using.
+  2: required TSProtocolVersion serverProtocolVersion = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V1
+
+  // Session id
+  3: optional i64 sessionId
+
+  // The configuration settings for this session.
+  4: optional map<string, string> configuration
+}
+
+// OpenSession()
+// Open a session (connection) on the server against which operations may be executed.
+struct TSOpenSessionReq {
+  1: required TSProtocolVersion client_protocol = TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3
+  2: optional string username
+  3: optional string password
+  4: optional map<string, string> configuration
+}
+
+// CloseSession()
+// Closes the specified session and frees any resources currently allocated to that session.
+// Any open operations in that session will be canceled.
+struct TSCloseSessionReq {
+  1: required i64 sessionId
+}
+
+// ExecuteStatement()
+//
+// Execute a statement.
+// The returned OperationHandle can be used to check on the status of the statement, and to fetch results once the
+// statement has finished executing.
+struct TSExecuteStatementReq {
+  // The session to execute the statement against
+  1: required i64 sessionId
+
+  // The statement to be executed (DML, DDL, SET, etc)
+  2: required string statement
+
+  // statementId
+  3: required i64 statementId
+
+  4: optional i32 fetchSize
+}
+
+struct TSExecuteBatchStatementReq{
+  // The session to execute the statement against
+  1: required i64 sessionId
+
+  // The statements to be executed (DML, DDL, SET, etc)
+  2: required list<string> statements
+}
+
+struct TSGetOperationStatusReq {
+  1: required i64 sessionId
+  // Session to run this request against
+  2: required i64 queryId
+}
+
+// CancelOperation()
+//
+// Cancels processing on the specified operation handle and frees any resources which were allocated.
+struct TSCancelOperationReq {
+  1: required i64 sessionId
+  // Operation to cancel
+  2: required i64 queryId
+}
+
+// CloseOperation()
+struct TSCloseOperationReq {
+  1: required i64 sessionId
+  2: optional i64 queryId
+  3: optional i64 statementId
+}
+
+struct TSFetchResultsReq{
+  1: required i64 sessionId
+	2: required string statement
+	3: required i32 fetchSize
+	4: required i64 queryId
+	5: required bool isAlign
+}
+
+struct TSFetchResultsResp{
+	1: required TSStatus status
+	2: required bool hasResultSet
+  3: required bool isAlign
+	4: optional TSQueryDataSet queryDataSet
+	5: optional TSQueryNonAlignDataSet nonAlignQueryDataSet
+}
+
+struct TSFetchMetadataResp{
+		1: required TSStatus status
+		2: optional string metadataInJson
+		3: optional list<string> columnsList
+		4: optional string dataType
+}
+
+struct TSFetchMetadataReq{
+    1: required i64 sessionId
+		2: required string type
+		3: optional string columnPath
+}
+
+struct TSGetTimeZoneResp {
+    1: required TSStatus status
+    2: required string timeZone
+}
+
+struct TSSetTimeZoneReq {
+    1: required i64 sessionId
+    2: required string timeZone
+}
+
+// for session
+struct TSInsertRecordReq {
+    1: required i64 sessionId
+    2: required string deviceId
+    3: required list<string> measurements
+    4: required binary values
+    5: required i64 timestamp
+    6: optional bool inferType
+}
+
+struct TSInsertTabletReq {
+    1: required i64 sessionId
+    2: required string deviceId
+    3: required list<string> measurements
+    4: required binary values
+    5: required binary timestamps
+    6: required list<i32> types
+    7: required i32 size
+}
+
+struct TSInsertTabletsReq {
+    1: required i64 sessionId
+    2: required list<string> deviceIds
+    3: required list<list<string>> measurementsList
+    4: required list<binary> valuesList
+    5: required list<binary> timestampsList
+    6: required list<list<i32>> typesList
+    7: required list<i32> sizeList
+}
+
+struct TSInsertRecordsReq {
+    1: required i64 sessionId
+    2: required list<string> deviceIds
+    3: required list<list<string>> measurementsList
+    4: required list<binary> valuesList
+    5: required list<i64> timestamps
+    6: optional bool inferType
+}
+
+struct TSDeleteDataReq {
+    1: required i64 sessionId
+    2: required list<string> paths
+    3: required i64 timestamp
+}
+
+struct TSCreateTimeseriesReq {
+  1: required i64 sessionId
+  2: required string path
+  3: required i32 dataType
+  4: required i32 encoding
+  5: required i32 compressor
+  6: optional map<string, string> props
+  7: optional map<string, string> tags
+  8: optional map<string, string> attributes
+  9: optional string measurementAlias
+}
+
+struct TSCreateMultiTimeseriesReq {
+  1: required i64 sessionId
+  2: required list<string> paths
+  3: required list<i32> dataTypes
+  4: required list<i32> encodings
+  5: required list<i32> compressors
+  6: optional list<map<string, string>> propsList
+  7: optional list<map<string, string>> tagsList
+  8: optional list<map<string, string>> attributesList
+  9: optional list<string> measurementAliasList
+}
+
+struct ServerProperties {
+	1: required string version;
+	2: required list<string> supportedTimeAggregationOperations;
+	3: required string timestampPrecision;
+}
+
+struct TSQueryDataSet{
+    // ByteBuffer for time column
+    1: required binary time
+    // ByteBuffer for each column values
+    2: required list<binary> valueList
+    // Bitmap for each column to indicate whether it is a null value
+    3: required list<binary> bitmapList
+}
+
+struct TSQueryNonAlignDataSet{
+    // ByteBuffer for each time column
+	  1: required list<binary> timeList
+	  // ByteBuffer for each column values
+    2: required list<binary> valueList
+}
+
+service TSIService {
+	TSOpenSessionResp openSession(1:TSOpenSessionReq req);
+
+	TSStatus closeSession(1:TSCloseSessionReq req);
+
+	TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req);
+
+	TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req);
+
+	TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req);
+
+	TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req);
+
+	TSFetchResultsResp fetchResults(1:TSFetchResultsReq req)
+
+	TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req)
+
+	TSStatus cancelOperation(1:TSCancelOperationReq req);
+
+	TSStatus closeOperation(1:TSCloseOperationReq req);
+
+	TSGetTimeZoneResp getTimeZone(1:i64 sessionId);
+
+	TSStatus setTimeZone(1:TSSetTimeZoneReq req);
+
+	ServerProperties getProperties();
+
+	TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup);
+
+	TSStatus createTimeseries(1:TSCreateTimeseriesReq req);
+
+	TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req);
+
+  TSStatus deleteTimeseries(1:i64 sessionId, 2:list<string> path)
+
+  TSStatus deleteStorageGroups(1:i64 sessionId, 2:list<string> storageGroup);
+
+  TSStatus insertRecord(1:TSInsertRecordReq req);
+
+  TSStatus insertTablet(1:TSInsertTabletReq req);
+
+  TSStatus insertTablets(1:TSInsertTabletsReq req);
+
+	TSStatus insertRecords(1:TSInsertRecordsReq req);
+
+	TSStatus testInsertTablet(1:TSInsertTabletReq req);
+
+  TSStatus testInsertTablets(1:TSInsertTabletsReq req);
+
+  TSStatus testInsertRecord(1:TSInsertRecordReq req);
+
+  TSStatus testInsertRecords(1:TSInsertRecordsReq req);
+
+	TSStatus deleteData(1:TSDeleteDataReq req);
+
+	i64 requestStatementId(1:i64 sessionId);
+}
diff --git a/thrift/src/main/thrift/sync.thrift b/thrift/src/main/thrift/sync.thrift
new file mode 100755
index 0000000..3e243f4
--- /dev/null
+++ b/thrift/src/main/thrift/sync.thrift
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+namespace java org.apache.iotdb.service.sync.thrift
+
+struct SyncStatus{
+  1:required i32 code
+  2:required string msg
+}
+
+// The sender and receiver need to check some info to confirm validity
+struct ConfirmInfo{
+  // check whether the ip of sender is in thw white list of receiver.
+  1:string address
+
+  // Sender needs to tell receiver its identity.
+  2:string uuid
+
+  // The partition interval of sender and receiver need to be the same.
+  3:i64 partitionInterval
+
+  // The version of sender and receiver need to be the same.
+  4:string version
+}
+
+service SyncService{
+	SyncStatus check(ConfirmInfo info)
+	SyncStatus startSync();
+	SyncStatus init(1:string storageGroupName)
+	SyncStatus syncDeletedFileName(1:string fileName)
+	SyncStatus initSyncData(1:string filename)
+	SyncStatus syncData(1:binary buff)
+	SyncStatus checkDataMD5(1:string md5)
+	SyncStatus endSync()
+}
\ No newline at end of file
diff --git a/thrift/src/pypi/README.md b/thrift/src/pypi/README.md
new file mode 100644
index 0000000..aefc22d
--- /dev/null
+++ b/thrift/src/pypi/README.md
@@ -0,0 +1,61 @@
+<!--
+
+    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.
+
+-->
+
+# Apache IoTDB
+
+[![Build Status](https://www.travis-ci.org/apache/incubator-iotdb.svg?branch=master)](https://www.travis-ci.org/apache/incubator-iotdb)
+[![codecov](https://codecov.io/gh/thulab/incubator-iotdb/branch/master/graph/badge.svg)](https://codecov.io/gh/thulab/incubator-iotdb)
+[![GitHub release](https://img.shields.io/github/release/apache/incubator-iotdb.svg)](https://github.com/apache/incubator-iotdb/releases)
+[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
+![](https://github-size-badge.herokuapp.com/apache/incubator-iotdb.svg)
+![](https://img.shields.io/github/downloads/apache/incubator-iotdb/total.svg)
+![](https://img.shields.io/badge/platform-win10%20%7C%20macox%20%7C%20linux-yellow.svg)
+![](https://img.shields.io/badge/java--language-1.8-blue.svg)
+[![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/)
+
+
+Apache IoTDB (incubating) (Database for Internet of Things) is an integrated data management engine designed for
+timeseries data. It provides users with services for data collection, storage and analysis. Due to its light-weight
+architecture, high performance and rich feature set together with its deep integration with Apache Hadoop and Spark,
+Apache IoTDB (incubating) can meet the requirements of massive data storage, high-speed data ingestion and complex data
+analysis in the IoT industrial fields.
+
+
+# Apache IoTDB Python Client API
+
+Using the package, you can write data to IoTDB, read data from IoTDB and maintain the schema of IoTDB.
+
+## Requirements
+
+You have to install thrift (>=0.13) before using the package.
+
+## How to use (Example)
+
+You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/incubator-iotdb/blob/release%2F0.9.0/client-py/src/client_example.py)
+
+# DISCLAIMER
+
+Apache IoTDB is an effort undergoing incubation at The Apache Software Foundation (ASF).
+Incubation is required of all newly accepted projects until a further review indicates that the
+infrastructure, communications, and decision making process have stabilized in a manner consistent
+with other successful ASF projects. While incubation status is not necessarily a reflection of the
+completeness or stability of the code, it does indicate that the project has yet to be fully
+endorsed by the ASF.
\ No newline at end of file
diff --git a/thrift/src/pypi/setup.py b/thrift/src/pypi/setup.py
new file mode 100644
index 0000000..29b0124
--- /dev/null
+++ b/thrift/src/pypi/setup.py
@@ -0,0 +1,55 @@
+#  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.
+#
+
+import setuptools
+import io
+
+
+try:
+    with io.open('README.md', encoding='utf-8') as f:
+        long_description = f.read()
+except FileNotFoundError:
+    long_description = ''
+
+
+print(long_description)
+
+setuptools.setup(
+    name="apache-iotdb", # Replace with your own username
+    version="0.11.0",
+    author=" Apache Software Foundation",
+    author_email="dev@iotdb.apache.org",
+    description="Apache IoTDB (incubating) client API",
+    long_description=long_description,
+    long_description_content_type="text/markdown",
+    url="https://github.com/apache/incubator-iotdb",
+    packages=setuptools.find_packages(),
+    install_requires=[
+              'thrift>=0.13.0',
+          ],
+    classifiers=[
+        "Programming Language :: Python :: 3",
+        "License :: OSI Approved :: Apache Software License",
+        "Operating System :: OS Independent",
+        "Topic :: Software Development :: Libraries",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+    ],
+    python_requires='>=3.7',
+    license='Apache License, Version 2.0',
+    website='https://iotdb.apache.org',
+)