You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/05/04 09:51:40 UTC

[iotdb] branch research/descend updated: Research Code about Descend Bit-Packing (#5774)

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

haonan pushed a commit to branch research/descend
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/research/descend by this push:
     new 8011f410a6 Research Code about Descend Bit-Packing (#5774)
8011f410a6 is described below

commit 8011f410a60aee62b4901101204c9949068390a0
Author: Haoyu Wang <37...@users.noreply.github.com>
AuthorDate: Wed May 4 17:51:34 2022 +0800

    Research Code about Descend Bit-Packing (#5774)
    
    * Add the method size() to Row in UDF
    
    * [IOTDB-3025] add permission check (#5699)
    
    Co-authored-by: renyuhua <ry...@163.com>
    Co-authored-by: Jinrui.Zhang <xi...@gmail.com>
    
    * [IOTDB-3046] Fix port binding error in ClientManagerTest (#5736)
    
    * [IOTDB-3018] Fix compation bugs on handling deleted target file and service shutdown deadlock (#5693)
    
    * [IOTDB-3026] fix cannot load tsfile correctly after restart iotdb (#5702)
    
    * [IOTDB-3039] Add standalone recovery (#5731)
    
    * add standalone recovery
    
    * add standalone recovery
    
    * add standalone recovery
    
    * add standalone recovery
    
    * add standalone recovery
    
    * add standalone recovery
    
    * add standalone recovery
    
    * [IOTDB-2993] Support IN, LIKE, and REGEXP expressions in Transform Operator (#5739)
    
    * [IOTDB-2803] support AlterTimeseries sql (#5735)
    
    * [IoTDB-2991] Equal size bucket sampling UDFs: EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE (#5682)
    
    * Move time partition calculation from StorageEngine to StorageEngineV2 (#5708)
    
    * [IOTDB-3020][IOTDB-3022]Multi-thread MLog recovery & Fix SchemaFile dirty page loses (#5695)
    
    * [IOTDB-3042] ConfigNode stop process (#5755)
    
    * fix restart lossing data when sender shutdonws with data remain in memtable (#5740)
    
    * Finish Descend Encoding
    
    * [IOTDB-3048] Refactor binary transformer (#5744)
    
    Co-authored-by: Steve Yurong Su <ro...@apache.org>
    
    * [IOTDB-3056] triggers support multi-level documents (#5759)
    
    Co-authored-by: wenhua.gongwh <we...@alibaba-inc.com>
    
    * [IOTDB-2972] implement local sink/source handle (#5732)
    
    * move columnToTsBlockIndexMap from LogicalPlanner to DistributionPlanner (#5733)
    
    * [IOTDB-2981] Modify antlr, IoTDBSqlVisitor and ASTVisitor for new syntax convention (#5696)
    
    changelist:
    
    node name can not be STRING_LITERAL now.
    change propertyClause to attributePair. Attributes in tag, attribute, udf, trigger, pipe...... are attributePair now.
    attributeKey and attributeValue can be both identifer and constant.
    remove suffixPathCanInExpr, nodeNameCanInExpr.
    change suffixPath in expression to FullPathInExpression.
    alias can be both identifier and constant now.
    user, role, pipe, pipeSink are identifier now.
    specified usage of identifier and STRING_LITERAL in user docs.
    
    * rename package of mpp and confignode (#5758)
    
    As this PR is used to change packages and there is no code level change, we merge it once the CI succeed
    
    * [IOTDB-3075] RatisConsensus UUID bugfix (#5765)
    
    * consensus group to ratis id bugfix
    
    * fix
    
    * format
    
    * [IOTDB-2870] Unit test of spliting insert node in new cluster (#5769)
    
    * Add SyncThriftClientErrorHandler for proxy to clean the code (#5710)
    
    * [IOTDB-2993][Bugfix] Support IN, LIKE, and REGEXP expressions in Transform Operator (#5766)
    
    * Modify Descend with choosing beta adaptively
    
    Co-authored-by: 任宇华 <79...@users.noreply.github.com>
    Co-authored-by: renyuhua <ry...@163.com>
    Co-authored-by: Jinrui.Zhang <xi...@gmail.com>
    Co-authored-by: BaiJian <er...@hotmail.com>
    Co-authored-by: Chen YZ <43...@users.noreply.github.com>
    Co-authored-by: SzyWilliam <48...@users.noreply.github.com>
    Co-authored-by: Steve Yurong Su <ro...@apache.org>
    Co-authored-by: Yifu Zhou <ef...@outlook.com>
    Co-authored-by: AACEPT <34...@users.noreply.github.com>
    Co-authored-by: Haonan <hh...@outlook.com>
    Co-authored-by: ZhaoXin <x_...@163.com>
    Co-authored-by: YongzaoDan <33...@users.noreply.github.com>
    Co-authored-by: yschengzi <87...@users.noreply.github.com>
    Co-authored-by: flashzxi <39...@users.noreply.github.com>
    Co-authored-by: gongning <is...@gmail.com>
    Co-authored-by: wenhua.gongwh <we...@alibaba-inc.com>
    Co-authored-by: Zhong Wang <wa...@alibaba-inc.com>
    Co-authored-by: liuminghui233 <36...@users.noreply.github.com>
    Co-authored-by: Liao Lanyu <48...@users.noreply.github.com>
    Co-authored-by: Jialin Qiao <qj...@mails.tsinghua.edu.cn>
    Co-authored-by: Mrquan <50...@users.noreply.github.com>
    Co-authored-by: JiaXin Zhang <37...@users.noreply.github.com>
---
 README.md                                          |    2 +-
 README_ZH.md                                       |    2 +-
 .../apache/iotdb/db/qp/sql/InfluxDBSqlParser.g4    |    9 +-
 .../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4   |  139 +-
 .../antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4  |   29 +-
 .../iotdb/cluster/metadata/CSchemaProcessor.java   |    6 +-
 .../cluster/query/ClusterDataQueryExecutor.java    |    6 +-
 .../query/aggregate/ClusterAggregateExecutor.java  |    2 +-
 .../cluster/query/fill/ClusterFillExecutor.java    |    2 +-
 .../groupby/ClusterGroupByVFilterDataSet.java      |    2 +-
 .../cluster/query/reader/ClusterReaderFactory.java |    3 +-
 .../cluster/query/reader/ClusterTimeGenerator.java |    4 +-
 .../cluster/log/snapshot/FileSnapshotTest.java     |   20 +-
 .../log/snapshot/PartitionedSnapshotTest.java      |    6 +-
 .../cluster/log/snapshot/PullSnapshotTaskTest.java |    2 +-
 .../src/assembly/resources/sbin/stop-confignode.sh |   15 +-
 .../iotdb/confignode/client/AsyncClientPool.java   |    8 -
 .../confignode/manager/ClusterSchemaManager.java   |    3 +-
 .../iotdb/confignode/manager/ConfigManager.java    |   13 +-
 .../iotdb/confignode/manager/LoadManager.java      |   34 +
 .../apache/iotdb/confignode/manager/Manager.java   |   12 +
 .../confignode/manager/PermissionManager.java      |   11 +
 .../iotdb/confignode/persistence/AuthorInfo.java   |  128 +-
 .../confignode/persistence/ClusterSchemaInfo.java  |   10 +
 .../iotdb/confignode/persistence/DataNodeInfo.java |   14 +-
 .../confignode/persistence/PartitionInfo.java      |   23 +-
 .../iotdb/confignode/service/ConfigNode.java       |   27 +-
 .../confignode/service/balancer/LoadBalancer.java  |   37 -
 .../thrift/ConfigNodeRPCServiceProcessor.java      |    7 +
 .../thrift/ConfigNodeRPCServiceProcessorTest.java  |   22 +
 .../utils/ConfigNodeEnvironmentUtils.java          |  134 --
 .../org/apache/iotdb/consensus/ratis/Utils.java    |   76 +-
 .../consensus/standalone/StandAloneConsensus.java  |   50 +-
 .../iotdb/consensus/standalone/RecoveryTest.java   |   94 +
 .../standalone/StandAloneConsensusTest.java        |    4 +-
 .../Data-Concept/Data-Model-and-Terminology.md     |   35 +-
 docs/UserGuide/Process-Data/Triggers.md            |    9 +-
 docs/UserGuide/Query-Data/Select-Expression.md     |   74 +
 docs/UserGuide/Query-Data/Without-Null.md          |    8 +-
 docs/UserGuide/Reference/Syntax-Conventions.md     |  453 +++-
 .../Data-Concept/Data-Model-and-Terminology.md     |   30 +-
 docs/zh/UserGuide/Process-Data/Triggers.md         |    7 +-
 docs/zh/UserGuide/Query-Data/Select-Expression.md  |   76 +
 docs/zh/UserGuide/Query-Data/Without-Null.md       |    8 +-
 docs/zh/UserGuide/Reference/Syntax-Conventions.md  |  492 ++++-
 .../org/apache/iotdb/DataMigrationExample.java     |    2 +-
 .../apache/iotdb/db/integration/IoTDBAliasIT.java  |    2 +-
 .../org/apache/iotdb/db/integration/IoTDBAsIT.java |    2 +-
 .../db/integration/IoTDBCreateTimeseriesIT.java    |   18 +-
 .../iotdb/db/integration/IoTDBDeletionIT.java      |   16 +-
 .../iotdb/db/integration/IoTDBExecuteBatchIT.java  |    6 +-
 .../db/integration/IoTDBFloatPrecisionIT.java      |    2 +-
 .../iotdb/db/integration/IoTDBInsertNaNIT.java     |    2 +-
 .../iotdb/db/integration/IoTDBMetadataFetchIT.java |    8 +-
 .../iotdb/db/integration/IoTDBNestedQueryIT.java   |   23 +
 .../iotdb/db/integration/IoTDBQuotedPathIT.java    |   24 +-
 .../iotdb/db/integration/IoTDBSimpleQueryIT.java   |   29 +-
 .../integration/IoTDBSortedShowTimeseriesIT.java   |   38 +-
 .../db/integration/IoTDBSyntaxConventionIT.java    |  468 -----
 .../IoTDBSyntaxConventionIdentifierIT.java         |  838 ++++++++
 .../IoTDBSyntaxConventionStringLiteralIT.java      |  764 +++++++
 .../iotdb/db/integration/IoTDBTagAlterIT.java      |   46 +-
 .../apache/iotdb/db/integration/IoTDBTagIT.java    |  220 +-
 .../db/integration/IoTDBUDTFBuiltinFunctionIT.java |  138 ++
 .../aggregation/IoTDBAggregationIT.java            |    5 +
 .../db/integration/aligned/IoTDBDeletionIT.java    |   16 +-
 .../db/integration/sync/IoTDBSyncSenderIT.java     |   56 +-
 .../versionadaption/IoTDBDDLVersionAdaptionIT.java |    6 +-
 .../IoTDBSyntaxConventionVersionAdaptionIT.java    |  100 -
 .../IoTDBWithoutNullAllFilterIT.java               |   16 +-
 .../IoTDBWithoutNullAnyFilterIT.java               |    8 +-
 .../session/IoTDBSessionSyntaxConventionIT.java    |   39 +-
 node-commons/pom.xml                               |    6 +
 .../apache/iotdb/commons/client/ClientManager.java |    4 +-
 .../client/sync/SyncConfigNodeIServiceClient.java  |   20 +-
 .../sync/SyncDataNodeDataBlockServiceClient.java   |   20 +-
 .../sync/SyncDataNodeInternalServiceClient.java    |   17 +-
 .../commons/client/sync/SyncThriftClient.java      |   25 +
 .../sync/SyncThriftClientWithErrorHandler.java     |   64 +
 .../iotdb/commons/partition/DataPartition.java     |    9 +
 .../iotdb/commons/partition/SchemaPartition.java   |    9 +
 .../apache/iotdb/commons/ClientManagerTest.java    |   57 +-
 server/file-changelists/role-changelist.md         |   34 -
 .../resources/conf/iotdb-engine.properties         |    4 -
 .../org/apache/iotdb/db/auth/AuthorityChecker.java |  138 +-
 .../db/auth/authorizer/AuthorizerManager.java      |   46 +-
 .../db/auth/authorizer/ClusterAuthorizer.java      |   63 +-
 .../apache/iotdb/db/client/ConfigNodeClient.java   |   16 +
 .../java/org/apache/iotdb/db/conf/IoTDBConfig.java |   13 +-
 .../org/apache/iotdb/db/conf/IoTDBDescriptor.java  |    5 -
 .../consensus/statemachine/BaseStateMachine.java   |    2 +-
 .../statemachine/DataRegionStateMachine.java       |   16 +-
 .../statemachine/SchemaRegionStateMachine.java     |    6 +-
 .../apache/iotdb/db/engine/StorageEngineV2.java    |    4 +-
 .../engine/compaction/CompactionTaskManager.java   |   45 +-
 .../compaction/cross/CrossSpaceCompactionTask.java |    2 +-
 .../compaction/inner/InnerSpaceCompactionTask.java |   34 +-
 .../utils/SingleSeriesCompactionExecutor.java      |    2 +-
 .../impl/ReadPointCompactionPerformer.java         |    5 +-
 .../compaction/task/AbstractCompactionTask.java    |   19 +-
 .../compaction/task/CompactionTaskSummary.java     |   32 +
 .../iotdb/db/engine/memtable/AbstractMemTable.java |    4 +-
 .../apache/iotdb/db/engine/memtable/IMemTable.java |    4 +-
 .../iotdb/db/engine/modification/Modification.java |    2 +-
 .../selectinto/InsertTabletPlansIterator.java      |    2 +-
 .../iotdb/db/engine/storagegroup/DataRegion.java   |   17 +-
 .../db/engine/storagegroup/TsFileManager.java      |    2 +-
 .../db/engine/storagegroup/TsFileProcessor.java    |    4 +-
 .../metadata/SeriesOverflowException.java          |   33 +
 .../exception/sql/StatementAnalyzeException.java   |    2 +-
 .../db/metadata/cache/DataNodeSchemaCache.java     |    4 +-
 .../db/metadata/idtable/IDTableHashmapImpl.java    |    9 +-
 .../mtree/store/disk/MTreeFlushTaskManager.java    |    6 +-
 .../mtree/store/disk/MTreeReleaseTaskManager.java  |    3 +-
 .../mtree/store/disk/schemafile/SchemaFile.java    |   73 +-
 .../apache/iotdb/db/metadata/path/AlignedPath.java |   10 +-
 .../iotdb/db/metadata/path/MeasurementPath.java    |   13 +-
 .../apache/iotdb/db/metadata/path/PartialPath.java |   32 +-
 .../db/metadata/schemaregion/SchemaEngine.java     |   73 +-
 .../schemaregion/SchemaRegionMemoryImpl.java       |    9 +-
 .../schemaregion/SchemaRegionSchemaFileImpl.java   |   53 +-
 .../iotdb/db/metadata/utils/MetaFormatUtils.java   |   17 +-
 .../apache/iotdb/db/metadata/utils/MetaUtils.java  |   82 +-
 .../db/metadata/utils/ResourceByPathUtils.java     |    9 +-
 .../metadata/visitor/SchemaExecutionVisitor.java   |   10 +-
 .../iotdb/db/mpp/buffer/DataBlockManager.java      |  387 ----
 .../iotdb/db/mpp/buffer/DataBlockService.java      |  137 --
 .../iotdb/db/mpp/buffer/DataBlockServiceMBean.java |   34 -
 .../mpp/buffer/DataBlockServiceThriftHandler.java  |   44 -
 .../iotdb/db/mpp/buffer/IDataBlockManager.java     |   73 -
 .../db/mpp/buffer/IDataBlockManagerCallback.java   |   24 -
 .../apache/iotdb/db/mpp/buffer/ISinkHandle.java    |   73 -
 .../apache/iotdb/db/mpp/buffer/ISourceHandle.java  |   57 -
 .../org/apache/iotdb/db/mpp/buffer/SinkHandle.java |  401 ----
 .../apache/iotdb/db/mpp/buffer/SourceHandle.java   |  431 ----
 .../iotdb/db/mpp/buffer/TsBlockSerdeFactory.java   |   31 -
 .../iotdb/db/mpp/common/MPPQueryContext.java       |    2 +-
 .../org/apache/iotdb/db/mpp/common/QueryId.java    |    2 +-
 .../iotdb/db/mpp/common/ResultNodeContext.java     |    2 +-
 .../db/mpp/common/filter/BasicFilterType.java      |    4 +-
 .../db/mpp/common/filter/BasicFunctionFilter.java  |    4 +-
 .../iotdb/db/mpp/common/filter/FunctionFilter.java |    2 +-
 .../iotdb/db/mpp/common/filter/InFilter.java       |    2 +-
 .../iotdb/db/mpp/common/filter/LikeFilter.java     |    2 +-
 .../iotdb/db/mpp/common/filter/QueryFilter.java    |    4 +-
 .../iotdb/db/mpp/common/filter/RegexpFilter.java   |    2 +-
 .../apache/iotdb/db/mpp/execution/Coordinator.java |  147 --
 .../apache/iotdb/db/mpp/execution/DataDriver.java  |  193 --
 .../iotdb/db/mpp/execution/DataDriverContext.java  |   63 -
 .../org/apache/iotdb/db/mpp/execution/Driver.java  |  452 ----
 .../iotdb/db/mpp/execution/DriverContext.java      |   55 -
 .../iotdb/db/mpp/execution/ExecutionResult.java    |   32 -
 .../iotdb/db/mpp/execution/FragmentInfo.java       |   44 -
 .../db/mpp/execution/FragmentInstanceContext.java  |  163 --
 .../mpp/execution/FragmentInstanceExecution.java   |  118 --
 .../execution/FragmentInstanceFailureListener.java |   25 -
 .../db/mpp/execution/FragmentInstanceInfo.java     |   40 -
 .../db/mpp/execution/FragmentInstanceManager.java  |  230 ---
 .../db/mpp/execution/FragmentInstanceState.java    |   80 -
 .../execution/FragmentInstanceStateMachine.java    |  182 --
 .../iotdb/db/mpp/execution/FragmentState.java      |   71 -
 .../org/apache/iotdb/db/mpp/execution/IDriver.java |   71 -
 .../iotdb/db/mpp/execution/IQueryExecution.java    |   44 -
 .../iotdb/db/mpp/execution/QueryExecution.java     |  325 ---
 .../iotdb/db/mpp/execution/QueryStateMachine.java  |    1 +
 .../iotdb/db/mpp/execution/SchemaDriver.java       |   45 -
 .../db/mpp/execution/SchemaDriverContext.java      |   37 -
 .../mpp/execution/config/AuthorizerConfigTask.java |   76 -
 .../db/mpp/execution/config/ConfigExecution.java   |  161 --
 .../db/mpp/execution/config/ConfigTaskResult.java  |   61 -
 .../db/mpp/execution/config/ConfigTaskVisitor.java |   68 -
 .../execution/config/CountStorageGroupTask.java    |   97 -
 .../iotdb/db/mpp/execution/config/IConfigTask.java |   26 -
 .../mpp/execution/config/SetStorageGroupTask.java  |   97 -
 .../mpp/execution/config/ShowStorageGroupTask.java |  113 -
 .../execution/datatransfer/DataBlockManager.java   |  471 +++++
 .../execution/datatransfer/DataBlockService.java   |  137 ++
 .../datatransfer/DataBlockServiceMBean.java        |   34 +
 .../DataBlockServiceThriftHandler.java             |   44 +
 .../execution/datatransfer/IDataBlockManager.java  |   85 +
 .../datatransfer/IDataBlockManagerCallback.java    |   24 +
 .../db/mpp/execution/datatransfer/ISinkHandle.java |   73 +
 .../mpp/execution/datatransfer/ISourceHandle.java  |   57 +
 .../execution/datatransfer/LocalSinkHandle.java    |  146 ++
 .../execution/datatransfer/LocalSourceHandle.java  |  125 ++
 .../execution/datatransfer/SharedTsBlockQueue.java |  152 ++
 .../db/mpp/execution/datatransfer/SinkHandle.java  |  371 ++++
 .../mpp/execution/datatransfer/SourceHandle.java   |  400 ++++
 .../datatransfer/TsBlockSerdeFactory.java          |   31 +
 .../iotdb/db/mpp/execution/driver/DataDriver.java  |  193 ++
 .../db/mpp/execution/driver/DataDriverContext.java |   64 +
 .../iotdb/db/mpp/execution/driver/Driver.java      |  452 ++++
 .../db/mpp/execution/driver/DriverContext.java     |   56 +
 .../iotdb/db/mpp/execution/driver/IDriver.java     |   71 +
 .../db/mpp/execution/driver/SchemaDriver.java      |   45 +
 .../mpp/execution/driver/SchemaDriverContext.java  |   38 +
 .../db/mpp/execution/fragment/FragmentInfo.java    |   44 +
 .../fragment/FragmentInstanceContext.java          |  164 ++
 .../fragment/FragmentInstanceExecution.java        |  119 ++
 .../fragment/FragmentInstanceFailureListener.java  |   25 +
 .../execution/fragment/FragmentInstanceInfo.java   |   40 +
 .../fragment/FragmentInstanceManager.java          |  232 +++
 .../execution/fragment/FragmentInstanceState.java  |   80 +
 .../fragment/FragmentInstanceStateMachine.java     |  183 ++
 .../db/mpp/execution/fragment/FragmentState.java   |   71 +
 .../mpp/execution/memory/LocalMemoryManager.java   |   43 +
 .../iotdb/db/mpp/execution/memory/MemoryPool.java  |  202 ++
 .../iotdb/db/mpp/execution/operator/Operator.java  |   55 +
 .../db/mpp/execution/operator/OperatorContext.java |   54 +
 .../operator/process/AggregateOperator.java        |   57 +
 .../operator/process/DeviceViewOperator.java       |  152 ++
 .../execution/operator/process/FillOperator.java   |   56 +
 .../operator/process/FilterNullOperator.java       |   57 +
 .../execution/operator/process/FilterOperator.java |  155 ++
 .../operator/process/GroupByLevelOperator.java     |   57 +
 .../execution/operator/process/LimitOperator.java  |   80 +
 .../execution/operator/process/OffsetOperator.java |   57 +
 .../operator/process/ProcessOperator.java          |   24 +
 .../execution/operator/process/SortOperator.java   |   57 +
 .../operator/process/TimeJoinOperator.java         |  221 ++
 .../operator/process/TransformOperator.java        |  241 +++
 .../operator/process/merge/AscTimeComparator.java  |   33 +
 .../operator/process/merge/ColumnMerger.java       |   60 +
 .../operator/process/merge/DescTimeComparator.java |   33 +
 .../operator/process/merge/MultiColumnMerger.java  |   96 +
 .../operator/process/merge/SingleColumnMerger.java |   91 +
 .../operator/process/merge/TimeComparator.java     |   28 +
 .../operator/schema/CountMergeOperator.java        |  133 ++
 .../operator/schema/DevicesCountOperator.java      |   90 +
 .../operator/schema/DevicesSchemaScanOperator.java |   83 +
 .../schema/LevelTimeSeriesCountOperator.java       |  100 +
 .../operator/schema/SchemaFetchOperator.java       |  128 ++
 .../operator/schema/SchemaMergeOperator.java       |   94 +
 .../operator/schema/SchemaScanOperator.java        |  112 +
 .../operator/schema/TimeSeriesCountOperator.java   |   90 +
 .../schema/TimeSeriesSchemaScanOperator.java       |  125 ++
 .../operator/sink/FragmentSinkOperator.java        |   66 +
 .../mpp/execution/operator/sink/SinkOperator.java  |   43 +
 .../operator/source/AlignedSeriesScanUtil.java     |   85 +
 .../operator/source/DataSourceOperator.java        |   26 +
 .../operator/source/ExchangeOperator.java          |   86 +
 .../source/SeriesAggregateScanOperator.java        |  476 +++++
 .../operator/source/SeriesScanOperator.java        |  153 ++
 .../execution/operator/source/SeriesScanUtil.java  | 1426 +++++++++++++
 .../execution/operator/source/SourceOperator.java  |   27 +
 .../execution/schedule/AbstractDriverThread.java   |   71 +
 .../db/mpp/execution/schedule/DriverScheduler.java |  357 ++++
 .../mpp/execution/schedule/DriverTaskThread.java   |   85 +
 .../schedule/DriverTaskTimeoutSentinelThread.java  |   56 +
 .../mpp/execution/schedule/ExecutionContext.java   |   46 +
 .../schedule/FragmentInstanceAbortedException.java |   35 +
 .../mpp/execution/schedule/IDriverScheduler.java   |   61 +
 .../db/mpp/execution/schedule/ITaskScheduler.java  |   72 +
 .../iotdb/db/mpp/execution/schedule/queue/ID.java  |   22 +
 .../schedule/queue/IDIndexedAccessible.java        |   48 +
 .../schedule/queue/IndexedBlockingQueue.java       |  201 ++
 .../execution/schedule/queue/L1PriorityQueue.java  |  102 +
 .../execution/schedule/queue/L2PriorityQueue.java  |  129 ++
 .../db/mpp/execution/schedule/task/DriverTask.java |  217 ++
 .../mpp/execution/schedule/task/DriverTaskID.java  |   68 +
 .../execution/schedule/task/DriverTaskStatus.java  |   37 +
 .../scheduler/AbstractFragInsStateTracker.java     |   97 -
 .../mpp/execution/scheduler/ClusterScheduler.java  |  159 --
 .../scheduler/FixedRateFragInsStateTracker.java    |   86 -
 .../scheduler/FragInstanceDispatchResult.java      |   32 -
 .../scheduler/IFragInstanceDispatcher.java         |   37 -
 .../scheduler/IFragInstanceStateTracker.java       |   26 -
 .../mpp/execution/scheduler/IQueryTerminator.java  |   26 -
 .../db/mpp/execution/scheduler/IScheduler.java     |   40 -
 .../scheduler/SimpleFragInstanceDispatcher.java    |  105 -
 .../execution/scheduler/SimpleQueryTerminator.java |   99 -
 .../execution/scheduler/StandaloneScheduler.java   |  113 -
 .../iotdb/db/mpp/memory/LocalMemoryManager.java    |   43 -
 .../org/apache/iotdb/db/mpp/memory/MemoryPool.java |  202 --
 .../org/apache/iotdb/db/mpp/operator/Operator.java |   55 -
 .../iotdb/db/mpp/operator/OperatorContext.java     |   54 -
 .../db/mpp/operator/process/AggregateOperator.java |   57 -
 .../mpp/operator/process/DeviceViewOperator.java   |  152 --
 .../db/mpp/operator/process/FillOperator.java      |   56 -
 .../mpp/operator/process/FilterNullOperator.java   |   57 -
 .../db/mpp/operator/process/FilterOperator.java    |  155 --
 .../mpp/operator/process/GroupByLevelOperator.java |   57 -
 .../db/mpp/operator/process/LimitOperator.java     |   80 -
 .../db/mpp/operator/process/OffsetOperator.java    |   57 -
 .../db/mpp/operator/process/ProcessOperator.java   |   24 -
 .../db/mpp/operator/process/SortOperator.java      |   57 -
 .../db/mpp/operator/process/TimeJoinOperator.java  |  221 --
 .../db/mpp/operator/process/TransformOperator.java |  241 ---
 .../operator/process/merge/AscTimeComparator.java  |   33 -
 .../mpp/operator/process/merge/ColumnMerger.java   |   60 -
 .../operator/process/merge/DescTimeComparator.java |   33 -
 .../operator/process/merge/MultiColumnMerger.java  |   96 -
 .../operator/process/merge/SingleColumnMerger.java |   91 -
 .../mpp/operator/process/merge/TimeComparator.java |   28 -
 .../db/mpp/operator/schema/CountMergeOperator.java |  133 --
 .../mpp/operator/schema/DevicesCountOperator.java  |   90 -
 .../operator/schema/DevicesSchemaScanOperator.java |   83 -
 .../schema/LevelTimeSeriesCountOperator.java       |  100 -
 .../mpp/operator/schema/SchemaFetchOperator.java   |  128 --
 .../mpp/operator/schema/SchemaMergeOperator.java   |   94 -
 .../db/mpp/operator/schema/SchemaScanOperator.java |  112 -
 .../operator/schema/TimeSeriesCountOperator.java   |   90 -
 .../schema/TimeSeriesSchemaScanOperator.java       |  125 --
 .../db/mpp/operator/sink/FragmentSinkOperator.java |   66 -
 .../iotdb/db/mpp/operator/sink/SinkOperator.java   |   43 -
 .../mpp/operator/source/AlignedSeriesScanUtil.java |   85 -
 .../db/mpp/operator/source/DataSourceOperator.java |   26 -
 .../db/mpp/operator/source/ExchangeOperator.java   |   86 -
 .../source/SeriesAggregateScanOperator.java        |  476 -----
 .../db/mpp/operator/source/SeriesScanOperator.java |  153 --
 .../db/mpp/operator/source/SeriesScanUtil.java     | 1421 -------------
 .../db/mpp/operator/source/SourceOperator.java     |   27 -
 .../org/apache/iotdb/db/mpp/plan/Coordinator.java  |  150 ++
 .../apache/iotdb/db/mpp/plan/analyze/Analysis.java |  123 ++
 .../apache/iotdb/db/mpp/plan/analyze/Analyzer.java |  522 +++++
 .../mpp/plan/analyze/ClusterPartitionFetcher.java  |  604 ++++++
 .../db/mpp/plan/analyze/ClusterSchemaFetcher.java  |  121 ++
 .../mpp/plan/analyze/FakePartitionFetcherImpl.java |  158 ++
 .../db/mpp/plan/analyze/FakeSchemaFetcherImpl.java |   99 +
 .../db/mpp/plan/analyze/IPartitionFetcher.java     |   43 +
 .../iotdb/db/mpp/plan/analyze/ISchemaFetcher.java  |   44 +
 .../iotdb/db/mpp/plan/analyze/QueryType.java       |   24 +
 .../iotdb/db/mpp/plan/analyze/SchemaValidator.java |   57 +
 .../plan/analyze/StandalonePartitionFetcher.java   |  127 ++
 .../mpp/plan/analyze/StandaloneSchemaFetcher.java  |   89 +
 .../iotdb/db/mpp/plan/analyze/TypeProvider.java    |   77 +
 .../iotdb/db/mpp/plan/constant/FilterConstant.java |  103 +
 .../iotdb/db/mpp/plan/constant/StatementType.java  |  139 ++
 .../db/mpp/plan/execution/ExecutionResult.java     |   32 +
 .../db/mpp/plan/execution/IQueryExecution.java     |   44 +
 .../db/mpp/plan/execution/QueryExecution.java      |  328 +++
 .../execution/config/AuthorizerConfigTask.java     |   76 +
 .../mpp/plan/execution/config/ConfigExecution.java |  161 ++
 .../plan/execution/config/ConfigTaskResult.java    |   61 +
 .../plan/execution/config/ConfigTaskVisitor.java   |   68 +
 .../execution/config/CountStorageGroupTask.java    |   97 +
 .../db/mpp/plan/execution/config/IConfigTask.java  |   26 +
 .../plan/execution/config/SetStorageGroupTask.java |   97 +
 .../execution/config/ShowStorageGroupTask.java     |  113 +
 .../db/mpp/plan/optimization/PlanOptimizer.java    |   26 +
 .../iotdb/db/mpp/plan/parser/ASTVisitor.java       | 2175 ++++++++++++++++++++
 .../db/mpp/plan/parser/StatementGenerator.java     |  409 ++++
 .../db/mpp/plan/planner/DistributionPlanner.java   |  567 +++++
 .../mpp/plan/planner/IFragmentParallelPlaner.java  |   38 +
 .../db/mpp/plan/planner/LocalExecutionPlanner.java |  584 ++++++
 .../db/mpp/plan/planner/LogicalPlanBuilder.java    |  226 ++
 .../iotdb/db/mpp/plan/planner/LogicalPlanner.java  |  388 ++++
 .../planner/SimpleFragmentParallelPlanner.java     |  146 ++
 .../plan/planner/WriteFragmentParallelPlanner.java |   73 +
 .../plan/planner/plan/DistributedQueryPlan.java    |   57 +
 .../db/mpp/plan/planner/plan/FragmentInstance.java |  177 ++
 .../db/mpp/plan/planner/plan/LogicalQueryPlan.java |   45 +
 .../db/mpp/plan/planner/plan/PlanFragment.java     |  156 ++
 .../iotdb/db/mpp/plan/planner/plan/SubPlan.java    |   69 +
 .../plan/planner/plan/node/PlanGraphPrinter.java   |  309 +++
 .../db/mpp/plan/planner/plan/node/PlanNode.java    |  118 ++
 .../db/mpp/plan/planner/plan/node/PlanNodeId.java  |   61 +
 .../mpp/plan/planner/plan/node/PlanNodeType.java   |  197 ++
 .../mpp/plan/planner/plan/node/PlanNodeUtil.java   |  116 ++
 .../db/mpp/plan/planner/plan/node/PlanVisitor.java |  184 ++
 .../planner/plan/node/SimplePlanNodeRewriter.java  |   48 +
 .../mpp/plan/planner/plan/node/WritePlanNode.java  |   36 +
 .../metedata/read/AbstractSchemaMergeNode.java     |   61 +
 .../node/metedata/read/CountSchemaMergeNode.java   |   54 +
 .../plan/node/metedata/read/DevicesCountNode.java  |   68 +
 .../node/metedata/read/DevicesSchemaScanNode.java  |  110 +
 .../metedata/read/LevelTimeSeriesCountNode.java    |   98 +
 .../plan/node/metedata/read/SchemaFetchNode.java   |   78 +
 .../plan/node/metedata/read/SchemaScanNode.java    |  155 ++
 .../node/metedata/read/SeriesSchemaMergeNode.java  |   60 +
 .../node/metedata/read/TimeSeriesCountNode.java    |   68 +
 .../metedata/read/TimeSeriesSchemaScanNode.java    |  143 ++
 .../node/metedata/write/AlterTimeSeriesNode.java   |  298 +++
 .../write/CreateAlignedTimeSeriesNode.java         |  379 ++++
 .../node/metedata/write/CreateTimeSeriesNode.java  |  332 +++
 .../planner/plan/node/process/AggregationNode.java |  186 ++
 .../planner/plan/node/process/DeviceMergeNode.java |  149 ++
 .../planner/plan/node/process/DeviceViewNode.java  |  166 ++
 .../planner/plan/node/process/ExchangeNode.java    |  209 ++
 .../plan/planner/plan/node/process/FillNode.java   |  126 ++
 .../plan/planner/plan/node/process/FilterNode.java |  115 ++
 .../planner/plan/node/process/FilterNullNode.java  |  128 ++
 .../plan/node/process/GroupByLevelNode.java        |  172 ++
 .../planner/plan/node/process/GroupByTimeNode.java |  165 ++
 .../plan/planner/plan/node/process/LimitNode.java  |  128 ++
 .../plan/planner/plan/node/process/OffsetNode.java |  119 ++
 .../planner/plan/node/process/ProcessNode.java     |   29 +
 .../planner/plan/node/process/ProjectNode.java     |  115 ++
 .../plan/planner/plan/node/process/SortNode.java   |  119 ++
 .../planner/plan/node/process/TimeJoinNode.java    |  135 ++
 .../planner/plan/node/sink/FragmentSinkNode.java   |  188 ++
 .../mpp/plan/planner/plan/node/sink/SinkNode.java  |   31 +
 .../source/AlignedSeriesAggregationScanNode.java   |  267 +++
 .../plan/node/source/AlignedSeriesScanNode.java    |  264 +++
 .../node/source/SeriesAggregationScanNode.java     |  317 +++
 .../planner/plan/node/source/SeriesScanNode.java   |  312 +++
 .../plan/planner/plan/node/source/SourceNode.java  |   36 +
 .../planner/plan/node/write/BatchInsertNode.java   |   40 +
 .../plan/node/write/InsertMultiTabletsNode.java    |  279 +++
 .../plan/planner/plan/node/write/InsertNode.java   |  252 +++
 .../planner/plan/node/write/InsertRowNode.java     |  621 ++++++
 .../planner/plan/node/write/InsertRowsNode.java    |  253 +++
 .../plan/node/write/InsertRowsOfOneDeviceNode.java |  289 +++
 .../planner/plan/node/write/InsertTabletNode.java  |  820 ++++++++
 .../plan/parameter/AggregationDescriptor.java      |  102 +
 .../planner/plan/parameter/AggregationStep.java    |   97 +
 .../planner/plan/parameter/FillDescriptor.java     |   69 +
 .../plan/parameter/FilterNullParameter.java        |   89 +
 .../plan/parameter/GroupByTimeParameter.java       |  173 ++
 .../plan/planner/plan/parameter/InputLocation.java |   72 +
 .../plan/planner/plan/parameter/OutputColumn.java  |   91 +
 .../plan/rewriter/ColumnPaginationController.java  |  145 ++
 .../db/mpp/plan/rewriter/ConcatPathRewriter.java   |  190 ++
 .../db/mpp/plan/rewriter/DnfFilterOptimizer.java   |  163 ++
 .../db/mpp/plan/rewriter/IFilterOptimizer.java     |   29 +
 .../plan/rewriter/MergeSingleFilterOptimizer.java  |  179 ++
 .../db/mpp/plan/rewriter/RemoveNotOptimizer.java   |  103 +
 .../db/mpp/plan/rewriter/WildcardsRemover.java     |  375 ++++
 .../scheduler/AbstractFragInsStateTracker.java     |   84 +
 .../db/mpp/plan/scheduler/ClusterScheduler.java    |  159 ++
 .../scheduler/FixedRateFragInsStateTracker.java    |   86 +
 .../plan/scheduler/FragInstanceDispatchResult.java |   32 +
 .../plan/scheduler/IFragInstanceDispatcher.java    |   37 +
 .../plan/scheduler/IFragInstanceStateTracker.java  |   26 +
 .../db/mpp/plan/scheduler/IQueryTerminator.java    |   26 +
 .../iotdb/db/mpp/plan/scheduler/IScheduler.java    |   40 +
 .../scheduler/SimpleFragInstanceDispatcher.java    |   88 +
 .../mpp/plan/scheduler/SimpleQueryTerminator.java  |   87 +
 .../db/mpp/plan/scheduler/StandaloneScheduler.java |  113 +
 .../db/mpp/plan/statement/IConfigStatement.java    |   36 +
 .../iotdb/db/mpp/plan/statement/Statement.java     |   67 +
 .../iotdb/db/mpp/plan/statement/StatementNode.java |   32 +
 .../db/mpp/plan/statement/StatementVisitor.java    |  192 ++
 .../plan/statement/component/FillComponent.java    |   51 +
 .../mpp/plan/statement/component/FillPolicy.java   |   25 +
 .../statement/component/FilterNullComponent.java   |   97 +
 .../plan/statement/component/FilterNullPolicy.java |   25 +
 .../plan/statement/component/FromComponent.java    |   42 +
 .../statement/component/GroupByLevelComponent.java |   56 +
 .../component/GroupByLevelController.java          |  247 +++
 .../statement/component/GroupByTimeComponent.java  |  101 +
 .../db/mpp/plan/statement/component/OrderBy.java   |   28 +
 .../mpp/plan/statement/component/ResultColumn.java |  205 ++
 .../plan/statement/component/ResultSetFormat.java  |   27 +
 .../plan/statement/component/SelectComponent.java  |  182 ++
 .../plan/statement/component/WhereCondition.java   |   43 +
 .../statement/crud/AggregationQueryStatement.java  |  129 ++
 .../plan/statement/crud/FillQueryStatement.java    |   79 +
 .../statement/crud/GroupByFillQueryStatement.java  |   49 +
 .../plan/statement/crud/GroupByQueryStatement.java |   61 +
 .../plan/statement/crud/InsertBaseStatement.java   |   78 +
 .../crud/InsertMultiTabletsStatement.java          |   86 +
 .../plan/statement/crud/InsertRowStatement.java    |  128 ++
 .../crud/InsertRowsOfOneDeviceStatement.java       |   90 +
 .../plan/statement/crud/InsertRowsStatement.java   |   86 +
 .../mpp/plan/statement/crud/InsertStatement.java   |  101 +
 .../plan/statement/crud/InsertTabletStatement.java |  104 +
 .../plan/statement/crud/LastQueryStatement.java    |   74 +
 .../db/mpp/plan/statement/crud/QueryStatement.java |  354 ++++
 .../plan/statement/crud/UDAFQueryStatement.java    |   97 +
 .../plan/statement/crud/UDTFQueryStatement.java    |   34 +
 .../metadata/AlterTimeSeriesStatement.java         |  127 ++
 .../statement/metadata/CountDevicesStatement.java  |   34 +
 .../metadata/CountLevelTimeSeriesStatement.java    |   41 +
 .../statement/metadata/CountNodesStatement.java    |   31 +
 .../plan/statement/metadata/CountStatement.java    |   55 +
 .../metadata/CountStorageGroupStatement.java       |   42 +
 .../metadata/CountTimeSeriesStatement.java         |   34 +
 .../metadata/CreateAlignedTimeSeriesStatement.java |  193 ++
 .../metadata/CreateTimeSeriesStatement.java        |  132 ++
 .../statement/metadata/SchemaFetchStatement.java   |   64 +
 .../metadata/SetStorageGroupStatement.java         |   64 +
 .../statement/metadata/ShowDevicesStatement.java   |   66 +
 .../mpp/plan/statement/metadata/ShowStatement.java |   69 +
 .../metadata/ShowStorageGroupStatement.java        |   64 +
 .../metadata/ShowTimeSeriesStatement.java          |   87 +
 .../db/mpp/plan/statement/sys/AuthorStatement.java |  209 ++
 .../db/mpp/schedule/AbstractDriverThread.java      |   71 -
 .../iotdb/db/mpp/schedule/DriverScheduler.java     |  357 ----
 .../iotdb/db/mpp/schedule/DriverTaskThread.java    |   85 -
 .../schedule/DriverTaskTimeoutSentinelThread.java  |   56 -
 .../iotdb/db/mpp/schedule/ExecutionContext.java    |   46 -
 .../schedule/FragmentInstanceAbortedException.java |   35 -
 .../iotdb/db/mpp/schedule/IDriverScheduler.java    |   62 -
 .../iotdb/db/mpp/schedule/ITaskScheduler.java      |   72 -
 .../org/apache/iotdb/db/mpp/schedule/queue/ID.java |   22 -
 .../db/mpp/schedule/queue/IDIndexedAccessible.java |   48 -
 .../mpp/schedule/queue/IndexedBlockingQueue.java   |  201 --
 .../db/mpp/schedule/queue/L1PriorityQueue.java     |  102 -
 .../db/mpp/schedule/queue/L2PriorityQueue.java     |  129 --
 .../iotdb/db/mpp/schedule/task/DriverTask.java     |  217 --
 .../iotdb/db/mpp/schedule/task/DriverTaskID.java   |   68 -
 .../db/mpp/schedule/task/DriverTaskStatus.java     |   37 -
 .../apache/iotdb/db/mpp/sql/analyze/Analysis.java  |  123 --
 .../apache/iotdb/db/mpp/sql/analyze/Analyzer.java  |  522 -----
 .../mpp/sql/analyze/ClusterPartitionFetcher.java   |  604 ------
 .../db/mpp/sql/analyze/ClusterSchemaFetcher.java   |  121 --
 .../mpp/sql/analyze/FakePartitionFetcherImpl.java  |  158 --
 .../db/mpp/sql/analyze/FakeSchemaFetcherImpl.java  |   99 -
 .../db/mpp/sql/analyze/IPartitionFetcher.java      |   43 -
 .../iotdb/db/mpp/sql/analyze/ISchemaFetcher.java   |   44 -
 .../apache/iotdb/db/mpp/sql/analyze/QueryType.java |   24 -
 .../iotdb/db/mpp/sql/analyze/SchemaValidator.java  |   57 -
 .../sql/analyze/StandalonePartitionFetcher.java    |  127 --
 .../mpp/sql/analyze/StandaloneSchemaFetcher.java   |   89 -
 .../iotdb/db/mpp/sql/analyze/TypeProvider.java     |   77 -
 .../iotdb/db/mpp/sql/constant/FilterConstant.java  |  103 -
 .../iotdb/db/mpp/sql/constant/StatementType.java   |  139 --
 .../db/mpp/sql/optimization/PlanOptimizer.java     |   26 -
 .../apache/iotdb/db/mpp/sql/parser/ASTVisitor.java | 2107 -------------------
 .../db/mpp/sql/parser/StatementGenerator.java      |  409 ----
 .../db/mpp/sql/planner/DistributionPlanner.java    |  559 -----
 .../mpp/sql/planner/IFragmentParallelPlaner.java   |   38 -
 .../db/mpp/sql/planner/LocalExecutionPlanner.java  |  584 ------
 .../db/mpp/sql/planner/LogicalPlanBuilder.java     |  226 --
 .../iotdb/db/mpp/sql/planner/LogicalPlanner.java   |  390 ----
 .../sql/planner/SimpleFragmentParallelPlanner.java |  146 --
 .../sql/planner/WriteFragmentParallelPlanner.java  |   73 -
 .../mpp/sql/planner/plan/DistributedQueryPlan.java |   57 -
 .../db/mpp/sql/planner/plan/FragmentInstance.java  |  177 --
 .../db/mpp/sql/planner/plan/LogicalQueryPlan.java  |   45 -
 .../db/mpp/sql/planner/plan/PlanFragment.java      |  156 --
 .../iotdb/db/mpp/sql/planner/plan/SubPlan.java     |   69 -
 .../sql/planner/plan/node/PlanGraphPrinter.java    |  309 ---
 .../db/mpp/sql/planner/plan/node/PlanNode.java     |  118 --
 .../db/mpp/sql/planner/plan/node/PlanNodeId.java   |   61 -
 .../db/mpp/sql/planner/plan/node/PlanNodeType.java |  197 --
 .../db/mpp/sql/planner/plan/node/PlanNodeUtil.java |  116 --
 .../db/mpp/sql/planner/plan/node/PlanVisitor.java  |  184 --
 .../planner/plan/node/SimplePlanNodeRewriter.java  |   48 -
 .../mpp/sql/planner/plan/node/WritePlanNode.java   |   36 -
 .../metedata/read/AbstractSchemaMergeNode.java     |   61 -
 .../node/metedata/read/CountSchemaMergeNode.java   |   54 -
 .../plan/node/metedata/read/DevicesCountNode.java  |   68 -
 .../node/metedata/read/DevicesSchemaScanNode.java  |  110 -
 .../metedata/read/LevelTimeSeriesCountNode.java    |   98 -
 .../plan/node/metedata/read/SchemaFetchNode.java   |   78 -
 .../plan/node/metedata/read/SchemaScanNode.java    |  155 --
 .../node/metedata/read/SeriesSchemaMergeNode.java  |   60 -
 .../node/metedata/read/TimeSeriesCountNode.java    |   68 -
 .../metedata/read/TimeSeriesSchemaScanNode.java    |  143 --
 .../node/metedata/write/AlterTimeSeriesNode.java   |  273 ---
 .../write/CreateAlignedTimeSeriesNode.java         |  386 ----
 .../node/metedata/write/CreateTimeSeriesNode.java  |  331 ---
 .../planner/plan/node/process/AggregationNode.java |  186 --
 .../planner/plan/node/process/DeviceMergeNode.java |  149 --
 .../planner/plan/node/process/DeviceViewNode.java  |  166 --
 .../planner/plan/node/process/ExchangeNode.java    |  209 --
 .../sql/planner/plan/node/process/FillNode.java    |  126 --
 .../sql/planner/plan/node/process/FilterNode.java  |  115 --
 .../planner/plan/node/process/FilterNullNode.java  |  128 --
 .../plan/node/process/GroupByLevelNode.java        |  172 --
 .../planner/plan/node/process/GroupByTimeNode.java |  165 --
 .../sql/planner/plan/node/process/LimitNode.java   |  128 --
 .../sql/planner/plan/node/process/OffsetNode.java  |  119 --
 .../sql/planner/plan/node/process/ProcessNode.java |   29 -
 .../sql/planner/plan/node/process/ProjectNode.java |  115 --
 .../sql/planner/plan/node/process/SortNode.java    |  119 --
 .../planner/plan/node/process/TimeJoinNode.java    |  135 --
 .../planner/plan/node/sink/FragmentSinkNode.java   |  188 --
 .../mpp/sql/planner/plan/node/sink/SinkNode.java   |   31 -
 .../source/AlignedSeriesAggregationScanNode.java   |  267 ---
 .../plan/node/source/AlignedSeriesScanNode.java    |  260 ---
 .../node/source/SeriesAggregationScanNode.java     |  317 ---
 .../planner/plan/node/source/SeriesScanNode.java   |  312 ---
 .../sql/planner/plan/node/source/SourceNode.java   |   36 -
 .../planner/plan/node/write/BatchInsertNode.java   |   40 -
 .../plan/node/write/InsertMultiTabletsNode.java    |  279 ---
 .../sql/planner/plan/node/write/InsertNode.java    |  252 ---
 .../sql/planner/plan/node/write/InsertRowNode.java |  615 ------
 .../planner/plan/node/write/InsertRowsNode.java    |  253 ---
 .../plan/node/write/InsertRowsOfOneDeviceNode.java |  289 ---
 .../planner/plan/node/write/InsertTabletNode.java  |  798 -------
 .../plan/parameter/AggregationDescriptor.java      |  102 -
 .../planner/plan/parameter/AggregationStep.java    |   97 -
 .../sql/planner/plan/parameter/FillDescriptor.java |   69 -
 .../plan/parameter/FilterNullParameter.java        |   89 -
 .../plan/parameter/GroupByTimeParameter.java       |  173 --
 .../sql/planner/plan/parameter/InputLocation.java  |   72 -
 .../sql/planner/plan/parameter/OutputColumn.java   |   91 -
 .../sql/rewriter/ColumnPaginationController.java   |  145 --
 .../db/mpp/sql/rewriter/ConcatPathRewriter.java    |  190 --
 .../db/mpp/sql/rewriter/DnfFilterOptimizer.java    |  163 --
 .../db/mpp/sql/rewriter/IFilterOptimizer.java      |   29 -
 .../sql/rewriter/MergeSingleFilterOptimizer.java   |  179 --
 .../db/mpp/sql/rewriter/RemoveNotOptimizer.java    |  103 -
 .../db/mpp/sql/rewriter/WildcardsRemover.java      |  375 ----
 .../db/mpp/sql/statement/IConfigStatement.java     |   36 -
 .../iotdb/db/mpp/sql/statement/Statement.java      |   58 -
 .../iotdb/db/mpp/sql/statement/StatementNode.java  |   32 -
 .../db/mpp/sql/statement/StatementVisitor.java     |  192 --
 .../mpp/sql/statement/component/FillComponent.java |   51 -
 .../db/mpp/sql/statement/component/FillPolicy.java |   25 -
 .../statement/component/FilterNullComponent.java   |   97 -
 .../sql/statement/component/FilterNullPolicy.java  |   25 -
 .../mpp/sql/statement/component/FromComponent.java |   42 -
 .../statement/component/GroupByLevelComponent.java |   56 -
 .../component/GroupByLevelController.java          |  247 ---
 .../statement/component/GroupByTimeComponent.java  |  101 -
 .../db/mpp/sql/statement/component/OrderBy.java    |   28 -
 .../mpp/sql/statement/component/ResultColumn.java  |  205 --
 .../sql/statement/component/ResultSetFormat.java   |   27 -
 .../sql/statement/component/SelectComponent.java   |  182 --
 .../sql/statement/component/WhereCondition.java    |   43 -
 .../statement/crud/AggregationQueryStatement.java  |  127 --
 .../mpp/sql/statement/crud/FillQueryStatement.java |   78 -
 .../statement/crud/GroupByFillQueryStatement.java  |   48 -
 .../sql/statement/crud/GroupByQueryStatement.java  |   59 -
 .../sql/statement/crud/InsertBaseStatement.java    |   70 -
 .../crud/InsertMultiTabletsStatement.java          |   77 -
 .../mpp/sql/statement/crud/InsertRowStatement.java |  116 --
 .../crud/InsertRowsOfOneDeviceStatement.java       |   79 -
 .../sql/statement/crud/InsertRowsStatement.java    |   77 -
 .../db/mpp/sql/statement/crud/InsertStatement.java |   90 -
 .../sql/statement/crud/InsertTabletStatement.java  |   94 -
 .../mpp/sql/statement/crud/LastQueryStatement.java |   72 -
 .../db/mpp/sql/statement/crud/QueryStatement.java  |  349 ----
 .../mpp/sql/statement/crud/UDAFQueryStatement.java |   96 -
 .../mpp/sql/statement/crud/UDTFQueryStatement.java |   33 -
 .../metadata/AlterTimeSeriesStatement.java         |  120 --
 .../statement/metadata/CountDevicesStatement.java  |   34 -
 .../metadata/CountLevelTimeSeriesStatement.java    |   41 -
 .../statement/metadata/CountNodesStatement.java    |   31 -
 .../mpp/sql/statement/metadata/CountStatement.java |   47 -
 .../metadata/CountStorageGroupStatement.java       |   42 -
 .../metadata/CountTimeSeriesStatement.java         |   34 -
 .../metadata/CreateAlignedTimeSeriesStatement.java |  173 --
 .../metadata/CreateTimeSeriesStatement.java        |  125 --
 .../statement/metadata/SchemaFetchStatement.java   |   56 -
 .../metadata/SetStorageGroupStatement.java         |   54 -
 .../statement/metadata/ShowDevicesStatement.java   |   58 -
 .../mpp/sql/statement/metadata/ShowStatement.java  |   60 -
 .../metadata/ShowStorageGroupStatement.java        |   56 -
 .../metadata/ShowTimeSeriesStatement.java          |   87 -
 .../db/mpp/sql/statement/sys/AuthorStatement.java  |  148 --
 .../db/protocol/influxdb/handler/QueryHandler.java |    2 +-
 .../apache/iotdb/db/qp/executor/PlanExecutor.java  |    2 +-
 .../db/qp/physical/crud/AlignByDevicePlan.java     |    2 +-
 .../db/qp/physical/crud/RawDataQueryPlan.java      |    9 +-
 .../apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java    |  357 ++--
 .../db/query/control/QueryResourceManager.java     |    6 +-
 .../groupby/GroupByWithValueFilterDataSet.java     |    2 +-
 .../groupby/GroupByWithoutValueFilterDataSet.java  |    2 +-
 .../db/query/executor/AggregationExecutor.java     |    6 +-
 .../iotdb/db/query/executor/FillQueryExecutor.java |    4 +-
 .../iotdb/db/query/executor/LastQueryExecutor.java |    2 +-
 .../db/query/executor/RawDataQueryExecutor.java    |    4 +-
 .../db/query/executor/fill/LastPointReader.java    |    6 +-
 .../iotdb/db/query/expression/Expression.java      |    2 +-
 .../expression/binary/AdditionExpression.java      |    4 +-
 .../query/expression/binary/BinaryExpression.java  |    4 +-
 .../expression/binary/DivisionExpression.java      |    4 +-
 .../query/expression/binary/EqualToExpression.java |    4 +-
 .../expression/binary/GreaterEqualExpression.java  |    4 +-
 .../expression/binary/GreaterThanExpression.java   |    4 +-
 .../expression/binary/LessEqualExpression.java     |    4 +-
 .../expression/binary/LessThanExpression.java      |    4 +-
 .../expression/binary/LogicAndExpression.java      |    4 +-
 .../query/expression/binary/LogicOrExpression.java |    4 +-
 .../query/expression/binary/ModuloExpression.java  |    4 +-
 .../binary/MultiplicationExpression.java           |    4 +-
 .../expression/binary/NonEqualExpression.java      |    4 +-
 .../expression/binary/SubtractionExpression.java   |    4 +-
 .../db/query/expression/leaf/ConstantOperand.java  |    2 +-
 .../query/expression/leaf/TimeSeriesOperand.java   |    2 +-
 .../query/expression/multi/FunctionExpression.java |   10 +-
 .../db/query/expression/unary/InExpression.java    |   11 +-
 .../db/query/expression/unary/LikeExpression.java  |   80 +-
 .../query/expression/unary/LogicNotExpression.java |    2 +-
 .../query/expression/unary/NegationExpression.java |    2 +-
 .../query/expression/unary/RegularExpression.java  |    5 +-
 .../db/query/expression/unary/UnaryExpression.java |    2 +-
 .../iotdb/db/query/reader/series/SeriesReader.java |   18 +-
 .../query/timegenerator/ServerTimeGenerator.java   |    2 +-
 .../db/query/udf/builtin/BuiltinFunction.java      |    4 +-
 .../udf/builtin/UDTFEqualSizeBucketM4Sample.java   |    8 +-
 .../builtin/UDTFEqualSizeBucketOutlierSample.java  |  834 ++++++++
 .../query/udf/core/layer/TsBlockInputDataSet.java  |    2 +-
 .../transformer/ArithmeticAdditionTransformer.java |   35 -
 .../transformer/ArithmeticBinaryTransformer.java   |   41 -
 .../transformer/ArithmeticDivisionTransformer.java |   35 -
 .../transformer/ArithmeticModuloTransformer.java   |   35 -
 .../ArithmeticMultiplicationTransformer.java       |   35 -
 .../transformer/ArithmeticNegationTransformer.java |   80 -
 .../ArithmeticSubtractionTransformer.java          |   35 -
 .../udf/core/transformer/BinaryTransformer.java    |  182 --
 .../core/transformer/CompareBinaryTransformer.java |   41 -
 .../transformer/CompareEqualToTransformer.java     |   40 -
 .../CompareGreaterEqualTransformer.java            |   35 -
 .../transformer/CompareGreaterThanTransformer.java |   35 -
 .../transformer/CompareLessEqualTransformer.java   |   35 -
 .../transformer/CompareLessThanTransformer.java    |   35 -
 .../transformer/CompareNonEqualTransformer.java    |   40 -
 .../udf/core/transformer/LogicAndTransformer.java  |   34 -
 .../core/transformer/LogicBinaryTransformer.java   |   40 -
 .../udf/core/transformer/LogicNotTransformer.java  |   70 -
 .../udf/core/transformer/LogicOrTransformer.java   |   34 -
 .../db/query/udf/core/transformer/Transformer.java |    2 +-
 .../core/transformer/TransparentTransformer.java   |   93 -
 .../core/transformer/UDFQueryRowTransformer.java   |   49 -
 .../transformer/UDFQueryRowWindowTransformer.java  |   47 -
 .../udf/core/transformer/UDFQueryTransformer.java  |  111 -
 .../binary/ArithmeticAdditionTransformer.java      |   35 +
 .../binary/ArithmeticBinaryTransformer.java        |   49 +
 .../binary/ArithmeticDivisionTransformer.java      |   35 +
 .../binary/ArithmeticModuloTransformer.java        |   35 +
 .../ArithmeticMultiplicationTransformer.java       |   35 +
 .../binary/ArithmeticSubtractionTransformer.java   |   35 +
 .../core/transformer/binary/BinaryTransformer.java |  125 ++
 .../binary/CompareBinaryTransformer.java           |   49 +
 .../binary/CompareEqualToTransformer.java          |   56 +
 .../binary/CompareGreaterEqualTransformer.java     |   35 +
 .../binary/CompareGreaterThanTransformer.java      |   35 +
 .../binary/CompareLessEqualTransformer.java        |   35 +
 .../binary/CompareLessThanTransformer.java         |   35 +
 .../binary/CompareNonEqualTransformer.java         |   56 +
 .../transformer/binary/LogicAndTransformer.java    |   33 +
 .../transformer/binary/LogicBinaryTransformer.java |   54 +
 .../transformer/binary/LogicOrTransformer.java     |   34 +
 .../transformer/multi/UDFQueryRowTransformer.java  |   49 +
 .../multi/UDFQueryRowWindowTransformer.java        |   47 +
 .../transformer/multi/UDFQueryTransformer.java     |  112 +
 .../unary/ArithmeticNegationTransformer.java       |   59 +
 .../udf/core/transformer/unary/InTransformer.java  |  233 +++
 .../transformer/unary/LogicNotTransformer.java     |   48 +
 .../core/transformer/unary/RegularTransformer.java |   58 +
 .../transformer/unary/TransparentTransformer.java  |   70 +
 .../core/transformer/unary/UnaryTransformer.java   |   62 +
 .../java/org/apache/iotdb/db/service/DataNode.java |    4 +-
 .../java/org/apache/iotdb/db/service/IoTDB.java    |    4 +-
 .../thrift/impl/DataNodeTSIServiceImpl.java        |  113 +-
 .../service/thrift/impl/InternalServiceImpl.java   |   14 +-
 .../db/sync/sender/manager/TsFileSyncManager.java  |   12 -
 .../iotdb/db/sync/sender/pipe/IoTDBPipeSink.java   |    4 +-
 .../iotdb/db/sync/sender/pipe/TsFilePipe.java      |   13 +-
 .../db/sync/sender/recovery/TsFilePipeLogger.java  |    5 +
 .../org/apache/iotdb/db/tools/TsFileSplitTool.java |    2 +-
 .../org/apache/iotdb/db/utils/FileLoaderUtils.java |    4 +-
 .../java/org/apache/iotdb/db/utils/MemUtils.java   |    2 +-
 .../apache/iotdb/db/utils/QueryDataSetUtils.java   |    2 +-
 .../org/apache/iotdb/db/utils/SchemaUtils.java     |    6 +
 .../org/apache/iotdb/db/wal/buffer/WALEntry.java   |    6 +-
 .../apache/iotdb/db/wal/buffer/WALEntryType.java   |    4 +-
 .../org/apache/iotdb/db/wal/node/IWALNode.java     |    4 +-
 .../org/apache/iotdb/db/wal/node/WALFakeNode.java  |    4 +-
 .../java/org/apache/iotdb/db/wal/node/WALNode.java |    4 +-
 .../db/wal/recover/file/TsFilePlanRedoer.java      |    6 +-
 .../file/UnsealedTsFileRecoverPerformer.java       |    4 +-
 .../compaction/CompactionTaskManagerTest.java      |    2 +-
 .../inner/InnerCompactionEmptyTsFileTest.java      |   89 +
 .../compaction/inner/InnerCompactionTest.java      |   63 +-
 .../compaction/utils/CompactionCheckerUtils.java   |    2 +-
 .../utils/CompactionFileGeneratorUtils.java        |    6 +-
 .../db/engine/storagegroup/DataRegionTest.java     |    4 +-
 .../engine/storagegroup/TsFileProcessorV2Test.java |    2 +-
 .../apache/iotdb/db/metadata/MetaUtilsTest.java    |   71 +-
 .../apache/iotdb/db/metadata/SchemaBasicTest.java  |   24 +-
 .../rocksdb/RocksDBBenchmarkEngine.java            |    2 +-
 .../apache/iotdb/db/mpp/buffer/SinkHandleTest.java |  527 -----
 .../iotdb/db/mpp/buffer/SourceHandleTest.java      |  641 ------
 .../apache/iotdb/db/mpp/buffer/StubSinkHandle.java |   99 -
 .../java/org/apache/iotdb/db/mpp/buffer/Utils.java |  106 -
 .../db/mpp/execution/ConfigExecutionTest.java      |    9 +-
 .../iotdb/db/mpp/execution/DataDriverTest.java     |   28 +-
 .../db/mpp/execution/QueryStateMachineTest.java    |    1 +
 .../datatransfer/DataBlockManagerTest.java         |  121 ++
 .../datatransfer/LocalSinkHandleTest.java          |  153 ++
 .../datatransfer/LocalSourceHandleTest.java        |  119 ++
 .../datatransfer/SharedTsBlockQueueTest.java       |  160 ++
 .../mpp/execution/datatransfer/SinkHandleTest.java |  527 +++++
 .../execution/datatransfer/SourceHandleTest.java   |  641 ++++++
 .../mpp/execution/datatransfer/StubSinkHandle.java |   99 +
 .../iotdb/db/mpp/execution/datatransfer/Utils.java |  112 +
 .../db/mpp/execution/memory/MemoryPoolTest.java    |  275 +++
 .../execution/operator/DeviceViewOperatorTest.java |  198 ++
 .../mpp/execution/operator/LimitOperatorTest.java  |  188 ++
 .../execution/operator/MultiColumnMergerTest.java  |  208 ++
 .../operator/SeriesAggregateScanOperatorTest.java  |  384 ++++
 .../execution/operator/SeriesScanOperatorTest.java |  135 ++
 .../execution/operator/SingleColumnMergerTest.java |  210 ++
 .../execution/operator/TimeJoinOperatorTest.java   |  414 ++++
 .../operator/schema/CountMergeOperatorTest.java    |  193 ++
 .../operator/schema/SchemaCountOperatorTest.java   |  231 +++
 .../operator/schema/SchemaFetchOperatorTest.java   |  149 ++
 .../operator/schema/SchemaScanOperatorTest.java    |  253 +++
 .../schedule/DefaultTaskSchedulerTest.java         |  399 ++++
 .../execution/schedule/DriverSchedulerTest.java    |  164 ++
 .../DriverTaskTimeoutSentinelThreadTest.java       |  269 +++
 .../schedule/queue/L1PriorityQueueTest.java        |  182 ++
 .../schedule/queue/L2PriorityQueueTest.java        |  196 ++
 .../mpp/execution/schedule/queue/QueueElement.java |   80 +
 .../apache/iotdb/db/mpp/memory/MemoryPoolTest.java |  275 ---
 .../db/mpp/operator/DeviceViewOperatorTest.java    |  198 --
 .../iotdb/db/mpp/operator/LimitOperatorTest.java   |  188 --
 .../db/mpp/operator/MultiColumnMergerTest.java     |  208 --
 .../operator/SeriesAggregateScanOperatorTest.java  |  384 ----
 .../db/mpp/operator/SeriesScanOperatorTest.java    |  135 --
 .../db/mpp/operator/SingleColumnMergerTest.java    |  210 --
 .../db/mpp/operator/TimeJoinOperatorTest.java      |  414 ----
 .../operator/schema/CountMergeOperatorTest.java    |  193 --
 .../operator/schema/SchemaCountOperatorTest.java   |  231 ---
 .../operator/schema/SchemaFetchOperatorTest.java   |  149 --
 .../operator/schema/SchemaScanOperatorTest.java    |  253 ---
 .../iotdb/db/mpp/plan/analyze/AnalyzerTest.java    |   62 +
 .../iotdb/db/mpp/plan/parser/ASTVisitorTest.java   |   41 +
 .../db/mpp/plan/parser/StatementGeneratorTest.java |   76 +
 .../db/mpp/plan/plan/DistributionPlannerTest.java  |  523 +++++
 .../db/mpp/plan/plan/FragmentInstanceIdTest.java   |   38 +
 .../mpp/plan/plan/FragmentInstanceSerdeTest.java   |  164 ++
 .../iotdb/db/mpp/plan/plan/LogicalPlannerTest.java |  473 +++++
 .../db/mpp/plan/plan/QueryLogicalPlanUtil.java     |  714 +++++++
 .../iotdb/db/mpp/plan/plan/QueryPlannerTest.java   |   96 +
 .../plan/plan/node/PlanNodeDeserializeHelper.java  |   37 +
 .../read/DeviceSchemaScanNodeSerdeTest.java        |   77 +
 .../metadata/read/SchemaCountNodeSerdeTest.java    |   92 +
 .../read/TimeSeriesSchemaScanNodeSerdeTest.java    |   80 +
 .../node/process/AggregationNodeSerdeTest.java     |   89 +
 .../plan/node/process/DeviceViewNodeSerdeTest.java |   55 +
 .../plan/node/process/ExchangeNodeSerdeTest.java   |   64 +
 .../plan/plan/node/process/FillNodeSerdeTest.java  |   58 +
 .../plan/node/process/FilterNodeSerdeTest.java     |   58 +
 .../plan/node/process/FilterNullNodeSerdeTest.java |   58 +
 .../node/process/GroupByLevelNodeSerdeTest.java    |  106 +
 .../plan/plan/node/process/LimitNodeSerdeTest.java |   67 +
 .../plan/node/process/OffsetNodeSerdeTest.java     |   65 +
 .../plan/plan/node/process/SortNodeSerdeTest.java  |   66 +
 .../plan/node/process/TimeJoinNodeSerdeTest.java   |   81 +
 .../plan/node/sink/FragmentSinkNodeSerdeTest.java  |   56 +
 .../source/SeriesAggregationScanNodeSerdeTest.java |   79 +
 .../plan/node/source/SeriesScanNodeSerdeTest.java  |   64 +
 .../write/InsertMultiTabletsNodeSerdeTest.java     |  101 +
 .../plan/node/write/InsertRowNodeSerdeTest.java    |  200 ++
 .../plan/node/write/InsertRowsNodeSerdeTest.java   |   72 +
 .../write/InsertRowsOfOneDeviceNodeSerdeTest.java  |   81 +
 .../plan/node/write/InsertTabletNodeSerdeTest.java |  176 ++
 .../plan/node/write/WritePlanNodeSplitTest.java    |  278 +++
 .../db/mpp/schedule/DefaultTaskSchedulerTest.java  |  399 ----
 .../iotdb/db/mpp/schedule/DriverSchedulerTest.java |  164 --
 .../DriverTaskTimeoutSentinelThreadTest.java       |  269 ---
 .../db/mpp/schedule/queue/L1PriorityQueueTest.java |  182 --
 .../db/mpp/schedule/queue/L2PriorityQueueTest.java |  196 --
 .../iotdb/db/mpp/schedule/queue/QueueElement.java  |   80 -
 .../iotdb/db/mpp/sql/analyze/AnalyzerTest.java     |   62 -
 .../iotdb/db/mpp/sql/parser/ASTVisitorTest.java    |   41 -
 .../db/mpp/sql/parser/StatementGeneratorTest.java  |   76 -
 .../db/mpp/sql/plan/DistributionPlannerTest.java   |  523 -----
 .../db/mpp/sql/plan/FragmentInstanceIdTest.java    |   38 -
 .../db/mpp/sql/plan/FragmentInstanceSerdeTest.java |  164 --
 .../iotdb/db/mpp/sql/plan/LogicalPlannerTest.java  |  471 -----
 .../db/mpp/sql/plan/QueryLogicalPlanUtil.java      |  714 -------
 .../iotdb/db/mpp/sql/plan/QueryPlannerTest.java    |   96 -
 .../sql/plan/node/PlanNodeDeserializeHelper.java   |   37 -
 .../read/DeviceSchemaScanNodeSerdeTest.java        |   77 -
 .../metadata/read/SchemaCountNodeSerdeTest.java    |   92 -
 .../read/TimeSeriesSchemaScanNodeSerdeTest.java    |   80 -
 .../node/process/AggregationNodeSerdeTest.java     |   89 -
 .../plan/node/process/DeviceViewNodeSerdeTest.java |   55 -
 .../plan/node/process/ExchangeNodeSerdeTest.java   |   64 -
 .../sql/plan/node/process/FillNodeSerdeTest.java   |   58 -
 .../sql/plan/node/process/FilterNodeSerdeTest.java |   58 -
 .../plan/node/process/FilterNullNodeSerdeTest.java |   58 -
 .../node/process/GroupByLevelNodeSerdeTest.java    |  106 -
 .../sql/plan/node/process/LimitNodeSerdeTest.java  |   67 -
 .../sql/plan/node/process/OffsetNodeSerdeTest.java |   65 -
 .../sql/plan/node/process/SortNodeSerdeTest.java   |   66 -
 .../plan/node/process/TimeJoinNodeSerdeTest.java   |   81 -
 .../plan/node/sink/FragmentSinkNodeSerdeTest.java  |   56 -
 .../source/SeriesAggregationScanNodeSerdeTest.java |   79 -
 .../plan/node/source/SeriesScanNodeSerdeTest.java  |   64 -
 .../write/InsertMultiTabletsNodeSerdeTest.java     |  101 -
 .../plan/node/write/InsertRowNodeSerdeTest.java    |  200 --
 .../plan/node/write/InsertRowsNodeSerdeTest.java   |   72 -
 .../write/InsertRowsOfOneDeviceNodeSerdeTest.java  |   81 -
 .../plan/node/write/InsertTabletNodeSerdeTest.java |  176 --
 .../iotdb/db/qp/physical/PhysicalPlanTest.java     |    6 +-
 .../org/apache/iotdb/db/qp/sql/ASTVisitorTest.java |    2 +-
 .../iotdb/db/query/dataset/ListDataSetTest.java    |    2 +-
 .../iotdb/db/query/dataset/SingleDataSetTest.java  |    2 +-
 .../query/dataset/groupby/GroupByDataSetTest.java  |    4 +-
 .../dataset/groupby/GroupByLevelDataSetTest.java   |    4 +-
 .../iotdb/db/service/InternalServiceImplTest.java  |   12 +-
 .../java/org/apache/iotdb/rpc/TSStatusCode.java    |    4 +
 .../apache/iotdb/spark/tsfile/DefaultSource.scala  |    2 +-
 .../iotdb/spark/tsfile/NarrowConverter.scala       |    2 +-
 .../apache/iotdb/spark/tsfile/WideConverter.scala  |    4 +-
 .../src/main/thrift/confignode.thrift              |    8 +
 .../tsfile/common/constant/TsFileConstant.java     |    1 +
 .../iotdb/tsfile/encoding/decoder/Decoder.java     |   25 +-
 .../tsfile/encoding/decoder/DescendDecoder.java    |  130 ++
 .../tsfile/encoding/decoder/FloatDecoder.java      |    7 +-
 .../tsfile/encoding/decoder/Simple8bDecoder.java   |   81 +
 .../encoding/decoder/SparseSimple8bDecoder.java    |  111 +
 .../tsfile/encoding/encoder/DescendEncoder.java    |  210 ++
 .../tsfile/encoding/encoder/FloatEncoder.java      |    7 +-
 .../tsfile/encoding/encoder/Simple8bEncoder.java   |  134 ++
 .../encoding/encoder/SparseSimple8bEncoder.java    |  178 ++
 .../tsfile/encoding/encoder/TSEncodingBuilder.java |  162 ++
 .../tsfile/file/metadata/enums/TSEncoding.java     |   11 +-
 .../iotdb/tsfile/read/TsFileSequenceReader.java    |   10 +-
 .../org/apache/iotdb/tsfile/read/common/Path.java  |    2 +-
 .../read/controller/MetadataQuerierByFileImpl.java |    8 +-
 .../tsfile/v2/read/TsFileSequenceReaderForV2.java  |    7 +-
 .../apache/iotdb/tsfile/write/TsFileWriter.java    |    8 +-
 .../iotdb/tsfile/write/writer/TsFileIOWriter.java  |    2 +-
 .../encoding/decoder/DescendDecoderTest.java       |  109 +
 .../tsfile/encoding/decoder/FloatDecoderTest.java  |   62 +-
 .../apache/iotdb/tsfile/read/TsFileReaderTest.java |    2 +-
 .../apache/iotdb/tsfile/read/common/PathTest.java  |   10 +-
 .../org/apache/iotdb/tsfile/write/WriteTest.java   |    6 +-
 909 files changed, 54801 insertions(+), 47823 deletions(-)

diff --git a/README.md b/README.md
index b4b975abae..928c85950c 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@
 [![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/iotdb.svg)
 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg)
-![](https://img.shields.io/badge/platform-win%20%7C%20macox%20%7C%20linux-yellow.svg)
+![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg)
 ![](https://img.shields.io/badge/java--language-1.8%20%7C%2011%20%7C%2017-blue.svg)
 [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/apache/iotdb.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/iotdb/context:java)
 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/)
diff --git a/README_ZH.md b/README_ZH.md
index 830cfdec19..7831b88915 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -28,7 +28,7 @@
 [![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/iotdb.svg)
 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg)
-![](https://img.shields.io/badge/platform-win%20%7C%20macox%20%7C%20linux-yellow.svg)
+![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg)
 ![](https://img.shields.io/badge/java--language-1.8%20%7C%2011%20%7C%2017-blue.svg)
 [![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/apache/iotdb.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/iotdb/context:java)
 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/)
diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/InfluxDBSqlParser.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/InfluxDBSqlParser.g4
index ad29971e89..0ffdcb9f22 100644
--- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/InfluxDBSqlParser.g4
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/InfluxDBSqlParser.g4
@@ -72,8 +72,7 @@ fromClause
 nodeName
     : STAR
     | ID
-    | QUTOED_ID
-    | QUTOED_ID_IN_NODE_NAME
+    | QUOTED_ID
     | LAST
     | COUNT
     | DEVICE
@@ -83,9 +82,7 @@ nodeName
 
 identifier
     : ID
-    | QUTOED_ID
-    | QUTOED_ID_IN_NODE_NAME
-    | INTEGER_LITERAL
+    | QUOTED_ID
     ;
 
 
@@ -102,7 +99,7 @@ constant
     ;
 
 functionAttribute
-    : COMMA functionAttributeKey=STRING_LITERAL OPERATOR_EQ functionAttributeValue=STRING_LITERAL
+    : COMMA functionAttributeKey=STRING_LITERAL OPERATOR_SEQ functionAttributeValue=STRING_LITERAL
     ;
 
 comparisonOperator
diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
index 04ff27d438..92125573ae 100644
--- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
@@ -127,7 +127,7 @@ triggerAttributeClause
     ;
 
 triggerAttribute
-    : key=STRING_LITERAL operator_eq value=STRING_LITERAL
+    : key=attributeKey operator_eq value=attributeValue
     ;
 
 // Create Continuous Query
@@ -154,16 +154,21 @@ alterTimeseries
     ;
 
 alterClause
-    : RENAME beforeName=identifier TO currentName=identifier
-    | SET propertyClause (COMMA propertyClause)*
-    | DROP identifier (COMMA identifier)*
-    | ADD TAGS propertyClause (COMMA propertyClause)*
-    | ADD ATTRIBUTES propertyClause (COMMA propertyClause)*
+    : RENAME beforeName=attributeKey TO currentName=attributeKey
+    | SET attributePair (COMMA attributePair)*
+    | DROP STRING_LITERAL (COMMA STRING_LITERAL)*
+    | ADD TAGS attributePair (COMMA attributePair)*
+    | ADD ATTRIBUTES attributePair (COMMA attributePair)*
     | UPSERT aliasClause? tagClause? attributeClause?
     ;
 
 aliasClause
-    : ALIAS operator_eq identifier
+    : ALIAS operator_eq alias
+    ;
+
+alias
+    : constant
+    | identifier
     ;
 
 // Delete Storage Group
@@ -247,7 +252,7 @@ showTimeseries
     ;
 
 showWhereClause
-    : WHERE (propertyClause | containsExpression)
+    : WHERE (attributePair | containsExpression)
     ;
 
 // Show Child Paths
@@ -467,12 +472,12 @@ whereClause
 
 // Create User
 createUser
-    : CREATE USER userName=ID password=STRING_LITERAL
+    : CREATE USER userName=identifier password=STRING_LITERAL
     ;
 
 // Create Role
 createRole
-    : CREATE ROLE roleName=ID
+    : CREATE ROLE roleName=identifier
     ;
 
 // Alter Password
@@ -482,42 +487,42 @@ alterUser
 
 // Grant User Privileges
 grantUser
-    : GRANT USER userName=ID PRIVILEGES privileges ON prefixPath
+    : GRANT USER userName=identifier PRIVILEGES privileges ON prefixPath
     ;
 
 // Grant Role Privileges
 grantRole
-    : GRANT ROLE roleName=ID PRIVILEGES privileges ON prefixPath
+    : GRANT ROLE roleName=identifier PRIVILEGES privileges ON prefixPath
     ;
 
 // Grant User Role
 grantRoleToUser
-    : GRANT roleName=ID TO userName=ID
+    : GRANT roleName=identifier TO userName=identifier
     ;
 
 // Revoke User Privileges
 revokeUser
-    : REVOKE USER userName=ID PRIVILEGES privileges ON prefixPath
+    : REVOKE USER userName=identifier PRIVILEGES privileges ON prefixPath
     ;
 
 // Revoke Role Privileges
 revokeRole
-    : REVOKE ROLE roleName=ID PRIVILEGES privileges ON prefixPath
+    : REVOKE ROLE roleName=identifier PRIVILEGES privileges ON prefixPath
     ;
 
 // Revoke Role From User
 revokeRoleFromUser
-    : REVOKE roleName=ID FROM userName=ID
+    : REVOKE roleName=identifier FROM userName=identifier
     ;
 
 // Drop User
 dropUser
-    : DROP USER userName=ID
+    : DROP USER userName=identifier
     ;
 
 // Drop Role
 dropRole
-    : DROP ROLE roleName=ID
+    : DROP ROLE roleName=identifier
     ;
 
 // List Users
@@ -537,7 +542,7 @@ listPrivilegesUser
 
 // List Privileges of Roles On Specific Path
 listPrivilegesRole
-    : LIST PRIVILEGES ROLE roleName=ID ON prefixPath
+    : LIST PRIVILEGES ROLE roleName=identifier ON prefixPath
     ;
 
 // List Privileges of Users
@@ -547,7 +552,7 @@ listUserPrivileges
 
 // List Privileges of Roles
 listRolePrivileges
-    : LIST ROLE PRIVILEGES roleName=ID
+    : LIST ROLE PRIVILEGES roleName=identifier
     ;
 
 // List Roles of Users
@@ -557,7 +562,7 @@ listAllRoleOfUser
 
 // List Users of Role
 listAllUserOfRole
-    : LIST ALL USER OF ROLE roleName=ID
+    : LIST ALL USER OF ROLE roleName=identifier
     ;
 
 privileges
@@ -571,7 +576,7 @@ privilegeValue
 
 usernameWithRoot
     : ROOT
-    | ID
+    | identifier
     ;
 
 
@@ -687,7 +692,7 @@ unloadFile
 
 // pipesink statement
 createPipeSink
-    : CREATE PIPESINK pipeSinkName=ID AS pipeSinkType=ID (LR_BRACKET syncAttributeClauses RR_BRACKET)?
+    : CREATE PIPESINK pipeSinkName=identifier AS pipeSinkType=identifier (LR_BRACKET syncAttributeClauses RR_BRACKET)?
     ;
 
 showPipeSinkType
@@ -695,37 +700,37 @@ showPipeSinkType
     ;
 
 showPipeSink
-    : SHOW ((PIPESINK (pipeSinkName=ID)?) | PIPESINKS)
+    : SHOW ((PIPESINK (pipeSinkName=identifier)?) | PIPESINKS)
     ;
 
 dropPipeSink
-    : DROP PIPESINK pipeSinkName=ID
+    : DROP PIPESINK pipeSinkName=identifier
     ;
 
 // pipe statement
 createPipe
-    : CREATE PIPE pipeName=ID TO pipeSinkName=ID (FROM LR_BRACKET selectStatement RR_BRACKET)? (WITH syncAttributeClauses)?
+    : CREATE PIPE pipeName=identifier TO pipeSinkName=identifier (FROM LR_BRACKET selectStatement RR_BRACKET)? (WITH syncAttributeClauses)?
     ;
 
 showPipe
-    : SHOW ((PIPE (pipeName=ID)?) | PIPES)
+    : SHOW ((PIPE (pipeName=identifier)?) | PIPES)
     ;
 
 stopPipe
-    : STOP PIPE pipeName=ID
+    : STOP PIPE pipeName=identifier
     ;
 
 startPipe
-    : START PIPE pipeName=ID
+    : START PIPE pipeName=identifier
     ;
 
 dropPipe
-    : DROP PIPE pipeName=ID
+    : DROP PIPE pipeName=identifier
     ;
 
 // attribute clauses
 syncAttributeClauses
-    : propertyClause (COMMA propertyClause)*
+    : attributePair (COMMA attributePair)*
     ;
 
 // sync receiver
@@ -751,6 +756,11 @@ fullPath
     : ROOT (DOT nodeNameWithoutWildcard)*
     ;
 
+fullPathInExpression
+    : ROOT (DOT nodeName)*
+    | nodeName (DOT nodeName)*
+    ;
+
 prefixPath
     : ROOT (DOT nodeName)*
     ;
@@ -761,28 +771,12 @@ suffixPath
 
 nodeName
     : wildcard
-    | wildcard? ID wildcard?
-    | wildcard? INTEGER_LITERAL wildcard?
-    | QUTOED_ID_IN_NODE_NAME
-    | STRING_LITERAL
+    | wildcard? identifier wildcard?
+    | identifier
     ;
 
 nodeNameWithoutWildcard
-    : ID
-    | INTEGER_LITERAL
-    | QUTOED_ID_IN_NODE_NAME
-    | STRING_LITERAL
-    ;
-
-suffixPathCanInExpr
-    : nodeNameCanInExpr (DOT nodeNameCanInExpr)*
-    ;
-
-nodeNameCanInExpr
-    : wildcard
-    | wildcard? ID wildcard?
-    | QUTOED_ID
-    | QUTOED_ID_IN_NODE_NAME
+    : identifier
     ;
 
 wildcard
@@ -795,9 +789,7 @@ wildcard
 
 identifier
     : ID
-    | QUTOED_ID
-    | QUTOED_ID_IN_NODE_NAME
-    | INTEGER_LITERAL
+    | QUOTED_ID
     ;
 
 
@@ -842,14 +834,14 @@ expression
     : LR_BRACKET unaryInBracket=expression RR_BRACKET
     | constant
     | time=(TIME | TIMESTAMP)
-    | suffixPathCanInExpr
+    | fullPathInExpression
     | functionName LR_BRACKET expression (COMMA expression)* functionAttribute* RR_BRACKET
     | (PLUS | MINUS | OPERATOR_NOT) expressionAfterUnaryOperator=expression
     | leftExpression=expression (STAR | DIV | MOD) rightExpression=expression
     | leftExpression=expression (PLUS | MINUS) rightExpression=expression
     | leftExpression=expression (OPERATOR_GT | OPERATOR_GTE | OPERATOR_LT | OPERATOR_LTE | OPERATOR_DEQ | OPERATOR_NEQ) rightExpression=expression
     | unaryBeforeRegularOrLikeExpression=expression (REGEXP | LIKE) STRING_LITERAL
-    | unaryBeforeInExpression=expression OPERATOR_IN LR_BRACKET constant (COMMA constant)* RR_BRACKET
+    | unaryBeforeInExpression=expression OPERATOR_NOT? OPERATOR_IN LR_BRACKET constant (COMMA constant)* RR_BRACKET
     | leftExpression=expression OPERATOR_AND rightExpression=expression
     | leftExpression=expression OPERATOR_OR rightExpression=expression
     ;
@@ -860,11 +852,11 @@ functionName
     ;
 
 functionAttribute
-    : COMMA functionAttributeKey=STRING_LITERAL OPERATOR_SEQ functionAttributeValue=STRING_LITERAL
+    : COMMA functionAttributeKey=attributeKey OPERATOR_SEQ functionAttributeValue=attributeValue
     ;
 
 containsExpression
-    : name=identifier OPERATOR_CONTAINS value=propertyValue
+    : name=attributeKey OPERATOR_CONTAINS value=attributeValue
     ;
 
 orExpression
@@ -923,7 +915,7 @@ topClause
     ;
 
 resultColumn
-    : expression (AS identifier)?
+    : expression (AS alias)?
     ;
 
 
@@ -937,40 +929,45 @@ fromClause
 // Attribute Clause
 
 attributeClauses
-    : alias? WITH DATATYPE operator_eq dataType=DATATYPE_VALUE
+    : aliasNodeName? WITH DATATYPE operator_eq dataType=DATATYPE_VALUE
     (COMMA ENCODING operator_eq encoding=ENCODING_VALUE)?
     (COMMA (COMPRESSOR | COMPRESSION) operator_eq compressor=COMPRESSOR_VALUE)?
-    (COMMA propertyClause)*
+    (COMMA attributePair)*
     tagClause?
     attributeClause?
     // Simplified version (supported since v0.13)
-    | alias? WITH? (DATATYPE operator_eq)? dataType=DATATYPE_VALUE
+    | aliasNodeName? WITH? (DATATYPE operator_eq)? dataType=DATATYPE_VALUE
     (ENCODING operator_eq encoding=ENCODING_VALUE)?
     ((COMPRESSOR | COMPRESSION) operator_eq compressor=COMPRESSOR_VALUE)?
-    propertyClause*
+    attributePair*
     tagClause?
     attributeClause?
     ;
 
-alias
-    : LR_BRACKET nodeNameCanInExpr RR_BRACKET
+aliasNodeName
+    : LR_BRACKET nodeName RR_BRACKET
     ;
 
 tagClause
-    : TAGS LR_BRACKET propertyClause (COMMA propertyClause)* RR_BRACKET
+    : TAGS LR_BRACKET attributePair (COMMA attributePair)* RR_BRACKET
     ;
 
-propertyClause
-    : name=identifier (OPERATOR_SEQ | OPERATOR_DEQ) value=propertyValue
+attributeClause
+    : ATTRIBUTES LR_BRACKET attributePair (COMMA attributePair)* RR_BRACKET
     ;
 
-propertyValue
+attributePair
+    : key=attributeKey (OPERATOR_SEQ | OPERATOR_DEQ) value=attributeValue
+    ;
+
+attributeKey
     : identifier
     | constant
     ;
 
-attributeClause
-    : ATTRIBUTES LR_BRACKET propertyClause (COMMA propertyClause)* RR_BRACKET
+attributeValue
+    : identifier
+    | constant
     ;
 
 // Limit & Offset Clause
@@ -991,4 +988,4 @@ slimitClause
 
 soffsetClause
     : SOFFSET INTEGER_LITERAL
-    ;
\ No newline at end of file
+    ;
diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4 b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
index 48a415de66..270d8c27f8 100644
--- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
@@ -653,7 +653,7 @@ TEXT
 // Encoding Type Keywords
 
 ENCODING_VALUE
-    : DICTIONARY | DIFF | GORILLA | PLAIN | REGULAR | RLE | TS_2DIFF | ZIGZAG | FREQ
+    : DICTIONARY | DIFF | GORILLA | PLAIN | REGULAR | RLE | TS_2DIFF | ZIGZAG | FREQ | DESCEND | SIMPLE8B | SIMPLE8B_SPARSE
     ;
 
 DICTIONARY
@@ -692,6 +692,18 @@ FREQ
     : F R E Q
     ;
 
+DESCEND
+	: D E S C E N D
+	;
+	
+SIMPLE8B
+	: S I M P L E '8' B
+	;
+
+SIMPLE8B_SPARSE
+	: S I M P L E '8' B '_' S P A R S E
+	;
+
 
 // Compressor Type Keywords
 
@@ -971,11 +983,7 @@ ID
     : NAME_CHAR+
     ;
 
-QUTOED_ID_IN_NODE_NAME
-    : BQUOTA_STRING_IN_NODE_NAME
-    ;
-
-QUTOED_ID
+QUOTED_ID
     : BQUOTA_STRING
     ;
 
@@ -998,20 +1006,17 @@ fragment CN_CHAR
     ;
 
 fragment DQUOTA_STRING
-    : '"' ( '\\'. | ~('"'| '\\') )* '"'
+    : '"' ( '\\'. | '""' | ~('"'| '\\') )* '"'
     ;
 
 fragment SQUOTA_STRING
-    : '\'' ( '\\'. | ~('\''| '\\') )* '\''
+    : '\'' ( '\\'. | '\'\'' |~('\''| '\\') )* '\''
     ;
 
 fragment BQUOTA_STRING
-    : '`' ( '\\'. | ~('`'| '\\') )* '`'
+    : '`' ( '\\' ~('`') | '``' | ~('`'| '\\') )* '`'
     ;
 
-fragment BQUOTA_STRING_IN_NODE_NAME
-    : '`' ( '\\' ('`'|'\\'|'\''|'"') | ~('`'|'\\'|'.'|'\''|'"'))* '`'
-    ;
 
 // Characters and write it this way for case sensitivity
 
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CSchemaProcessor.java b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CSchemaProcessor.java
index 4bf9b576ae..9175869077 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CSchemaProcessor.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CSchemaProcessor.java
@@ -236,7 +236,9 @@ public class CSchemaProcessor extends LocalSchemaProcessor {
         if (measurementSchema instanceof VectorMeasurementSchema) {
           for (String subMeasurement : measurementSchema.getSubMeasurementsList()) {
             cacheMeta(
-                new AlignedPath(fullPath.getDevice(), subMeasurement), measurementMNode, false);
+                new AlignedPath(fullPath.getDeviceIdString(), subMeasurement),
+                measurementMNode,
+                false);
           }
         } else {
           cacheMeta(fullPath, measurementMNode, true);
@@ -380,7 +382,7 @@ public class CSchemaProcessor extends LocalSchemaProcessor {
         getMNodesLocally(plan.getDevicePath(), plan.getMeasurements(), measurementMNodes);
     if (nonExistSchemaIndex == -1) {
       plan.setMeasurementMNodes(measurementMNodes);
-      return new InternalMNode(null, plan.getDevicePath().getDevice());
+      return new InternalMNode(null, plan.getDevicePath().getDeviceIdString());
     }
     // auto-create schema in IoTDBConfig is always disabled in the cluster version, and we have
     // another config in ClusterConfig to do this
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterDataQueryExecutor.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterDataQueryExecutor.java
index 39ef8f1a1c..c0c1d05388 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterDataQueryExecutor.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/ClusterDataQueryExecutor.java
@@ -167,7 +167,7 @@ public class ClusterDataQueryExecutor extends RawDataQueryExecutor {
         reader =
             readerFactory.getSeriesReader(
                 path,
-                queryPlan.getAllMeasurementsInDevice(path.getDevice()),
+                queryPlan.getAllMeasurementsInDevice(path.getDeviceIdString()),
                 dataType,
                 timeFilter,
                 null,
@@ -278,7 +278,7 @@ public class ClusterDataQueryExecutor extends RawDataQueryExecutor {
               IReaderByTimestamp readerByTimestamp =
                   readerFactory.getReaderByTimestamp(
                       path,
-                      queryPlan.getAllMeasurementsInDevice(path.getDevice()),
+                      queryPlan.getAllMeasurementsInDevice(path.getDeviceIdString()),
                       dataType,
                       context,
                       dataGroupMember,
@@ -293,7 +293,7 @@ public class ClusterDataQueryExecutor extends RawDataQueryExecutor {
               IPointReader pointReader =
                   readerFactory.getSeriesPointReader(
                       path,
-                      queryPlan.getAllMeasurementsInDevice(path.getDevice()),
+                      queryPlan.getAllMeasurementsInDevice(path.getDeviceIdString()),
                       dataType,
                       timeFilter,
                       null,
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/aggregate/ClusterAggregateExecutor.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/aggregate/ClusterAggregateExecutor.java
index 022da56122..b0e3c42418 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/aggregate/ClusterAggregateExecutor.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/aggregate/ClusterAggregateExecutor.java
@@ -98,7 +98,7 @@ public class ClusterAggregateExecutor extends AggregationExecutor {
       throws StorageEngineException, QueryProcessException {
     return readerFactory.getReaderByTimestamp(
         path,
-        dataQueryPlan.getAllMeasurementsInDevice(path.getDevice()),
+        dataQueryPlan.getAllMeasurementsInDevice(path.getDeviceIdString()),
         dataType,
         context,
         dataQueryPlan.isAscending(),
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/fill/ClusterFillExecutor.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/fill/ClusterFillExecutor.java
index 1a45a9f212..29c2e76f54 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/fill/ClusterFillExecutor.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/fill/ClusterFillExecutor.java
@@ -85,7 +85,7 @@ public class ClusterFillExecutor extends FillQueryExecutor {
       IReaderByTimestamp reader =
           clusterReaderFactory.getReaderByTimestamp(
               path,
-              plan.getAllMeasurementsInDevice(path.getDevice()),
+              plan.getAllMeasurementsInDevice(path.getDeviceIdString()),
               dataTypes.get(i),
               context,
               plan.isAscending(),
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/groupby/ClusterGroupByVFilterDataSet.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/groupby/ClusterGroupByVFilterDataSet.java
index d262da87fe..12c6bb9ad1 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/groupby/ClusterGroupByVFilterDataSet.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/groupby/ClusterGroupByVFilterDataSet.java
@@ -66,7 +66,7 @@ public class ClusterGroupByVFilterDataSet extends GroupByWithValueFilterDataSet
       throws StorageEngineException, QueryProcessException {
     return readerFactory.getReaderByTimestamp(
         path,
-        dataQueryPlan.getAllMeasurementsInDevice(path.getDevice()),
+        dataQueryPlan.getAllMeasurementsInDevice(path.getDeviceIdString()),
         path.getSeriesType(),
         context,
         dataQueryPlan.isAscending(),
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
index ae367dec92..3f846c9505 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterReaderFactory.java
@@ -277,7 +277,8 @@ public class ClusterReaderFactory {
       partialPaths.forEach(
           partialPath -> {
             Set<String> measurements =
-                deviceMeasurements.getOrDefault(partialPath.getDevice(), Collections.emptySet());
+                deviceMeasurements.getOrDefault(
+                    partialPath.getDeviceIdString(), Collections.emptySet());
             partitionGroupDeviceMeasurements.put(partialPath.getFullPath(), measurements);
             partitionGroupTSDataType.add(dataTypes.get(paths.lastIndexOf(partialPath)));
           });
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterTimeGenerator.java b/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterTimeGenerator.java
index c2f117fb11..cb50c91e3c 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterTimeGenerator.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/query/reader/ClusterTimeGenerator.java
@@ -115,7 +115,7 @@ public class ClusterTimeGenerator extends ServerTimeGenerator {
       mergeReader =
           readerFactory.getSeriesReader(
               path,
-              queryPlan.getAllMeasurementsInDevice(path.getDevice()),
+              queryPlan.getAllMeasurementsInDevice(path.getDeviceIdString()),
               dataType,
               timeFilter,
               filter,
@@ -187,7 +187,7 @@ public class ClusterTimeGenerator extends ServerTimeGenerator {
           IPointReader pointReader =
               readerFactory.getSeriesPointReader(
                   path,
-                  queryPlan.getAllMeasurementsInDevice(path.getDevice()),
+                  queryPlan.getAllMeasurementsInDevice(path.getDeviceIdString()),
                   dataType,
                   timeFilter,
                   filter,
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/FileSnapshotTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/FileSnapshotTest.java
index 73f44563bd..d636ef73b3 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/FileSnapshotTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/FileSnapshotTest.java
@@ -119,10 +119,10 @@ public class FileSnapshotTest extends DataSnapshotTest {
     }
     DataRegion processor =
         StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
-    assertEquals(9, processor.getPartitionMaxFileVersions(0));
+    assertEquals(10, processor.getPartitionMaxFileVersions(0));
     List<TsFileResource> loadedFiles = processor.getSequenceFileList();
     assertEquals(tsFileResources.size(), loadedFiles.size());
-    for (int i = 0; i < 9; i++) {
+    for (int i = 0; i < loadedFiles.size(); i++) {
       assertEquals(i, loadedFiles.get(i).getMaxPlanIndex());
     }
     assertEquals(0, processor.getUnSequenceFileList().size());
@@ -163,10 +163,10 @@ public class FileSnapshotTest extends DataSnapshotTest {
       }
       DataRegion processor =
           StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
-      assertEquals(9, processor.getPartitionMaxFileVersions(0));
+      assertEquals(10, processor.getPartitionMaxFileVersions(0));
       List<TsFileResource> loadedFiles = processor.getSequenceFileList();
       assertEquals(tsFileResources.size(), loadedFiles.size());
-      for (int i = 0; i < 9; i++) {
+      for (int i = 0; i < loadedFiles.size(); i++) {
         assertEquals(i, loadedFiles.get(i).getMaxPlanIndex());
       }
       assertEquals(0, processor.getUnSequenceFileList().size());
@@ -213,10 +213,10 @@ public class FileSnapshotTest extends DataSnapshotTest {
     }
     DataRegion processor =
         StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
-    assertEquals(9, processor.getPartitionMaxFileVersions(0));
+    assertEquals(10, processor.getPartitionMaxFileVersions(0));
     List<TsFileResource> loadedFiles = processor.getSequenceFileList();
     assertEquals(tsFileResources.size(), loadedFiles.size());
-    for (int i = 0; i < 9; i++) {
+    for (int i = 0; i < loadedFiles.size(); i++) {
       assertEquals(i, loadedFiles.get(i).getMaxPlanIndex());
       ModificationFile modFile = loadedFiles.get(i).getModFile();
       assertTrue(modFile.exists());
@@ -253,10 +253,10 @@ public class FileSnapshotTest extends DataSnapshotTest {
     for (int j = 0; j < 10; j++) {
       DataRegion processor =
           StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(j)));
-      assertEquals(9, processor.getPartitionMaxFileVersions(0));
+      assertEquals(10, processor.getPartitionMaxFileVersions(0));
       List<TsFileResource> loadedFiles = processor.getSequenceFileList();
       assertEquals(10, loadedFiles.size());
-      for (int i = 0; i < 9; i++) {
+      for (int i = 0; i < loadedFiles.size(); i++) {
         assertEquals(i, loadedFiles.get(i).getMaxPlanIndex());
       }
       assertEquals(0, processor.getUnSequenceFileList().size());
@@ -299,10 +299,10 @@ public class FileSnapshotTest extends DataSnapshotTest {
     }
     DataRegion processor =
         StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
-    assertEquals(10, processor.getPartitionMaxFileVersions(0));
+    assertEquals(11, processor.getPartitionMaxFileVersions(0));
     List<TsFileResource> loadedFiles = processor.getSequenceFileList();
     assertEquals(tsFileResources.size(), loadedFiles.size());
-    for (int i = 0; i < 9; i++) {
+    for (int i = 0; i < loadedFiles.size(); i++) {
       assertEquals(i, loadedFiles.get(i).getMaxPlanIndex());
     }
     assertEquals(1, processor.getUnSequenceFileList().size());
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PartitionedSnapshotTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PartitionedSnapshotTest.java
index dea05a1dbd..f769ce3e74 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PartitionedSnapshotTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PartitionedSnapshotTest.java
@@ -112,10 +112,10 @@ public class PartitionedSnapshotTest extends DataSnapshotTest {
     }
     DataRegion processor =
         StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
-    assertEquals(9, processor.getPartitionMaxFileVersions(0));
+    assertEquals(10, processor.getPartitionMaxFileVersions(0));
     List<TsFileResource> loadedFiles = processor.getSequenceFileList();
     assertEquals(tsFileResources.size(), loadedFiles.size());
-    for (int i = 0; i < 9; i++) {
+    for (int i = 0; i < loadedFiles.size(); i++) {
       assertEquals(i, loadedFiles.get(i).getMaxPlanIndex());
     }
     assertEquals(0, processor.getUnSequenceFileList().size());
@@ -189,7 +189,7 @@ public class PartitionedSnapshotTest extends DataSnapshotTest {
       }
       DataRegion processor =
           StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
-      assertEquals(-1, processor.getPartitionMaxFileVersions(0));
+      assertEquals(0, processor.getPartitionMaxFileVersions(0));
       List<TsFileResource> loadedFiles = processor.getSequenceFileList();
       assertEquals(0, loadedFiles.size());
       assertEquals(0, processor.getUnSequenceFileList().size());
diff --git a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PullSnapshotTaskTest.java b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PullSnapshotTaskTest.java
index 2bf2c8da52..76123de15a 100644
--- a/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PullSnapshotTaskTest.java
+++ b/cluster/src/test/java/org/apache/iotdb/cluster/log/snapshot/PullSnapshotTaskTest.java
@@ -294,7 +294,7 @@ public class PullSnapshotTaskTest extends DataSnapshotTest {
     }
     DataRegion processor =
         StorageEngine.getInstance().getProcessor(new PartialPath(TestUtils.getTestSg(0)));
-    assertEquals(9, processor.getPartitionMaxFileVersions(0));
+    assertEquals(10, processor.getPartitionMaxFileVersions(0));
     List<TsFileResource> loadedFiles = processor.getSequenceFileList();
     assertEquals(tsFileResources.size(), loadedFiles.size());
     for (int i = 0; i < 9; i++) {
diff --git a/confignode/src/assembly/resources/sbin/stop-confignode.sh b/confignode/src/assembly/resources/sbin/stop-confignode.sh
index d4725bd180..0fc7b7b4c3 100644
--- a/confignode/src/assembly/resources/sbin/stop-confignode.sh
+++ b/confignode/src/assembly/resources/sbin/stop-confignode.sh
@@ -21,13 +21,20 @@
 
 CONFIGNODE_CONF="`dirname "$0"`/../conf"
 rpc_port=`sed '/^rpc_port=/!d;s/.*=//' ${CONFIGNODE_CONF}/iotdb-confignode.properties`
-if type lsof > /dev/null; then
-  PID=$(lsof -t -i:${rpc_port})
+
+if  type lsof > /dev/null 2>&1 ; then
+  PID=$(lsof -t -i:${rpc_port} -sTCP:LISTEN)
+elif type netstat > /dev/null 2>&1 ; then
+  PID=$(netstat -anp 2>/dev/null | grep ":${rpc_port} " | grep ' LISTEN ' | awk '{print $NF}' | sed "s|/.*||g" )
 else
-  PID=$(ps ax | grep -i 'ConfigNode' | grep java | grep -v grep | awk '{print $1}')
+  echo ""
+  echo " Error: No necessary tool."
+  echo " Please install 'lsof' or 'netstat'."
+  exit 1
 fi
+
 if [ -z "$PID" ]; then
-  echo "No ConfigNode server to stop"
+  echo "No ConfigNode to stop"
   exit 1
 else
   kill -s TERM $PID
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/client/AsyncClientPool.java b/confignode/src/main/java/org/apache/iotdb/confignode/client/AsyncClientPool.java
index 017b61e6c5..89384d4da8 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/client/AsyncClientPool.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/client/AsyncClientPool.java
@@ -54,10 +54,6 @@ public class AsyncClientPool {
     AsyncDataNodeInternalServiceClient client;
     try {
       client = clientManager.borrowClient(endPoint);
-      if (client == null) {
-        LOGGER.error("Can't get client for DataNode {}", endPoint);
-        return;
-      }
       client.createSchemaRegion(req, handler);
     } catch (IOException e) {
       LOGGER.error("Can't connect to DataNode {}", endPoint, e);
@@ -76,10 +72,6 @@ public class AsyncClientPool {
     AsyncDataNodeInternalServiceClient client;
     try {
       client = clientManager.borrowClient(endPoint);
-      if (client == null) {
-        LOGGER.error("Can't get client for DataNode {}", endPoint);
-        return;
-      }
       client.createDataRegion(req, handler);
     } catch (IOException e) {
       LOGGER.error("Can't connect to DataNode {}", endPoint, e);
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterSchemaManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterSchemaManager.java
index fedc366d1e..96aff29971 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterSchemaManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ClusterSchemaManager.java
@@ -136,7 +136,8 @@ public class ClusterSchemaManager {
       TConsensusGroupId consensusGroupId =
           new TConsensusGroupId(type, partitionInfo.generateNextRegionGroupId());
       regionReplicaSet.setRegionId(consensusGroupId);
-      regionReplicaSet.setDataNodeLocations(onlineDataNodes.subList(0, replicaCount));
+      regionReplicaSet.setDataNodeLocations(
+          new ArrayList<>(onlineDataNodes.subList(0, replicaCount)));
       createRegionsReq.addRegion(regionReplicaSet);
 
       switch (type) {
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
index c8b55e1bdc..580f5f49f1 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
@@ -43,7 +43,6 @@ import org.apache.iotdb.confignode.consensus.response.DataPartitionResp;
 import org.apache.iotdb.confignode.consensus.response.PermissionInfoResp;
 import org.apache.iotdb.confignode.consensus.response.SchemaPartitionResp;
 import org.apache.iotdb.confignode.consensus.response.StorageGroupSchemaResp;
-import org.apache.iotdb.confignode.persistence.AuthorInfo;
 import org.apache.iotdb.consensus.common.DataSet;
 import org.apache.iotdb.db.mpp.common.schematree.PathPatternTree;
 import org.apache.iotdb.rpc.TSStatusCode;
@@ -361,7 +360,17 @@ public class ConfigManager implements Manager {
   public TSStatus login(String username, String password) {
     TSStatus status = confirmLeader();
     if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-      return AuthorInfo.getInstance().login(username, password);
+      return permissionManager.login(username, password);
+    } else {
+      return status;
+    }
+  }
+
+  @Override
+  public TSStatus checkUserPrivileges(String username, List<String> paths, int permission) {
+    TSStatus status = confirmLeader();
+    if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+      return permissionManager.checkUserPrivileges(username, paths, permission);
     } else {
       return status;
     }
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/LoadManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/LoadManager.java
new file mode 100644
index 0000000000..39bf58b28d
--- /dev/null
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/LoadManager.java
@@ -0,0 +1,34 @@
+/*
+ * 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.confignode.manager;
+
+/**
+ * The LoadBalancer at ConfigNodeGroup-Leader is active for cluster dynamic load balancing
+ * scheduling
+ */
+public class LoadManager {
+
+  private void metadataLoadBalance() {}
+
+  private void dataLoadBalance() {}
+
+  private void cleanDataSlice() {}
+
+  // TODO: Interfaces for active, interrupt and reset LoadBalancer
+}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java
index 1da702de25..4830af4a75 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java
@@ -34,6 +34,8 @@ import org.apache.iotdb.confignode.consensus.request.write.SetTimePartitionInter
 import org.apache.iotdb.consensus.common.DataSet;
 import org.apache.iotdb.db.mpp.common.schematree.PathPatternTree;
 
+import java.util.List;
+
 /**
  * a subset of services provided by {@ConfigManager}. For use internally only, passed to Managers,
  * services.
@@ -170,4 +172,14 @@ public interface Manager {
    * @return
    */
   TSStatus login(String username, String password);
+
+  /**
+   * Check User Privileges
+   *
+   * @param username
+   * @param paths
+   * @param permission
+   * @return
+   */
+  TSStatus checkUserPrivileges(String username, List<String> paths, int permission);
 }
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/PermissionManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/PermissionManager.java
index e17e9181b5..61ef6a614a 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/PermissionManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/PermissionManager.java
@@ -22,6 +22,9 @@ package org.apache.iotdb.confignode.manager;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.confignode.consensus.request.auth.AuthorReq;
 import org.apache.iotdb.confignode.consensus.response.PermissionInfoResp;
+import org.apache.iotdb.confignode.persistence.AuthorInfo;
+
+import java.util.List;
 
 /** manager permission query and operation */
 public class PermissionManager {
@@ -55,4 +58,12 @@ public class PermissionManager {
   private ConsensusManager getConsensusManager() {
     return configManager.getConsensusManager();
   }
+
+  public TSStatus login(String username, String password) {
+    return AuthorInfo.getInstance().login(username, password);
+  }
+
+  public TSStatus checkUserPrivileges(String username, List<String> paths, int permission) {
+    return AuthorInfo.getInstance().checkUserPrivileges(username, paths, permission);
+  }
 }
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/AuthorInfo.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/AuthorInfo.java
index 4428434b44..f489f70449 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/AuthorInfo.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/AuthorInfo.java
@@ -31,6 +31,7 @@ import org.apache.iotdb.db.auth.entity.PrivilegeType;
 import org.apache.iotdb.db.auth.entity.Role;
 import org.apache.iotdb.db.auth.entity.User;
 import org.apache.iotdb.db.utils.AuthUtils;
+import org.apache.iotdb.rpc.RpcUtils;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.slf4j.Logger;
@@ -77,7 +78,37 @@ public class AuthorInfo {
     return tsStatus;
   }
 
-  public TSStatus authorNonQuery(AuthorReq authorReq) throws AuthException {
+  public TSStatus checkUserPrivileges(String username, List<String> paths, int permission) {
+    boolean status = true;
+    try {
+      for (String path : paths) {
+        if (!checkOnePath(username, path, permission)) {
+          status = false;
+        }
+      }
+    } catch (AuthException e) {
+      status = false;
+    }
+    if (status) {
+      return RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
+    } else {
+      return RpcUtils.getStatus(TSStatusCode.NO_PERMISSION_ERROR);
+    }
+  }
+
+  private boolean checkOnePath(String username, String path, int permission) throws AuthException {
+    try {
+      if (authorizer.checkUserPrivileges(username, path, permission)) {
+        return true;
+      }
+    } catch (AuthException e) {
+      logger.error("Error occurs when checking the seriesPath {} for user {}", path, username, e);
+      throw new AuthException(e);
+    }
+    return false;
+  }
+
+  public TSStatus authorNonQuery(AuthorReq authorReq) {
     ConfigRequestType authorType = authorReq.getAuthorType();
     String userName = authorReq.getUserName();
     String roleName = authorReq.getRoleName();
@@ -129,39 +160,49 @@ public class AuthorInfo {
           authorizer.revokeRoleFromUser(roleName, userName);
           break;
         default:
-          throw new AuthException("execute " + authorReq + " failed");
+          throw new AuthException("unknown type: " + authorReq.getAuthorType());
       }
     } catch (AuthException e) {
-      throw new AuthException("execute " + authorReq + " failed: ", e);
+      return RpcUtils.getStatus(TSStatusCode.EXECUTE_PERMISSION_EXCEPTION_ERROR, e.getMessage());
     }
-    return new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
+    return RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
   }
 
-  public PermissionInfoResp executeListRole() throws AuthException {
+  public PermissionInfoResp executeListRole() {
     PermissionInfoResp result = new PermissionInfoResp();
     List<String> roleList = authorizer.listAllRoles();
     Map<String, List<String>> permissionInfo = new HashMap<>();
     permissionInfo.put(IoTDBConstant.COLUMN_ROLE, roleList);
-    result.setStatus(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
+    result.setStatus(RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS));
     result.setPermissionInfo(permissionInfo);
     return result;
   }
 
-  public PermissionInfoResp executeListUser() throws AuthException {
+  public PermissionInfoResp executeListUser() {
     PermissionInfoResp result = new PermissionInfoResp();
     List<String> userList = authorizer.listAllUsers();
     Map<String, List<String>> permissionInfo = new HashMap<>();
     permissionInfo.put(IoTDBConstant.COLUMN_USER, userList);
-    result.setStatus(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
+    result.setStatus(RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS));
     result.setPermissionInfo(permissionInfo);
     return result;
   }
 
   public PermissionInfoResp executeListRoleUsers(AuthorReq plan) throws AuthException {
     PermissionInfoResp result = new PermissionInfoResp();
-    Role role = authorizer.getRole(plan.getRoleName());
-    if (role == null) {
-      throw new AuthException("No such role : " + plan.getRoleName());
+    Map<String, List<String>> permissionInfo = new HashMap<>();
+    Role role;
+    try {
+      role = authorizer.getRole(plan.getRoleName());
+      if (role == null) {
+        result.setStatus(
+            RpcUtils.getStatus(
+                TSStatusCode.ROLE_NOT_EXIST_ERROR, "No such role : " + plan.getRoleName()));
+        result.setPermissionInfo(permissionInfo);
+        return result;
+      }
+    } catch (AuthException e) {
+      throw new AuthException(e);
     }
     List<String> roleUsersList = new ArrayList<>();
     List<String> userList = authorizer.listAllUsers();
@@ -171,35 +212,54 @@ public class AuthorInfo {
         roleUsersList.add(userN);
       }
     }
-    Map<String, List<String>> permissionInfo = new HashMap<>();
     permissionInfo.put(IoTDBConstant.COLUMN_USER, roleUsersList);
-    result.setStatus(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
+    result.setStatus(RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS));
     result.setPermissionInfo(permissionInfo);
     return result;
   }
 
   public PermissionInfoResp executeListUserRoles(AuthorReq plan) throws AuthException {
     PermissionInfoResp result = new PermissionInfoResp();
-    User user = authorizer.getUser(plan.getUserName());
-    if (user == null) {
-      throw new AuthException("No such user : " + plan.getUserName());
+    Map<String, List<String>> permissionInfo = new HashMap<>();
+    User user;
+    try {
+      user = authorizer.getUser(plan.getUserName());
+      if (user == null) {
+        result.setStatus(
+            RpcUtils.getStatus(
+                TSStatusCode.USER_NOT_EXIST_ERROR, "No such user : " + plan.getUserName()));
+        result.setPermissionInfo(permissionInfo);
+        return result;
+      }
+    } catch (AuthException e) {
+      throw new AuthException(e);
     }
     List<String> userRoleList = new ArrayList<>();
     for (String roleN : user.getRoleList()) {
       userRoleList.add(roleN);
     }
-    Map<String, List<String>> permissionInfo = new HashMap<>();
+
     permissionInfo.put(IoTDBConstant.COLUMN_ROLE, userRoleList);
-    result.setStatus(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
+    result.setStatus(RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS));
     result.setPermissionInfo(permissionInfo);
     return result;
   }
 
   public PermissionInfoResp executeListRolePrivileges(AuthorReq plan) throws AuthException {
     PermissionInfoResp result = new PermissionInfoResp();
-    Role role = authorizer.getRole(plan.getRoleName());
-    if (role == null) {
-      throw new AuthException("No such role : " + plan.getRoleName());
+    Map<String, List<String>> permissionInfo = new HashMap<>();
+    Role role;
+    try {
+      role = authorizer.getRole(plan.getRoleName());
+      if (role == null) {
+        result.setStatus(
+            RpcUtils.getStatus(
+                TSStatusCode.ROLE_NOT_EXIST_ERROR, "No such role : " + plan.getRoleName()));
+        result.setPermissionInfo(permissionInfo);
+        return result;
+      }
+    } catch (AuthException e) {
+      throw new AuthException(e);
     }
     List<String> rolePrivilegesList = new ArrayList<>();
     for (PathPrivilege pathPrivilege : role.getPrivilegeList()) {
@@ -208,27 +268,37 @@ public class AuthorInfo {
         rolePrivilegesList.add(pathPrivilege.toString());
       }
     }
-    Map<String, List<String>> permissionInfo = new HashMap<>();
+
     permissionInfo.put(IoTDBConstant.COLUMN_PRIVILEGE, rolePrivilegesList);
-    result.setStatus(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
+    result.setStatus(RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS));
     result.setPermissionInfo(permissionInfo);
     return result;
   }
 
   public PermissionInfoResp executeListUserPrivileges(AuthorReq plan) throws AuthException {
     PermissionInfoResp result = new PermissionInfoResp();
-    User user = authorizer.getUser(plan.getUserName());
-    if (user == null) {
-      throw new AuthException("No such user : " + plan.getUserName());
+    Map<String, List<String>> permissionInfo = new HashMap<>();
+    User user;
+    try {
+      user = authorizer.getUser(plan.getUserName());
+      if (user == null) {
+        result.setStatus(
+            RpcUtils.getStatus(
+                TSStatusCode.USER_NOT_EXIST_ERROR, "No such user : " + plan.getUserName()));
+        result.setPermissionInfo(permissionInfo);
+        return result;
+      }
+    } catch (AuthException e) {
+      throw new AuthException(e);
     }
     List<String> userPrivilegesList = new ArrayList<>();
-    Map<String, List<String>> permissionInfo = new HashMap<>();
+
     if (IoTDBConstant.PATH_ROOT.equals(plan.getUserName())) {
       for (PrivilegeType privilegeType : PrivilegeType.values()) {
         userPrivilegesList.add(privilegeType.toString());
       }
       permissionInfo.put(IoTDBConstant.COLUMN_PRIVILEGE, userPrivilegesList);
-      result.setStatus(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
+      result.setStatus(RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS));
       result.setPermissionInfo(permissionInfo);
       return result;
     } else {
@@ -255,7 +325,7 @@ public class AuthorInfo {
       }
       permissionInfo.put(IoTDBConstant.COLUMN_ROLE, rolePrivileges);
       permissionInfo.put(IoTDBConstant.COLUMN_PRIVILEGE, userPrivilegesList);
-      result.setStatus(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
+      result.setStatus(RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS));
       result.setPermissionInfo(permissionInfo);
       return result;
     }
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/ClusterSchemaInfo.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/ClusterSchemaInfo.java
index d684975c07..b1a72820ed 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/ClusterSchemaInfo.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/ClusterSchemaInfo.java
@@ -43,6 +43,7 @@ import org.apache.iotdb.rpc.TSStatusCode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -56,6 +57,7 @@ public class ClusterSchemaInfo {
   // StorageGroup read write lock
   private final ReentrantReadWriteLock storageGroupReadWriteLock;
 
+  // TODO: serialize and deserialize
   private MTreeAboveSG mTree;
 
   private ClusterSchemaInfo() {
@@ -328,6 +330,14 @@ public class ClusterSchemaInfo {
     return result;
   }
 
+  public void serialize(ByteBuffer buffer) {
+    // TODO: Serialize ClusterSchemaInfo
+  }
+
+  public void deserialize(ByteBuffer buffer) {
+    // TODO: Deserialize ClusterSchemaInfo
+  }
+
   @TestOnly
   public void clear() {
     mTree.clear();
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/DataNodeInfo.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/DataNodeInfo.java
index a728cd39a1..cd1f37d9ac 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/DataNodeInfo.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/DataNodeInfo.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.confignode.consensus.request.write.RegisterDataNodeReq;
 import org.apache.iotdb.confignode.consensus.response.DataNodeLocationsResp;
 import org.apache.iotdb.rpc.TSStatusCode;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -45,12 +46,13 @@ public class DataNodeInfo {
   // TODO: serialize and deserialize
   private AtomicInteger nextDataNodeId = new AtomicInteger(0);
 
-  /** online data nodes */
+  // Online data nodes
   // TODO: serialize and deserialize
   private final ConcurrentNavigableMap<Integer, TDataNodeLocation> onlineDataNodes =
       new ConcurrentSkipListMap();
 
-  /** For remove node or draining node */
+  // For remove node or draining node
+  // TODO: serialize and deserialize
   private final Set<TDataNodeLocation> drainingDataNodes = new HashSet<>();
 
   private DataNodeInfo() {
@@ -169,6 +171,14 @@ public class DataNodeInfo {
     return nextDataNodeId.getAndIncrement();
   }
 
+  public void serialize(ByteBuffer buffer) {
+    // TODO: Serialize DataNodeInfo
+  }
+
+  public void deserialize(ByteBuffer buffer) {
+    // TODO: Deserialize DataNodeInfo
+  }
+
   @TestOnly
   public void clear() {
     nextDataNodeId = new AtomicInteger(0);
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/PartitionInfo.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/PartitionInfo.java
index b2aa633443..0799582995 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/PartitionInfo.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/PartitionInfo.java
@@ -39,6 +39,7 @@ import org.apache.iotdb.confignode.consensus.response.SchemaPartitionResp;
 import org.apache.iotdb.consensus.common.DataSet;
 import org.apache.iotdb.rpc.TSStatusCode;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -49,22 +50,20 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 /** manage data partition and schema partition */
 public class PartitionInfo {
 
-  // TODO: Serialize and Deserialize
-  private AtomicInteger nextRegionGroupId = new AtomicInteger(0);
-
   // Region read write lock
   private final ReentrantReadWriteLock regionReadWriteLock;
+  // TODO: Serialize and Deserialize
+  private AtomicInteger nextRegionGroupId = new AtomicInteger(0);
+  // TODO: Serialize and Deserialize
   private final Map<TConsensusGroupId, TRegionReplicaSet> regionMap;
 
-  // schema partition read write lock
+  // SchemaPartition read write lock
   private final ReentrantReadWriteLock schemaPartitionReadWriteLock;
-
-  // data partition read write lock
-  private final ReentrantReadWriteLock dataPartitionReadWriteLock;
-
   // TODO: Serialize and Deserialize
   private final SchemaPartition schemaPartition;
 
+  // DataPartition read write lock
+  private final ReentrantReadWriteLock dataPartitionReadWriteLock;
   // TODO: Serialize and Deserialize
   private final DataPartition dataPartition;
 
@@ -299,6 +298,14 @@ public class PartitionInfo {
     return result;
   }
 
+  public void serialize(ByteBuffer buffer) {
+    // TODO: Serialize PartitionInfo
+  }
+
+  public void deserialize(ByteBuffer buffer) {
+    // TODO: Deserialize PartitionInfo
+  }
+
   @TestOnly
   public void clear() {
     nextRegionGroupId = new AtomicInteger(0);
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
index 9dbb4b30bc..4d7f34c2f8 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
@@ -18,11 +18,9 @@
  */
 package org.apache.iotdb.confignode.service;
 
-import org.apache.iotdb.commons.exception.ShutdownException;
 import org.apache.iotdb.commons.exception.StartupException;
 import org.apache.iotdb.commons.service.JMXService;
 import org.apache.iotdb.commons.service.RegisterManager;
-import org.apache.iotdb.commons.utils.TestOnly;
 import org.apache.iotdb.confignode.conf.ConfigNodeConstant;
 import org.apache.iotdb.confignode.manager.ConfigManager;
 import org.apache.iotdb.confignode.service.thrift.ConfigNodeRPCService;
@@ -54,7 +52,11 @@ public class ConfigNode implements ConfigNodeMBean {
       this.configManager = new ConfigManager();
     } catch (IOException e) {
       LOGGER.error("Can't start ConfigNode consensus group!", e);
-      stop();
+      try {
+        stop();
+      } catch (IOException e2) {
+        LOGGER.error("Meet error when stop ConfigNode!", e);
+      }
       System.exit(0);
     }
   }
@@ -79,29 +81,26 @@ public class ConfigNode implements ConfigNodeMBean {
       setUp();
     } catch (StartupException | IOException e) {
       LOGGER.error("Meet error while starting up.", e);
-      deactivate();
+      try {
+        deactivate();
+      } catch (IOException e2) {
+        LOGGER.error("Meet error when stop ConfigNode!", e);
+      }
       return;
     }
 
     LOGGER.info("{} has started.", ConfigNodeConstant.GLOBAL_NAME);
   }
 
-  public void deactivate() {
+  public void deactivate() throws IOException {
     LOGGER.info("Deactivating {}...", ConfigNodeConstant.GLOBAL_NAME);
     registerManager.deregisterAll();
     JMXService.deregisterMBean(mbeanName);
+    configManager.close();
     LOGGER.info("{} is deactivated.", ConfigNodeConstant.GLOBAL_NAME);
   }
 
-  @TestOnly
-  public void shutdown() throws ShutdownException {
-    LOGGER.info("Deactivating {}...", ConfigNodeConstant.GLOBAL_NAME);
-    registerManager.shutdownAll();
-    JMXService.deregisterMBean(mbeanName);
-    LOGGER.info("{} is deactivated.", ConfigNodeConstant.GLOBAL_NAME);
-  }
-
-  public void stop() {
+  public void stop() throws IOException {
     deactivate();
   }
 }
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/service/balancer/LoadBalancer.java b/confignode/src/main/java/org/apache/iotdb/confignode/service/balancer/LoadBalancer.java
deleted file mode 100644
index a7e4472486..0000000000
--- a/confignode/src/main/java/org/apache/iotdb/confignode/service/balancer/LoadBalancer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.confignode.service.balancer;
-
-/**
- * The LoadBalancer at ConfigNodeGroup-Leader is active for cluster dynamic load balancing
- * scheduling
- */
-public class LoadBalancer implements Runnable {
-
-  @Override
-  public void run() {}
-
-  private void metadataLoadBalance() {}
-
-  private void dataLoadBalance() {}
-
-  private void cleanDataSlice() {}
-
-  // TODO: Interfaces for active, interrupt and reset LoadBalancer
-}
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java b/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
index d942abf4d1..758a6369b3 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
@@ -44,6 +44,7 @@ import org.apache.iotdb.confignode.manager.ConfigManager;
 import org.apache.iotdb.confignode.rpc.thrift.ConfigIService;
 import org.apache.iotdb.confignode.rpc.thrift.TAuthorizerReq;
 import org.apache.iotdb.confignode.rpc.thrift.TAuthorizerResp;
+import org.apache.iotdb.confignode.rpc.thrift.TCheckUserPrivilegesReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCountStorageGroupResp;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeLocationResp;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRegisterReq;
@@ -300,6 +301,12 @@ public class ConfigNodeRPCServiceProcessor implements ConfigIService.Iface {
     return configManager.login(req.getUserrname(), req.getPassword());
   }
 
+  @Override
+  public TSStatus checkUserPrivileges(TCheckUserPrivilegesReq req) throws TException {
+    return configManager.checkUserPrivileges(
+        req.getUsername(), req.getPaths(), req.getPermission());
+  }
+
   public void handleClientExit() {}
 
   // TODO: Interfaces for data operations
diff --git a/confignode/src/test/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessorTest.java b/confignode/src/test/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessorTest.java
index 7d60ec6671..39bd2a5b87 100644
--- a/confignode/src/test/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessorTest.java
+++ b/confignode/src/test/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessorTest.java
@@ -33,6 +33,7 @@ import org.apache.iotdb.confignode.persistence.DataNodeInfo;
 import org.apache.iotdb.confignode.persistence.PartitionInfo;
 import org.apache.iotdb.confignode.rpc.thrift.TAuthorizerReq;
 import org.apache.iotdb.confignode.rpc.thrift.TAuthorizerResp;
+import org.apache.iotdb.confignode.rpc.thrift.TCheckUserPrivilegesReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCountStorageGroupResp;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeLocationResp;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRegisterReq;
@@ -547,21 +548,30 @@ public class ConfigNodeRPCServiceProcessorTest {
     userList.add("root");
     userList.add("tempuser0");
     userList.add("tempuser1");
+
     List<String> roleList = new ArrayList<>();
     roleList.add("temprole0");
     roleList.add("temprole1");
+
     TAuthorizerReq authorizerReq;
     TAuthorizerResp authorizerResp;
+    TCheckUserPrivilegesReq checkUserPrivilegesReq;
+
     Set<Integer> privilegeList = new HashSet<>();
     privilegeList.add(PrivilegeType.DELETE_USER.ordinal());
     privilegeList.add(PrivilegeType.CREATE_USER.ordinal());
+
     Set<Integer> revokePrivilege = new HashSet<>();
     revokePrivilege.add(PrivilegeType.DELETE_USER.ordinal());
+
     Map<String, List<String>> permissionInfo;
     List<String> privilege = new ArrayList<>();
     privilege.add("root : CREATE_USER");
     privilege.add("root : CREATE_USER");
 
+    List<String> paths = new ArrayList<>();
+    paths.add("root.ln");
+
     cleanUserAndRole();
 
     // create user
@@ -580,6 +590,12 @@ public class ConfigNodeRPCServiceProcessorTest {
     status = processor.operatePermission(authorizerReq);
     Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
 
+    // check user privileges
+    checkUserPrivilegesReq =
+        new TCheckUserPrivilegesReq("tempuser0", paths, PrivilegeType.DELETE_USER.ordinal());
+    status = processor.checkUserPrivileges(checkUserPrivilegesReq);
+    Assert.assertEquals(TSStatusCode.NO_PERMISSION_ERROR.getStatusCode(), status.getCode());
+
     // drop user
     authorizerReq =
         new TAuthorizerReq(
@@ -670,6 +686,12 @@ public class ConfigNodeRPCServiceProcessorTest {
     status = processor.operatePermission(authorizerReq);
     Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
 
+    // check user privileges
+    checkUserPrivilegesReq =
+        new TCheckUserPrivilegesReq("tempuser0", paths, PrivilegeType.DELETE_USER.ordinal());
+    status = processor.checkUserPrivileges(checkUserPrivilegesReq);
+    Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
+
     // grant role
     authorizerReq =
         new TAuthorizerReq(
diff --git a/confignode/src/test/java/org/apache/iotdb/confignode/utils/ConfigNodeEnvironmentUtils.java b/confignode/src/test/java/org/apache/iotdb/confignode/utils/ConfigNodeEnvironmentUtils.java
deleted file mode 100644
index c178aadb1d..0000000000
--- a/confignode/src/test/java/org/apache/iotdb/confignode/utils/ConfigNodeEnvironmentUtils.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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.confignode.utils;
-
-import org.apache.iotdb.commons.exception.ShutdownException;
-import org.apache.iotdb.commons.utils.TestOnly;
-import org.apache.iotdb.confignode.conf.ConfigNodeConstant;
-import org.apache.iotdb.confignode.service.ConfigNode;
-
-import org.apache.commons.io.FileUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-
-import static org.junit.Assert.fail;
-
-/** Test environment for ConfigNode UT and IT */
-public class ConfigNodeEnvironmentUtils {
-
-  private static final Logger LOGGER = LoggerFactory.getLogger(ConfigNodeEnvironmentUtils.class);
-
-  private static ConfigNode daemon;
-
-  @TestOnly
-  public static void envSetUp() {
-    LOGGER.debug("ConfigNodeEnvironmentUtils setup...");
-
-    if (daemon == null) {
-      daemon = new ConfigNode();
-    }
-
-    try {
-      daemon.active();
-    } catch (Exception e) {
-      fail(e.getMessage());
-    }
-
-    createAllDir();
-  }
-
-  @TestOnly
-  public static void cleanEnv() {
-    LOGGER.debug("ConfigNodeEnvironmentUtils cleanEnv...");
-
-    if (daemon != null) {
-      daemon.stop();
-      daemon = null;
-    }
-
-    // delete all directory
-    cleanAllDir();
-  }
-
-  @TestOnly
-  public static void stopDaemon() {
-    if (daemon != null) {
-      daemon.stop();
-    }
-  }
-
-  @TestOnly
-  public static void shutdownDaemon() throws ShutdownException {
-    if (daemon != null) {
-      daemon.shutdown();
-    }
-  }
-
-  @TestOnly
-  public static void activeDaemon() {
-    if (daemon != null) {
-      daemon.active();
-    }
-  }
-
-  @TestOnly
-  public static void reactiveDaemon() {
-    if (daemon == null) {
-      daemon = new ConfigNode();
-      daemon.active();
-    } else {
-      activeDaemon();
-    }
-  }
-
-  @TestOnly
-  public static void restartDaemon() throws ShutdownException {
-    shutdownDaemon();
-    stopDaemon();
-    reactiveDaemon();
-  }
-
-  private static void createAllDir() {
-    createDir(ConfigNodeConstant.CONF_DIR);
-    createDir(ConfigNodeConstant.DATA_DIR);
-  }
-
-  private static void createDir(String dir) {
-    File file = new File(dir);
-    if (!file.mkdirs()) {
-      LOGGER.error("ConfigNodeEnvironmentUtils can't mkdir {}.", dir);
-    }
-  }
-
-  private static void cleanAllDir() {
-    cleanDir(ConfigNodeConstant.CONF_DIR);
-    cleanDir(ConfigNodeConstant.DATA_DIR);
-  }
-
-  public static void cleanDir(String dir) {
-    try {
-      FileUtils.deleteDirectory(new File(dir));
-    } catch (IOException e) {
-      LOGGER.error("ConfigNodeEnvironmentUtils can't remove dir {}.", dir, e);
-    }
-  }
-}
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/Utils.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/Utils.java
index f1842a6dea..5ec86b994b 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/Utils.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/Utils.java
@@ -37,41 +37,46 @@ import org.apache.thrift.transport.TByteBuffer;
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
 
 public class Utils {
   private static final int tempBufferSize = 1024;
   private static final byte PADDING_MAGIC = 0x47;
-  private static final String DataRegionAbbr = "DR";
-  private static final String SchemaRegionAbbr = "SR";
-  private static final String PartitionRegionAbbr = "PR";
+  private static final long DataRegionType = 0x01;
+  private static final long SchemaRegionType = 0x02;
+  private static final long PartitionRegionType = 0x03;
 
   public static String IPAddress(TEndPoint endpoint) {
     return String.format("%s:%d", endpoint.getIp(), endpoint.getPort());
   }
 
-  public static String groupFullName(ConsensusGroupId consensusGroupId) {
+  /** Encode the ConsensusGroupId into 6 bytes 2 Bytes for Group Type 4 Bytes for Group ID */
+  public static long groupEncode(ConsensusGroupId consensusGroupId) {
     // use abbreviations to prevent overflow
-    String groupTypeAbbr = null;
+    long groupType = 0L;
     switch (consensusGroupId.getType()) {
       case DataRegion:
         {
-          groupTypeAbbr = DataRegionAbbr;
+          groupType = DataRegionType;
           break;
         }
       case SchemaRegion:
         {
-          groupTypeAbbr = SchemaRegionAbbr;
+          groupType = SchemaRegionType;
           break;
         }
       case PartitionRegion:
         {
-          groupTypeAbbr = PartitionRegionAbbr;
+          groupType = PartitionRegionType;
           break;
         }
+      default:
+        {
+          return -1;
+        }
     }
-    return String.format("%s-%d", groupTypeAbbr, consensusGroupId.getId());
+    long groupCode = groupType << 32;
+    groupCode += (long) consensusGroupId.getId();
+    return groupCode;
   }
 
   public static String RatisPeerId(TEndPoint endpoint) {
@@ -104,12 +109,13 @@ public class Utils {
 
   /** Given ConsensusGroupId, generate a deterministic RaftGroupId current scheme: */
   public static RaftGroupId toRatisGroupId(ConsensusGroupId consensusGroupId) {
-    String groupFullName = groupFullName(consensusGroupId);
-    byte[] bGroupName = groupFullName.getBytes(StandardCharsets.UTF_8);
-    byte[] bPaddedGroupName = Arrays.copyOf(bGroupName, 16);
-    for (int i = bGroupName.length; i < 16; i++) {
+    long groupCode = groupEncode(consensusGroupId);
+    byte[] bGroupCode = ByteBuffer.allocate(Long.BYTES).putLong(groupCode).array();
+    byte[] bPaddedGroupName = new byte[16];
+    for (int i = 0; i < 10; i++) {
       bPaddedGroupName[i] = PADDING_MAGIC;
     }
+    System.arraycopy(bGroupCode, 2, bPaddedGroupName, 10, bGroupCode.length - 2);
 
     return RaftGroupId.valueOf(ByteString.copyFrom(bPaddedGroupName));
   }
@@ -117,32 +123,22 @@ public class Utils {
   /** Given raftGroupId, decrypt ConsensusGroupId out of it */
   public static ConsensusGroupId toConsensusGroupId(RaftGroupId raftGroupId) {
     byte[] padded = raftGroupId.toByteString().toByteArray();
-    int validOffset = padded.length - 1;
-    while (padded[validOffset] == PADDING_MAGIC) {
-      validOffset--;
-    }
-    String consensusGroupString = new String(padded, 0, validOffset + 1);
-    String[] items = consensusGroupString.split("-");
+    long type = (padded[10] << 8) + padded[11];
+    ByteBuffer byteBuffer = ByteBuffer.allocate(Integer.BYTES);
+    byteBuffer.put(padded, 12, 4);
+    byteBuffer.flip();
+    int gid = byteBuffer.getInt();
     ConsensusGroupId id;
-    switch (items[0]) {
-      case DataRegionAbbr:
-        {
-          id = new DataRegionId(Integer.parseInt(items[1]));
-          break;
-        }
-      case PartitionRegionAbbr:
-        {
-          id = new PartitionRegionId(Integer.parseInt(items[1]));
-          break;
-        }
-      case SchemaRegionAbbr:
-        {
-          id = new SchemaRegionId(Integer.parseInt(items[1]));
-          break;
-        }
-      default:
-        throw new IllegalArgumentException(
-            String.format("Unexpected consensusGroupId %s", items[0]));
+
+    if (type == DataRegionType) {
+      id = new DataRegionId(gid);
+    } else if (type == PartitionRegionType) {
+      id = new PartitionRegionId(gid);
+    } else if (type == SchemaRegionType) {
+      id = new SchemaRegionId(gid);
+    } else {
+      throw new IllegalArgumentException(
+          String.format("Unexpected consensusGroupId Type %d", type));
     }
     return id;
   }
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/standalone/StandAloneConsensus.java b/consensus/src/main/java/org/apache/iotdb/consensus/standalone/StandAloneConsensus.java
index 4650db4c16..f0d15221f2 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/standalone/StandAloneConsensus.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/standalone/StandAloneConsensus.java
@@ -19,6 +19,7 @@
 
 package org.apache.iotdb.consensus.standalone;
 
+import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.commons.consensus.ConsensusGroupId;
@@ -37,6 +38,9 @@ import org.apache.iotdb.consensus.statemachine.IStateMachine.Registry;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -66,7 +70,26 @@ class StandAloneConsensus implements IConsensus {
   }
 
   @Override
-  public void start() throws IOException {}
+  public void start() throws IOException {
+    if (!this.storageDir.exists()) {
+      storageDir.mkdirs();
+    } else {
+      try (DirectoryStream<Path> stream = Files.newDirectoryStream(storageDir.toPath())) {
+        for (Path path : stream) {
+          String filename = path.getFileName().toString();
+          String[] items = filename.split("_");
+          TConsensusGroupType type = TConsensusGroupType.valueOf(items[0]);
+          ConsensusGroupId consensusGroupId = ConsensusGroupId.Factory.createEmpty(type);
+          consensusGroupId.setId(Integer.parseInt(items[1]));
+          TEndPoint endPoint = new TEndPoint(items[2], Integer.parseInt(items[3]));
+          stateMachineMap.put(
+              consensusGroupId,
+              new StandAloneServerImpl(
+                  new Peer(consensusGroupId, endPoint), registry.apply(consensusGroupId)));
+        }
+      }
+    }
+  }
 
   @Override
   public void stop() throws IOException {}
@@ -125,6 +148,19 @@ class StandAloneConsensus implements IConsensus {
           StandAloneServerImpl impl =
               new StandAloneServerImpl(peers.get(0), registry.apply(groupId));
           impl.start();
+          String groupPath =
+              storageDir
+                  + File.separator
+                  + groupId.getType()
+                  + "_"
+                  + groupId.getId()
+                  + "_"
+                  + peers.get(0).getEndpoint().ip
+                  + "_"
+                  + peers.get(0).getEndpoint().port;
+          File file = new File(groupPath);
+          file.mkdirs();
+
           return impl;
         });
     if (exist.get()) {
@@ -141,6 +177,18 @@ class StandAloneConsensus implements IConsensus {
     stateMachineMap.computeIfPresent(
         groupId,
         (k, v) -> {
+          String groupPath =
+              storageDir
+                  + File.separator
+                  + groupId.getType()
+                  + "_"
+                  + groupId.getId()
+                  + "_"
+                  + thisNode.ip
+                  + "_"
+                  + thisNode.port;
+          File file = new File(groupPath);
+          file.delete();
           exist.set(true);
           v.stop();
           return null;
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/standalone/RecoveryTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/standalone/RecoveryTest.java
new file mode 100644
index 0000000000..0c9f0e74f6
--- /dev/null
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/standalone/RecoveryTest.java
@@ -0,0 +1,94 @@
+/*
+ * 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.consensus.standalone;
+
+import org.apache.iotdb.common.rpc.thrift.TEndPoint;
+import org.apache.iotdb.commons.consensus.ConsensusGroupId;
+import org.apache.iotdb.commons.consensus.SchemaRegionId;
+import org.apache.iotdb.consensus.ConsensusFactory;
+import org.apache.iotdb.consensus.IConsensus;
+import org.apache.iotdb.consensus.common.Peer;
+import org.apache.iotdb.consensus.common.response.ConsensusGenericResponse;
+import org.apache.iotdb.consensus.exception.ConsensusGroupAlreadyExistException;
+import org.apache.iotdb.consensus.statemachine.EmptyStateMachine;
+
+import org.apache.ratis.util.FileUtils;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+
+public class RecoveryTest {
+  private final ConsensusGroupId schemaRegionId = new SchemaRegionId(1);
+  private IConsensus consensusImpl;
+  private static final String STANDALONE_CONSENSUS_CLASS_NAME =
+      "org.apache.iotdb.consensus.standalone.StandAloneConsensus";
+
+  public void constructConsensus() throws IOException {
+    consensusImpl =
+        ConsensusFactory.getConsensusImpl(
+                STANDALONE_CONSENSUS_CLASS_NAME,
+                new TEndPoint("localhost", 9000),
+                new File("./target/recovery"),
+                gid -> new EmptyStateMachine())
+            .orElseThrow(
+                () ->
+                    new IllegalArgumentException(
+                        String.format(
+                            ConsensusFactory.CONSTRUCT_FAILED_MSG,
+                            STANDALONE_CONSENSUS_CLASS_NAME)));
+    consensusImpl.start();
+  }
+
+  @Before
+  public void setUp() throws Exception {
+    constructConsensus();
+  }
+
+  @After
+  public void tearDown() throws IOException {
+    consensusImpl.stop();
+    FileUtils.deleteFully(new File("./target/recovery"));
+  }
+
+  @Test
+  public void recoveryTest() throws Exception {
+    consensusImpl.addConsensusGroup(
+        schemaRegionId,
+        Collections.singletonList(new Peer(schemaRegionId, new TEndPoint("0.0.0.0", 9000))));
+
+    consensusImpl.stop();
+    consensusImpl = null;
+
+    constructConsensus();
+
+    ConsensusGenericResponse response =
+        consensusImpl.addConsensusGroup(
+            schemaRegionId,
+            Collections.singletonList(new Peer(schemaRegionId, new TEndPoint("0.0.0.0", 9000))));
+
+    Assert.assertEquals(
+        response.getException().getMessage(),
+        new ConsensusGroupAlreadyExistException(schemaRegionId).getMessage());
+  }
+}
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/standalone/StandAloneConsensusTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/standalone/StandAloneConsensusTest.java
index 0275868843..986e347356 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/standalone/StandAloneConsensusTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/standalone/StandAloneConsensusTest.java
@@ -40,6 +40,7 @@ import org.apache.iotdb.consensus.exception.IllegalPeerNumException;
 import org.apache.iotdb.consensus.statemachine.EmptyStateMachine;
 import org.apache.iotdb.consensus.statemachine.IStateMachine;
 
+import org.apache.ratis.util.FileUtils;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -134,7 +135,7 @@ public class StandAloneConsensusTest {
         ConsensusFactory.getConsensusImpl(
                 STANDALONE_CONSENSUS_CLASS_NAME,
                 new TEndPoint("localhost", 6667),
-                new File("./"),
+                new File("./target/standalone"),
                 gid -> {
                   switch (gid.getType()) {
                     case SchemaRegion:
@@ -156,6 +157,7 @@ public class StandAloneConsensusTest {
   @After
   public void tearDown() throws Exception {
     consensusImpl.stop();
+    FileUtils.deleteFully(new File("./target/standalone"));
   }
 
   @Test
diff --git a/docs/UserGuide/Data-Concept/Data-Model-and-Terminology.md b/docs/UserGuide/Data-Concept/Data-Model-and-Terminology.md
index 4b070a858c..6243cd536c 100644
--- a/docs/UserGuide/Data-Concept/Data-Model-and-Terminology.md
+++ b/docs/UserGuide/Data-Concept/Data-Model-and-Terminology.md
@@ -59,48 +59,39 @@ A `path` is an expression that conforms to the following constraints:
 
 ```sql
 path       
-    : layer_name ('.' layer_name)*
+    : nodeName ('.' nodeName)*
     ;
-layer_name
-    : wildcard? id wildcard?
+    
+nodeName
+    : wildcard? identifier wildcard?
     | wildcard
     ;
+    
 wildcard 
     : '*' 
     | '**'
     ;
 ```
 
-You can refer to the definition of `id` in [Syntax-Conventions](../Reference/Syntax-Conventions.md).
+We call the part of a path divided by `'.'` as a  `node` or `nodeName`. For example: `root.a.b.c` is a path with 4 nodes.
 
-We call the part of a path divided by `'.'` as a layer (`layer_name`). For example: `root.a.b.c` is a path with 4 layers.
-
-The following are the constraints on the layer (`layer_name`):
+The following are the constraints on the `nodeName`:
 
 * `root` is a reserved character, and it is only allowed to appear at the beginning layer of the time series mentioned below. If `root` appears in other layers, it cannot be parsed and an error will be reported.
-
 * Except for the beginning layer (`root`) of the time series, the characters supported in other layers are as follows:
 
-  * Chinese characters:  `"\u2E80"` to `"\u9FFF"`
-  * `"_","@","#","$"`
-  * `"A"` to `"Z"`, `"a"` to `"z"`, `"0"` to `"9"`
-
-* In addition to the beginning layer (`root`) of the time series and the storage group layer, other layers also support the use of special strings referenced by \` or `" ` as its name. It should be noted that the quoted string cannot contain `.` characters. Here are some legal examples:
-
-  * root.sg."select"."+-from="."where""where"""."\$", which contains 6 layers: root, sg, select, +-from, where"where", \$
-  * root.sg.\`\`\`\`.\`select\`.\`+="from"\`.\`\$\`, which contains 6 layers: root, sg, \`, select, +-"from", \$
-
-* Layer (`layer_name`) cannot start with a digit unless the layer(`layer_name`) is quoted with \` or `"`.
-
+  * [ 0-9 a-z A-Z _ : @ # $ { } ] (letters, numbers, a few special characters)
+  * ['\u2E80'..'\u9FFF'] (Chinese characters)
 * In particular, if the system is deployed on a Windows machine, the storage group layer name will be case-insensitive. For example, creating both `root.ln` and `root.LN` at the same time is not allowed.
+* If you want to use special characters in `nodeName`, you can quote it with back quote, detailed information can be found here: [Syntax-Conventions](https://iotdb.apache.org/UserGuide/Master/Reference/Syntax-Conventions.html).
 
 ### Path Pattern
 
-In order to make it easier and faster to express multiple timeseries paths, IoTDB provides users with the path pattern. Users can construct a path pattern by using wildcard `*` and `**`. Wildcard can appear in any layer of the path. 
+In order to make it easier and faster to express multiple timeseries paths, IoTDB provides users with the path pattern. Users can construct a path pattern by using wildcard `*` and `**`. Wildcard can appear in any node of the path. 
 
-`*` represents one layer. For example, `root.vehicle.*.sensor1` represents a 4-layer path which is prefixed with `root.vehicle` and suffixed with `sensor1`.
+`*` represents one node. For example, `root.vehicle.*.sensor1` represents a 4-node path which is prefixed with `root.vehicle` and suffixed with `sensor1`.
 
-`**` represents (`*`)+, which is one or more layers of `*`. For example, `root.vehicle.device1.**` represents all paths prefixed by `root.vehicle.device1` with layers greater than or equal to 4, like `root.vehicle.device1.*`, `root.vehicle.device1.*.*`, `root.vehicle.device1.*.*.*`, etc; `root.vehicle.**.sensor1` represents a path which is prefixed with `root.vehicle` and suffixed with `sensor1` and has at least 4 layers.
+`**` represents (`*`)+, which is one or more nodes of `*`. For example, `root.vehicle.device1.**` represents all paths prefixed by `root.vehicle.device1` with nodes num greater than or equal to 4, like `root.vehicle.device1.*`, `root.vehicle.device1.*.*`, `root.vehicle.device1.*.*.*`, etc; `root.vehicle.**.sensor1` represents a path which is prefixed with `root.vehicle` and suffixed with `sensor1` and has at least 4 nodes.
 
 > Note1: Wildcard `*` and `**` cannot be placed at the beginning of the path.
 
diff --git a/docs/UserGuide/Process-Data/Triggers.md b/docs/UserGuide/Process-Data/Triggers.md
index 2dc8d67b66..f711c0d811 100644
--- a/docs/UserGuide/Process-Data/Triggers.md
+++ b/docs/UserGuide/Process-Data/Triggers.md
@@ -209,13 +209,14 @@ WITH (
 
 At present, the trigger can listen to all data insertion operations on the time series. The hook can be called `BEFORE`  or `AFTER` the data is inserted.
 
-`FULL-PATH` is the name of the time series that the trigger listens to. The path must be a measurement path.
+`FULL-PATH` can be a time-series (measurement) path such as root.sg1.d1.s1, a device path such as root.sg1.d1, a storage group path such as root.sg1, or even  a non-measurement path with business semantic such as root.sg1.x.
 
 `CLASSNAME` is the full class name of the trigger.
 
-Note that `CLASSNAME`,  `KEY` and `VALUE` in the attributes need to be quoted in single or double quotes.
-
-
+Note
+1. `CLASSNAME`,  `KEY` and `VALUE` in the attributes need to be quoted in single or double quotes.
+2. Only one trigger can be registered per `full-path`.
+3. When multiple prefix paths of a path are registered with triggers, for example, trigger `trigger-sg1d1s1` is registed on root.sg1.d1, trigger `trigger-sg1d1` is registed on root.sg1.d1, and trigger `trigger-sg1` is registed on root.sg1. When inserting data to root.sg1.d1.s1, triggers will be  triggered in the following order: trigger-sg1d1s1 -> trigger-sg1d1 -> trigger-sg1.
 
 ### Drop Triggers
 
diff --git a/docs/UserGuide/Query-Data/Select-Expression.md b/docs/UserGuide/Query-Data/Select-Expression.md
index e3cf02c00b..c8f9807617 100644
--- a/docs/UserGuide/Query-Data/Select-Expression.md
+++ b/docs/UserGuide/Query-Data/Select-Expression.md
@@ -671,6 +671,80 @@ Result:
 Total line number = 12
 It costs 0.065s
 ```
+#### Equal Size Bucket Outlier Sample
+This function samples the input sequence with equal number of bucket outliers, that is, according to the downsampling ratio given by the user and the number of samples in the bucket, the input sequence is divided into several buckets according to a fixed number of points. Sampling by the given outlier sampling method within each bucket.
+
+| Function Name | Allowed Input Series Data Types | Required Attributes                           | Output Series Data Type | Series Data Type  Description                 |
+|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
+| EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE | INT32 / INT64 / FLOAT / DOUBLE | The value range of `proportion` is `(0, 1]`, the default is `0.1`</br> The value of `type` is `avg` or `stendis` or `cos` or `prenextdis`, the default is `avg` </br>The value of `number` should be greater than 0, the default is `3`| INT32 / INT64 / FLOAT / DOUBLE | Returns outlier samples in equal buckets that match the sampling ratio and the number of samples in the bucket |
+
+Parameter Description
+- `proportion`: sampling ratio
+- `number`: the number of samples in each bucket, default `3`
+- `type`: outlier sampling method, the value is
+  - `avg`: Take the average of the data points in the bucket, and find the `top number` farthest from the average according to the sampling ratio
+  - `stendis`: Take the vertical distance between each data point in the bucket and the first and last data points of the bucket to form a straight line, and according to the sampling ratio, find the `top number` with the largest distance
+  - `cos`: Set a data point in the bucket as b, the data point on the left of b as a, and the data point on the right of b as c, then take the cosine value of the angle between the ab and bc vectors. The larger the angle, the more likely it is an outlier. Find the `top number` with the smallest cos value
+  - `prenextdis`: Let a data point in the bucket be b, the data point to the left of b is a, and the data point to the right of b is c, then take the sum of the lengths of ab and bc as the yardstick, the larger the sum, the more likely it is to be an outlier, and find the `top number` with the largest sum value
+
+##### Demonstrate
+Example data: `root.ln.wf01.wt01.temperature` has a total of `100` ordered data from `0.0-99.0`. Among them, in order to add outliers, we make the number modulo 5 equal to 0 increment by 100.
+```
+IoTDB> select temperature from root.ln.wf01.wt01;
++-----------------------------+-----------------------------+
+|                         Time|root.ln.wf01.wt01.temperature|
++-----------------------------+-----------------------------+
+|1970-01-01T08:00:00.000+08:00|                          0.0|
+|1970-01-01T08:00:00.001+08:00|                          1.0|
+|1970-01-01T08:00:00.002+08:00|                          2.0|
+|1970-01-01T08:00:00.003+08:00|                          3.0|
+|1970-01-01T08:00:00.004+08:00|                          4.0|
+|1970-01-01T08:00:00.005+08:00|                        105.0|
+|1970-01-01T08:00:00.006+08:00|                          6.0|
+|1970-01-01T08:00:00.007+08:00|                          7.0|
+|1970-01-01T08:00:00.008+08:00|                          8.0|
+|1970-01-01T08:00:00.009+08:00|                          9.0|
+|1970-01-01T08:00:00.010+08:00|                         10.0|
+|1970-01-01T08:00:00.011+08:00|                         11.0|
+|1970-01-01T08:00:00.012+08:00|                         12.0|
+|1970-01-01T08:00:00.013+08:00|                         13.0|
+|1970-01-01T08:00:00.014+08:00|                         14.0|
+|1970-01-01T08:00:00.015+08:00|                        115.0|
+|1970-01-01T08:00:00.016+08:00|                         16.0|
+|.............................|.............................|
+|1970-01-01T08:00:00.092+08:00|                         92.0|
+|1970-01-01T08:00:00.093+08:00|                         93.0|
+|1970-01-01T08:00:00.094+08:00|                         94.0|
+|1970-01-01T08:00:00.095+08:00|                        195.0|
+|1970-01-01T08:00:00.096+08:00|                         96.0|
+|1970-01-01T08:00:00.097+08:00|                         97.0|
+|1970-01-01T08:00:00.098+08:00|                         98.0|
+|1970-01-01T08:00:00.099+08:00|                         99.0|
++-----------------------------+-----------------------------+
+```
+Sql:
+```sql
+select equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='avg', 'number'='2') as outlier_avg_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='stendis', 'number'='2') as outlier_stendis_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='cos', 'number'='2') as outlier_cos_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='prenextdis', 'number'='2') as outlier_prenextdis_sam [...]
+```
+Result:
+```
++-----------------------------+------------------+----------------------+------------------+-------------------------+
+|                         Time|outlier_avg_sample|outlier_stendis_sample|outlier_cos_sample|outlier_prenextdis_sample|
++-----------------------------+------------------+----------------------+------------------+-------------------------+
+|1970-01-01T08:00:00.005+08:00|             105.0|                 105.0|             105.0|                    105.0|
+|1970-01-01T08:00:00.015+08:00|             115.0|                 115.0|             115.0|                    115.0|
+|1970-01-01T08:00:00.025+08:00|             125.0|                 125.0|             125.0|                    125.0|
+|1970-01-01T08:00:00.035+08:00|             135.0|                 135.0|             135.0|                    135.0|
+|1970-01-01T08:00:00.045+08:00|             145.0|                 145.0|             145.0|                    145.0|
+|1970-01-01T08:00:00.055+08:00|             155.0|                 155.0|             155.0|                    155.0|
+|1970-01-01T08:00:00.065+08:00|             165.0|                 165.0|             165.0|                    165.0|
+|1970-01-01T08:00:00.075+08:00|             175.0|                 175.0|             175.0|                    175.0|
+|1970-01-01T08:00:00.085+08:00|             185.0|                 185.0|             185.0|                    185.0|
+|1970-01-01T08:00:00.095+08:00|             195.0|                 195.0|             195.0|                    195.0|
++-----------------------------+------------------+----------------------+------------------+-------------------------+
+Total line number = 10
+It costs 0.041s
+```
 
 ### User Defined Timeseries Generating Functions
 
diff --git a/docs/UserGuide/Query-Data/Without-Null.md b/docs/UserGuide/Query-Data/Without-Null.md
index ffa2ff5d5a..610128935c 100644
--- a/docs/UserGuide/Query-Data/Without-Null.md
+++ b/docs/UserGuide/Query-Data/Without-Null.md
@@ -94,13 +94,13 @@ specified columns can be expression
 
 ```sql
 select s2, - s2, s4, + s4, s2 + s4, s2 - s4, s2 * s4, s2 / s4, s2 % s4 from root.test.sg1 without null all (s2+s4, s2)
-``` 
+```
 
 2. If at least one column in `s2+s4` and `s2` of one row is null in the result set of the query, the row will be filtered out.
 
 ```sql
 select s2, - s2, s4, + s4, s2 + s4, s2 - s4, s2 * s4, s2 / s4, s2 % s4 from root.test.sg1 without null any (s2+s4, s2)
-``` 
+```
 
 ### With alias query
 
@@ -172,13 +172,13 @@ Assuming that the output results of the following query are listed as `root.test
 1. If both `root.test.sg1.s2` and `root.test.sg2.s3` columns of one row are null in the result set of the query, the row will be filtered out.
 
 ```sql
-select s2, s3 from root.test.** without null all(`root.test.sg1.s2`, `root.test.sg2.s3`)
+select s2, s3 from root.test.** without null all(root.test.sg1.s2, root.test.sg2.s3)
 ```
 
 2. If `root.test.sg1.s2`, `root.test.sg1.s3` and `root.test.sg2.s3` columns of one row are null in the result set of the query, the row will be filtered out.
 
 ```sql
-select s2, s3 from root.test.** without null all(`root.test.sg1.s2`, s3)
+select s2, s3 from root.test.** without null all(root.test.sg1.s2, s3)
 ```
 
 ### Aligned Timeseries Query
diff --git a/docs/UserGuide/Reference/Syntax-Conventions.md b/docs/UserGuide/Reference/Syntax-Conventions.md
index 2c6e79ae51..47aa477d38 100644
--- a/docs/UserGuide/Reference/Syntax-Conventions.md
+++ b/docs/UserGuide/Reference/Syntax-Conventions.md
@@ -33,18 +33,152 @@ A string is a sequence of characters, enclosed within either single quote (`'`)
 "another string"
 ```
 
+We will unescape the string unless it is used as a file path. Examples can be found in the usage scenarios part.
+
+More information about escape characters can be found in : [Characters (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)](https://docs.oracle.com/javase/tutorial/java/data/characters.html)
+
+#### Usage Scenarios
+
 Usages of string literals:
 
 - Values of  `TEXT` type data in `INSERT` or `SELECT` statements 
-- Full Java class names in UDF and trigger management statements 
-- Attribute fields (including attribute keys and attribute values) in UDF / trigger execution or management statements 
-- File paths in `LOAD` / `REMOVE` / `SETTLE` statements 
+
+  ```SQL
+  # insert
+  insert into root.ln.wf02.wt02(timestamp,hardware) values(1, 'v1')
+  insert into root.ln.wf02.wt02(timestamp,hardware) values(2, '\\')
+  
+  # select data from root.ln.wf02.wt02, '\\' is unescpaed as '\'.
+  +-----------------------------+--------------------------+
+  |                         Time|root.ln.wf02.wt02.hardware|
+  +-----------------------------+--------------------------+
+  |1970-01-01T08:00:00.001+08:00|                        v1|
+  +-----------------------------+--------------------------+
+  |1970-01-01T08:00:00.002+08:00|                         \|
+  +-----------------------------+--------------------------+
+  
+  # select 
+  select code from root.sg1.d1 where code in ('string1', 'string2');
+  ```
+
+- Used in`LOAD` / `REMOVE` / `SETTLE` instructions to represent file path. File path will  not be unescaped. 
+
+  ```SQL
+  # load
+  LOAD 'examplePath'
+  
+  # remove
+  REMOVE 'examplePath'
+  
+  # SETTLE
+  SETTLE 'examplePath'
+  ```
+
 - Password fields in user management statements
 
+  ```SQL
+  # 'write_pwd' is a password
+  CREATE USER ln_write_user 'write_pwd'
+  ```
+
+- Full Java class names in UDF and trigger management statements 
+
+  ```SQL
+  # Trigger example. Full java class names after 'AS' should be string literals.
+  CREATE TRIGGER `alert-listener-sg1d1s1`
+  AFTER INSERT
+  ON root.sg1.d1.s1
+  AS 'org.apache.iotdb.db.engine.trigger.example.AlertListener'
+  WITH (
+    'lo' = '0', 
+    'hi' = '100.0'
+  )
+  
+  # UDF example. Full java class names after 'AS' should be string literals.
+  CREATE FUNCTION example AS 'org.apache.iotdb.udf.UDTFExample'
+  ```
+
+- `AS` function provided by IoTDB can assign an alias to time series selected in query. Alias can be string or identifier.
+
+  ```SQL
+  select s1 as 'temperature', s2 as 'speed' from root.ln.wf01.wt01;
+  
+  # Header of dataset
+  +-----------------------------+-----------|-----+
+  |                         Time|temperature|speed|
+  +-----------------------------+-----------|-----+
+  ```
+
+- The key of an attribute can be String Literal and identifier, the value of an attribute can be Constant(including String Literal) and identifer. Using string literal to represent  key and value is recommended.
+
+  1. Attributes fields of trigger. See the attributes after `With` clause in the example below:
+
+  ```SQL
+  # exmaple
+  CREATE TRIGGER `alert-listener-sg1d1s1`
+  AFTER INSERT
+  ON root.sg1.d1.s1
+  AS 'org.apache.iotdb.db.engine.trigger.example.AlertListener'
+  WITH (
+    'lo' = '0', 
+    'hi' = '100.0'
+  )
+  ```
+
+  2. Attributes fields of UDF. See the attributes in select clause in the example below:
+
+  ```sql
+  # 示例
+  SELECT example(s1, s2, 'key1'='value1', 'key2'='value2') FROM root.sg.d1;
+  ```
+
+  3. Key-value pair to represent tag/attributes in timeseries.
+
+  ```SQL
+  # create timeseries
+  CREATE timeseries root.turbine.d1.s1(temprature) 
+  WITH datatype=FLOAT, encoding=RLE, compression=SNAPPY, 'max_point_number' = '5'
+  TAGS('tag1' = 'v1', 'tag2'= 'v2') ATTRIBUTES('attr1' = 'v1', 'attr2' = 'v2')
+  
+  # alter tags and attributes of timeseries
+  ALTER timeseries root.turbine.d1.s1 SET 'newTag1' = 'newV1', 'attr1' = 'newV1'
+  
+  # rename tag
+  ALTER timeseries root.turbine.d1.s1 RENAME 'tag1' TO 'newTag1'
+  
+  # upsert alias, tags, attributes
+  ALTER timeseries root.turbine.d1.s1 UPSERT 
+  ALIAS='newAlias' TAGS('tag2' = 'newV2', tag3=v3) ATTRIBUTES('attr3' ='v3', 'attr4'='v4')
+  
+  # add new tags
+  ALTER timeseries root.turbine.d1.s1 ADD TAGS 'tag3' = 'v3', 'tag4' = 'v4'
+  
+  # add new attributes
+  ALTER timeseries root.turbine.d1.s1 ADD ATTRIBUTES 'attr3' = 'v3', 'attr4' = 'v4'
+  
+  # query for timeseries
+  SHOW timeseries root.ln.** WHRER 'unit' = 'c'
+  ```
+
+  4. Attributes fields of Pipe and PipeSink. 
+
+  ```SQL
+  # PipeSink example 
+  CREATE PIPESINK my_iotdb AS IoTDB ('ip' = 'your ip')
+  
+  # Pipe example
+  CREATE PIPE my_pipe TO my_iotdb FROM 
+  (select ** from root WHERE time>=yyyy-mm-dd HH:MM:SS) WITH 'SyncDelOp' = 'true'
+  ```
+
+#### How to use quotation marks in String Literals
+
 There are several ways to include quote characters within a string:
 
  - Precede the quote character by an escape character (\\).
  - `'` inside a string quoted with `"` needs no special treatment and need not be doubled or escaped. In the same way, `"` inside a string quoted with `'` needs no special treatment.
+ - A `'` inside a string quoted with `'` may be written as `''`.
+- A `"` inside a string quoted with `"` may be written as `""`.
 
 The following examples demonstrate how quoting and escaping work:
 ```js
@@ -53,11 +187,14 @@ The following examples demonstrate how quoting and escaping work:
 '""string""'  // ""string""
 'str\'ing'  // str'ing
 '\'string'  // 'string
+'''string'  // 'string
+
 "string" // string
 "'string'"  // 'string'
 "''string''"  // ''string''
 "str\"ing"  // str"ing
 "\"string"  // "string
+"""string"  // "string
 ```
 
 ### Numeric Literals
@@ -88,130 +225,274 @@ The constants `TRUE` and `FALSE` evaluate to 1 and 0, respectively. The constant
 
 The `NULL` value means “no data.” `NULL` can be written in any lettercase.
 
-
 ## Identifiers
 
-Certain objects within IoTDB, including `TRIGGER`, `FUNCTION`(UDF), `CONTINUOUS QUERY`, `SCHEMA TEMPLATE`, `USER`, `ROLE` and other object names are known as identifiers.
+#### Usage scenarios
+
+Certain objects within IoTDB, including `TRIGGER`, `FUNCTION`(UDF), `CONTINUOUS QUERY`, `SCHEMA TEMPLATE`, `USER`, `ROLE`,`Pipe`,`PipeSink`,`alias` and other object names are known as identifiers.
+
+#### Constraints
 
-What you need to know about identifiers:
+Below are basic constraints of identifiers, specific identifiers may have other constraints, for example, `user` should consists of more than 4 characters. 
 
 - Permitted characters in unquoted identifiers:
   - [0-9 a-z A-Z _ : @ # $ { }] (letters, digits, some special characters)
   - ['\u2E80'..'\u9FFF'] (UNICODE Chinese characters)
-- Identifiers may begin with a digit and consist solely of digits, **which is not recommended!**
+- Identifiers may begin with a digit, unquoted identifiers can not consists of solely digits.
 - Identifiers are case sensitive.
-- Note: User and role names are not case-sensitive, and special characters are not allowed to be escaped.
-
-If an identifier contains special characters or is a keyword, you must quote it whenever you refer to it.
-The identifier quote character is the backtick (`):
-```sql
-id  // parsed as id
-ID  // parsed as ID
-id0  // parsed as id0
-_id  // parsed as _id
-0id  // parsed as 0id
-233  // parsed as 233 (not recommended!)
-ab!  // invalid
-`ab!`  // parsed as ab!
-`"ab"`  // parsed as "ab"
-`a`b`  // invalid
-`a\`b`  // parsed as a`b
+
+You need to quote the identifier with back quote(`) in the following cases:
+
+- Identifier contains special characters.
+- Using Key words as identifier
+- Identifier consists of solely digits.
+
+#### How to use quotations marks in quoted identifiers
+
+`'` and `"` can be used directly in quoted identifiers.
+
+` may be written as `` in quoted  identifiers. See the example below:
+
+```SQL
+# create template t1't"t
+create schema template `t1't"t` 
+(temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)
+
+# create template t1`t
+create schema template `t1``t` 
+(temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)
 ```
 
+#### Examples
+
+Examples of case in which quoted identifier is used :
+
+- Trigger name should be quoted in cases described above :
+
+  ```sql
+  # create trigger named alert.`listener-sg1d1s1
+  CREATE TRIGGER `alert.``listener-sg1d1s1`
+  AFTER INSERT
+  ON root.sg1.d1.s1
+  AS 'org.apache.iotdb.db.engine.trigger.example.AlertListener'
+  WITH (
+    'lo' = '0', 
+    'hi' = '100.0'
+  )
+  ```
+
+- UDF name should be quoted in cases described above :
+
+  ```sql
+  # craete function named select, select is a keyword.
+  CREATE FUNCTION `select` AS 'org.apache.iotdb.udf.UDTFExample'
+  ```
+
+- Template name should be quoted in cases described above :
+
+  ```sql
+  # create template named 111, 111 consists of solely digits.
+  create schema template `111` 
+  (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)
+  ```
+
+- User and Role name should be quoted in cases described above, blank space is not allow in User and Role name whether quoted or not :
+
+  ```sql
+  # create user special`user.
+  CREATE USER `special``user.` 'write_pwd'
+  
+  # create role `select`
+  CREATE ROLE `select`
+  ```
+
+- Continuous query name should be quoted in cases described above :
+
+  ```sql
+  # create continuous query test.cq
+  CREATE CONTINUOUS QUERY `test.cq` 
+  BEGIN 
+    SELECT max_value(temperature) 
+    INTO temperature_max 
+    FROM root.ln.*.* 
+    GROUP BY time(10s) 
+  END
+  ```
+
+- Pipe、PipeSink should be quoted in cases described above :
+
+  ```sql
+  # create PipeSink test.*1
+  CREATE PIPESINK `test.*1` AS IoTDB ('ip' = '输入你的IP')
+  
+  # create Pipe test.*2
+  CREATE PIPE `test.*2` TO `test.*1` FROM 
+  (select ** from root WHERE time>=yyyy-mm-dd HH:MM:SS) WITH 'SyncDelOp' = 'true'
+  ```
+
+- `AS` function provided by IoTDB can assign an alias to time series selected in query. Alias can be string or identifier.
+
+  ```sql
+  select s1 as temperature, s2 as speed from root.ln.wf01.wt01;
+  
+  # Header of result dataset
+  +-----------------------------+-----------|-----+
+  |                         Time|temperature|speed|
+  +-----------------------------+-----------|-----+
+  ```
+
+- The key of an attribute can be String Literal and identifier, the value of an attribute can be Constant(including String Literal) and identifer. Using string literal to represent  key and value is recommended. Below are examples of using identifier in key-value of tags and attributes:
+
+  ```SQL
+  # create timeseries
+  CREATE timeseries root.turbine.d1.s1(temprature) 
+  WITH datatype=FLOAT, encoding=RLE, compression=SNAPPY, max_point_number = 5
+  TAGS(tag1 = v1, tag2 = v2) ATTRIBUTES(attr1 = v1, attr2 = v2)
+  
+  # alter tags and attributes of timeseries
+  ALTER timeseries root.turbine.d1.s1 SET newTag1 = newV1, attr1 = newV1
+  
+  # rename tag
+  ALTER timeseries root.turbine.d1.s1 RENAME tag1 TO newTag1
+  
+  # upsert alias, tags, attributes
+  ALTER timeseries root.turbine.d1.s1 UPSERT 
+  ALIAS = newAlias TAGS(tag2 = newV2, tag3=v3) ATTRIBUTES(attr3 = v3, attr4 = v4)
+  
+  # add new tags
+  ALTER timeseries root.turbine.d1.s1 ADD TAGS tag3 = v3, tag4 = v4
+  
+  # add new attributes
+  ALTER timeseries root.turbine.d1.s1 ADD ATTRIBUTES attr3 = v3, attr4 = v4
+  
+  # query for timeseries
+  SHOW timeseries root.ln.** WHRER unit = c
+  ```
+
 ## Node Names in Path
 
-We call the part of a path divided by `.` as a `node`. 
+Node name is a special identifier, it can also be wildcard `*` and `**`. When creating timeseries, node name can not be wildcard. In query statment, you can use wildcard to match one or more nodes of path.
 
-The constraints of node names are almost the same as the identifiers, but you should note the following points:
+### Wildcard
 
-- `root` is a reserved word, and it is only allowed to appear at the beginning layer of the time series. If `root` appears in other layers, it cannot be parsed and an error will be reported.
-- Character `.` is not permitted in unquoted or quoted node names. If you must do it (even if it is not recommended), you can enclose it within either single quote (`'`) or double quote (`"`). In this case, quotes are recognized as part of the node name to avoid ambiguity.
-- Among the node name enclosed in the reverse quota, single quotes and double quotes need to use a backslash to escape.
-- In particular, if the system is deployed on a Windows machine, the storage group layer name will be **case-insensitive**. For example, creating both `root.ln` and `root.LN` at the same time is not allowed.
+`*` represents one node. For example, `root.vehicle.*.sensor1` represents a 4-node path which is prefixed with `root.vehicle` and suffixed with `sensor1`.
 
-Examples:
+`**` represents (`*`)+, which is one or more nodes of `*`. For example, `root.vehicle.device1.**` represents all paths prefixed by `root.vehicle.device1` with nodes num greater than or equal to 4, like `root.vehicle.device1.*`, `root.vehicle.device1.*.*`, `root.vehicle.device1.*.*.*`, etc; `root.vehicle.**.sensor1` represents a path which is prefixed with `root.vehicle` and suffixed with `sensor1` and has at least 4 nodes.
 
-```sql
-CREATE TIMESERIES root.a.b.s1+s2/s3.c WITH DATATYPE=INT32, ENCODING=RLE
-// invalid!
+As `*` can also be used in expressions of select clause to represent multiplication, below are examples to help you better understand the usage of `* `:
 
-CREATE TIMESERIES root.a.b.`s1+s2/s3`.c WITH DATATYPE=INT32, ENCODING=RLE
-// root.a.b.`s1+s2/s3`.c will be parsed as Path[root, a, b, s1+s2/s3, c]
-```
+```SQL
+# create timeseries root.sg.a*b
+create timeseries root.sg.`a*b` with datatype=FLOAT,encoding=PLAIN;
 
-```sql
-CREATE TIMESERIES root.a.b.select WITH DATATYPE=INT32, ENCODING=RLE
-// invalid!
+# As described in Identifier part, a*b should be quoted.
+# "create timeseries root.sg.a*b with datatype=FLOAT,encoding=PLAIN" is wrong. 
 
-CREATE TIMESERIES root.a.b.`select` WITH DATATYPE=INT32, ENCODING=RLE
-// root.a.b.`select` will be parsed as Path[root, a, b, `select`]
-```
+# create timeseries root.sg.a
+create timeseries root.sg.a with datatype=FLOAT,encoding=PLAIN;
+
+# create timeseries root.sg.b
+create timeseries root.sg.b with datatype=FLOAT,encoding=PLAIN;
 
-```sql
-CREATE TIMESERIES root.a.b.`s1.s2`.c WITH DATATYPE=INT32, ENCODING=RLE
-// invalid!
+# query data of root.sg.a*b
+select `a*b` from root.sg
+# Header of result dataset
+|Time|root.sg.a*b|
 
-CREATE TIMESERIES root.a.b."s1.s2".c WITH DATATYPE=INT32, ENCODING=RLE
-// root.a.b."s1.s2".c will be parsed as Path[root, a, b, "s1.s2", c]
+# multiplication of root.sg.a and root.sg.b
+select a*b from root.sg
+# Header of result dataset
+|Time|root.sg.a * root.sg.b|
 ```
 
-```sql
-CREATE TIMESERIES root.a.b.`s1"s2`.c WITH DATATYPE=INT32, ENCODING=RLE
-// invalid!
+### Identifier
 
-CREATE TIMESERIES root.a.b.`s1\"s2`.c WITH DATATYPE=INT32, ENCODING=RLE
-// root.a.b.`s1\"s2`.c be parsed as Path[root, a, b, s1\"s2, c]
-```
+When node name is not wildcard, it is a identifier, which means the constraints on it is the same as described in Identifier part.
 
-## Keywords and Reserved Words
+Node name quoted with back quote will also be wrapped with back quote in result dataset if it contains . or `, otherwise node name will not be quoted in result dataset. Below are examples to help you understand
 
-Keywords are words that have significance in SQL require special treatment for use as identifiers and node names, and need to be escaped with backticks.
-Certain keywords, such as TIME and ROOT, are reserved and cannot use as identifiers and node names (even after escaping).
+- Create timeseries stament:
 
-[Keywords and Reserved Words](Keywords.md) shows the keywords and reserved words in IoTDB 0.13.
+```SQL
+# Node name contains special characters like ` and .,all nodes of this timeseries are: ["root","sg","www.`baidu.com"]
+create timeseries root.sg.`www.``baidu.com`.a with datatype=FLOAT,encoding=PLAIN;
 
-## Expressions
+# Node name is a key word.
+create timeseries root.sg.`select`.a with datatype=FLOAT,encoding=PLAIN;
+
+# Node name consists of solely digits.
+create timeseries root.sg.`111` with datatype=FLOAT,encoding=PLAIN;
+```
 
-IoTDB supports the execution of arbitrary nested expressions consisting of numbers, time series, arithmetic expressions, and time series generating functions (including user-defined functions) in the `select` clause.
+After executing above statments, execute "show timeseries",below is the result:
 
-Note: Node names that consist solely of digits, `'` and `"` in an expression must be enclosed in backticks (`).
-```sql
--- There exists timeseries: root.sg.d.0, root.sg.d.'a' and root.sg."d".b
-select 0 from root.sg.d  -- ambiguity exists, parsing failed
-select 'a' from root.sg.d -- ambiguity exists, parsing failed
-select "d".b from root.sg -- ambiguity exists, parsing failed
-select `0` from root.sg.d  -- query from root.sg.d.0
-select `0` + 0 from root.sg.d -- valid expression, add number 0 to each point of root.sg.d.0
-select myudf(`'a'`, 'x') from root.sg.d -- valid expression, call function myudf with timeseries root.sg.d.'a' as the 1st parameter, and a string constant 'x' as the 2nd parameter
+```SQL
++---------------------------+-----+-------------+--------+--------+-----------+----+----------+
+|                 timeseries|alias|storage group|dataType|encoding|compression|tags|attributes|
++---------------------------+-----+-------------+--------+--------+-----------+----+----------+
+|           root.sg.select.a| null|      root.sg|   FLOAT|   PLAIN|     SNAPPY|null|      null|
+|              root.sg.111.a| null|      root.sg|   FLOAT|   PLAIN|     SNAPPY|null|      null|
+|root.sg.`www.``baidu.com`.a| null|      root.sg|   FLOAT|   PLAIN|     SNAPPY|null|      null|
++---------------------------+-----+-------------+--------+--------+-----------+----+----------+
 ```
 
-## Quote Symbol
+- Insert statment:
 
-### Double quotes ("), single quotes (')
+```SQL
+# Node name contains special characters like . and `
+insert into root.sg.`www.``baidu.com`(timestamp, a) values(1, 2);
 
-Double quotes and single quotes are used in the following scenarios:
+# Node name is a key word.
+insert into root.sg.`select`(timestamp, a) values (1, 2);
 
-1. String literals are represented by strings enclosed in single or double quotes.
-2. If you want to use the path separator (`.`) in the path node name, you need to enclose the node name in single or double quotes. In this case, to avoid ambiguity, the quotes are treated as part of the node name by the system.
+# Node name consists of solely digits.
+insert into root.sg(timestamp, `111`) values (1, 2);
+```
 
-### Backticks (\`)
+- Query statement:
 
-Backticks are used in the following scenarios:
+```SQL
+# Node name contains special characters like . and `
+select a from root.sg.`www.``baidu.com`;
 
-1. When using special characters in an identifier, the identifier needs to be enclosed in backticks.
-2. When using special characters other than path separators in the path node name, the path node name needs to be enclosed in backticks. In this case, the backticks are not considered part of the node name by the system.
+# Node name is a key word.
+select a from root.sg.`select`
 
-### Backslash (\\)
+# Node name consists of solely digits.
+select `111` from root.sg
+```
 
-backslashes are used in the following scenarios:
+Results:
+
+```SQL
+# select a from root.sg.`www.``baidu.com`
++-----------------------------+---------------------------+
+|                         Time|root.sg.`www.``baidu.com`.a|
++-----------------------------+---------------------------+
+|1970-01-01T08:00:00.001+08:00|                        2.0|
++-----------------------------+---------------------------+
+
+# select a from root.sg.`select`
++-----------------------------+----------------+
+|                         Time|root.sg.select.a|
++-----------------------------+----------------+
+|1970-01-01T08:00:00.001+08:00|             2.0|
++-----------------------------+----------------+
+
+# select `111` from root.sg
++-----------------------------+-----------+
+|                         Time|root.sg.111|
++-----------------------------+-----------+
+|1970-01-01T08:00:00.001+08:00|        2.0|
++-----------------------------+-----------+
+```
 
-- In string literals, double or single quote should be escaped with a backslash.
-  - e.g. "str\\"ing" is parsed as str"ing, 'str\\'ing' is parsed as str'ing.
-- In an identifier, backtick should be escaped with a backslash.
-  - e.g. \`na\\\`me\` is parsed as na\`me.
-- In path node names, double or single quote should be escaped with a backslash. To avoid ambiguity, backslashes are recognized as part of the node name.
-  - e.g. root.sg1.d1."a\\"b" is parsed as Path[root, sg1, d1, "a\\"b"], root.sg1.d1.'a\\'b' is parsed as Path[ root, sg1, d1, 'a\\'b'], root.sg1.d1.\`a\\"b\` is parsed as Path[root, sg1, d1, a\\"b], root.sg1.d1.\`a\\'b\` is parsed as Path[root, sg1, d1, a\\'b].
-  
+## Keywords and Reserved Words
+
+Keywords are words that have significance in SQL require special treatment for use as identifiers and node names, and need to be escaped with backticks.
+Certain keywords, such as TIME and ROOT, are reserved and cannot use as identifiers and node names (even after escaping).
+
+[Keywords and Reserved Words](Keywords.md) shows the keywords and reserved words in IoTDB 0.13.
 
 ## Learn More
 
diff --git a/docs/zh/UserGuide/Data-Concept/Data-Model-and-Terminology.md b/docs/zh/UserGuide/Data-Concept/Data-Model-and-Terminology.md
index acaebf1c6d..cc2e36ebfc 100644
--- a/docs/zh/UserGuide/Data-Concept/Data-Model-and-Terminology.md
+++ b/docs/zh/UserGuide/Data-Concept/Data-Model-and-Terminology.md
@@ -63,38 +63,30 @@ IoTDB 模型结构涉及的基本概念在下文将做详细叙述。
 
 ```sql
 path       
-    : layer_name ('.' layer_name)*
+    : nodeName ('.' nodeName)*
     ;
-layer_name
-    : wildcard? id wildcard?
+    
+nodeName
+    : wildcard? identifier wildcard?
     | wildcard
     ;
+    
 wildcard 
     : '*' 
     | '**'
     ;
 ```
 
-其中,对 `id` 的定义可以参考[语法约定](../Reference/Syntax-Conventions.md)。
+我们称一个路径中由 `'.'` 分割的部分叫做路径结点名(`nodeName`)。例如:`root.a.b.c`为一个层级为 4 的路径。
 
-我们称一个路径中由 `'.'` 分割的部分叫做层级(`layer_name`)。例如:`root.a.b.c`为一个层级为 4 的路径。
-
-下面是对层级(`layer_name`)的约束:
+下面是对路径结点名(`nodeName`)的约束:
 
 * `root` 作为一个保留字符,它只允许出现在下文提到的时间序列的开头,若其他层级出现 `root`,则无法解析,提示报错。
-
 * 除了时间序列的开头的层级(`root`)外,其他的层级支持的字符如下:
-  * 中文字符`"\u2E80"`到`"\u9FFF"`
-  * `"_","@","#","$"`
-  * `"A"`到`"Z"`,`"a"`到`"z"`,`"0"`到`"9"`
-
-* 除了时间序列的开头的层级(`root`)和存储组层级外,层级还支持使用被  \`  或者 ` " ` 符号引用的特殊字符串作为其名称。需要注意的是,被引用的字符串不可带有 `.` 字符。下面是一些合法的例子:
-  * root.sg."select"."+-from="."where""where"""."\$",6 个层级分别为 root, sg, select, +-from, where"where", \$
-  * root.sg.\`\`\`\`.\`select\`.\`+="from"\`.\`\$\`,6 个层级分别为 root, sg, \`, select, +-"from", \$
-
-* 层级 (`layer_name`) 不允许以数字开头,除非层级 (`layer_name`) 以 \` 或 `"` 引用。
-
-* 特别地,如果系统在 Windows 系统上部署,那么存储组层级名称是大小写不敏感的。例如,同时创建`root.ln` 和 `root.LN` 是不被允许的。
+  * [ 0-9 a-z A-Z _ : @ # $ { } ] (字母,数字,部分特殊字符)
+  * ['\u2E80'..'\u9FFF'] (UNICODE 中文字符)
+* 特别地,如果系统在 Windows 系统上部署,那么存储组路径结点名是大小写不敏感的。例如,同时创建`root.ln` 和 `root.LN` 是不被允许的。
+* 如果需要在路径结点名中用特殊字符,可以用反引号引用路径结点名,具体使用方法可以参考[语法约定](../Reference/Syntax-Conventions.md)。
 
 ### 路径模式(Path Pattern)
 
diff --git a/docs/zh/UserGuide/Process-Data/Triggers.md b/docs/zh/UserGuide/Process-Data/Triggers.md
index c09d7fc33a..e89bc48291 100644
--- a/docs/zh/UserGuide/Process-Data/Triggers.md
+++ b/docs/zh/UserGuide/Process-Data/Triggers.md
@@ -189,11 +189,14 @@ WITH (
 
 目前触发器可以侦听序列上的所有的数据插入操作,触发器可以选择在数据插入前(`BEFORE INSERT`)或者数据插入后(`AFTER INSERT`)触发钩子调用。
 
-`FULL-PATH`是触发器侦听的目标序列名称,这个序列必须是一个测点。
+`FULL-PATH` 一个目标序列路径如root.sg1.d1.s1,或者是一个设备路径如root.sg1.d1,或者是一个存储组路径如root.sg1,抑或是一个业务语义节点路径如root.sg1.x。
 
 `CLASSNAME`是触发器类的全类名。
 
-请注意,`CLASSNAME`以及属性值中的`KEY`和`VALUE`都需要被单引号或者双引号引用起来。
+请注意:
+1. `CLASSNAME`以及属性值中的`KEY`和`VALUE`都需要被单引号或者双引号引用起来。
+2. 每个`FULL-PATH`只支持注册一个触发器。
+3. 当存在多层路径同时注册触发器时,如root.sg1.d1.s1 注册一个触发器trigger-sg1d1s1,root.sg1.d1注册一个触发器trigger-sg1d1,root.sg1注册一个触发器trigger-sg1,在向root.sg1.d1.s1写入数据时,其触发顺序为trigger-sg1d1s1 -》trigger-sg1d1-》trigger-sg1。
 
 ### 卸载触发器
 
diff --git a/docs/zh/UserGuide/Query-Data/Select-Expression.md b/docs/zh/UserGuide/Query-Data/Select-Expression.md
index 316fe113bd..d96589c761 100644
--- a/docs/zh/UserGuide/Query-Data/Select-Expression.md
+++ b/docs/zh/UserGuide/Query-Data/Select-Expression.md
@@ -675,6 +675,82 @@ Total line number = 12
 It costs 0.065s
 ```
 
+#### 等数量分桶离群值采样
+本函数对输入序列进行等数量分桶离群值采样,即根据用户给定的降采样比例和桶内采样个数将输入序列按固定点数等分为若干桶,在每个桶内通过给定的离群值采样方法进行采样。
+
+| 函数名      | 可接收的输入序列类型                     | 必要的属性参数                               | 输出序列类型     | 功能类型                                             |
+|----------|--------------------------------|---------------------------------------|------------|--------------------------------------------------|
+| EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE   | INT32 / INT64 / FLOAT / DOUBLE | `proportion`取值范围为`(0, 1]`,默认为`0.1`</br>`type`取值为`avg`或`stendis`或`cos`或`prenextdis`,默认为`avg`</br>`number`取值应大于0,默认`3`| INT32 / INT64 / FLOAT / DOUBLE | 返回符合采样比例和桶内采样个数的等分桶离群值采样                |
+
+参数说明
+- `proportion`: 采样比例
+  - `number`: 每个桶内的采样个数,默认`3`
+- `type`: 离群值采样方法,取值为
+    - `avg`: 取桶内数据点的平均值,并根据采样比例,找到距离均值最远的`top number`个
+    - `stendis`: 取桶内每一个数据点距离桶的首末数据点连成直线的垂直距离,并根据采样比例,找到距离最大的`top number`个
+    - `cos`: 设桶内一个数据点为b,b左边的数据点为a,b右边的数据点为c,则取ab与bc向量的夹角的余弦值,值越小,说明形成的角度越大,越可能是异常值。找到cos值最小的`top number`个
+    - `prenextdis`: 设桶内一个数据点为b,b左边的数据点为a,b右边的数据点为c,则取ab与bc的长度之和作为衡量标准,和越大越可能是异常值,找到最大的`top number`个
+
+##### 演示
+测试数据:`root.ln.wf01.wt01.temperature`从`0.0-99.0`共`100`条数据,其中为了加入离群值,我们使得个位数为5的值自增100。
+```
+IoTDB> select temperature from root.ln.wf01.wt01;
++-----------------------------+-----------------------------+
+|                         Time|root.ln.wf01.wt01.temperature|
++-----------------------------+-----------------------------+
+|1970-01-01T08:00:00.000+08:00|                          0.0|
+|1970-01-01T08:00:00.001+08:00|                          1.0|
+|1970-01-01T08:00:00.002+08:00|                          2.0|
+|1970-01-01T08:00:00.003+08:00|                          3.0|
+|1970-01-01T08:00:00.004+08:00|                          4.0|
+|1970-01-01T08:00:00.005+08:00|                        105.0|
+|1970-01-01T08:00:00.006+08:00|                          6.0|
+|1970-01-01T08:00:00.007+08:00|                          7.0|
+|1970-01-01T08:00:00.008+08:00|                          8.0|
+|1970-01-01T08:00:00.009+08:00|                          9.0|
+|1970-01-01T08:00:00.010+08:00|                         10.0|
+|1970-01-01T08:00:00.011+08:00|                         11.0|
+|1970-01-01T08:00:00.012+08:00|                         12.0|
+|1970-01-01T08:00:00.013+08:00|                         13.0|
+|1970-01-01T08:00:00.014+08:00|                         14.0|
+|1970-01-01T08:00:00.015+08:00|                        115.0|
+|1970-01-01T08:00:00.016+08:00|                         16.0|
+|.............................|.............................|
+|1970-01-01T08:00:00.092+08:00|                         92.0|
+|1970-01-01T08:00:00.093+08:00|                         93.0|
+|1970-01-01T08:00:00.094+08:00|                         94.0|
+|1970-01-01T08:00:00.095+08:00|                        195.0|
+|1970-01-01T08:00:00.096+08:00|                         96.0|
+|1970-01-01T08:00:00.097+08:00|                         97.0|
+|1970-01-01T08:00:00.098+08:00|                         98.0|
+|1970-01-01T08:00:00.099+08:00|                         99.0|
++-----------------------------+-----------------------------+
+```
+sql:
+```sql
+select equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='avg', 'number'='2') as outlier_avg_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='stendis', 'number'='2') as outlier_stendis_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='cos', 'number'='2') as outlier_cos_sample, equal_size_bucket_outlier_sample(temperature, 'proportion'='0.1', 'type'='prenextdis', 'number'='2') as outlier_prenextdis_sam [...]
+```
+结果:
+```
++-----------------------------+------------------+----------------------+------------------+-------------------------+
+|                         Time|outlier_avg_sample|outlier_stendis_sample|outlier_cos_sample|outlier_prenextdis_sample|
++-----------------------------+------------------+----------------------+------------------+-------------------------+
+|1970-01-01T08:00:00.005+08:00|             105.0|                 105.0|             105.0|                    105.0|
+|1970-01-01T08:00:00.015+08:00|             115.0|                 115.0|             115.0|                    115.0|
+|1970-01-01T08:00:00.025+08:00|             125.0|                 125.0|             125.0|                    125.0|
+|1970-01-01T08:00:00.035+08:00|             135.0|                 135.0|             135.0|                    135.0|
+|1970-01-01T08:00:00.045+08:00|             145.0|                 145.0|             145.0|                    145.0|
+|1970-01-01T08:00:00.055+08:00|             155.0|                 155.0|             155.0|                    155.0|
+|1970-01-01T08:00:00.065+08:00|             165.0|                 165.0|             165.0|                    165.0|
+|1970-01-01T08:00:00.075+08:00|             175.0|                 175.0|             175.0|                    175.0|
+|1970-01-01T08:00:00.085+08:00|             185.0|                 185.0|             185.0|                    185.0|
+|1970-01-01T08:00:00.095+08:00|             195.0|                 195.0|             195.0|                    195.0|
++-----------------------------+------------------+----------------------+------------------+-------------------------+
+Total line number = 10
+It costs 0.041s
+```
+
+
 ### 自定义时间序列生成函数
 
 请参考 [UDF](../Process-Data/UDF-User-Defined-Function.md)。
diff --git a/docs/zh/UserGuide/Query-Data/Without-Null.md b/docs/zh/UserGuide/Query-Data/Without-Null.md
index 36dc29ab45..3d139161c6 100644
--- a/docs/zh/UserGuide/Query-Data/Without-Null.md
+++ b/docs/zh/UserGuide/Query-Data/Without-Null.md
@@ -94,13 +94,13 @@ select * from root.ln.sg1 WITHOUT NULL ALL(s1, s2)
 
 ```sql
 select s2, - s2, s4, + s4, s2 + s4, s2 - s4, s2 * s4, s2 / s4, s2 % s4 from root.test.sg1 without null all (s2+s4, s2)
-``` 
+```
 
 2. 计算s2+s4和s2这两列是否至少有一列为null,如果是则过滤
 
 ```sql
 select s2, - s2, s4, + s4, s2 + s4, s2 - s4, s2 * s4, s2 / s4, s2 % s4 from root.test.sg1 without null any (s2+s4, s2)
-``` 
+```
 
 ### 别名
 
@@ -172,13 +172,13 @@ select avg(s4), sum(s2), count(s3) from root.test.sg1 group by ([1,10), 2ms) wit
 1. 指定`root.test.sg1.s2`, `root.test.sg2.s3`两列都为null则过滤
 
 ```sql
-select s2, s3 from root.test.** without null all(`root.test.sg1.s2`, `root.test.sg2.s3`)
+select s2, s3 from root.test.** without null all(root.test.sg1.s2, root.test.sg2.s3)
 ```
 
 2. 指定`root.test.sg1.s2`, `root.test.sg1.s3`, `root.test.sg2.s3`三列都为null则过滤
 
 ```sql
-select s2, s3 from root.test.** without null all(`root.test.sg1.s2`, s3)
+select s2, s3 from root.test.** without null all(root.test.sg1.s2, s3)
 ```
 
 ### 对齐序列查询
diff --git a/docs/zh/UserGuide/Reference/Syntax-Conventions.md b/docs/zh/UserGuide/Reference/Syntax-Conventions.md
index 8ca5c96f4a..a02c1fcd3f 100644
--- a/docs/zh/UserGuide/Reference/Syntax-Conventions.md
+++ b/docs/zh/UserGuide/Reference/Syntax-Conventions.md
@@ -28,37 +28,174 @@
 ### 字符串常量
 
 字符串是由单引号(`'`)或双引号(`"`)字符括起来的字符序列。示例如下:
-```js
+
+```Plain%20Text
 'a string'
 "another string"
 ```
 
-字符串字面值的使用场景:
-
-- `INSERT` 或者 `SELECT` 中用于表达 `TEXT` 类型数据的场景
-- SQL 中 UDF 和 Trigger 的 Java 类全类名
-- `CREATE TRIGGER` 语句中描述触发器属性的键值对
-- UDF 函数输入参数中的属性
-- `LOAD` / `REMOVE` / `SETTLE` 指令中的文件路径
-- 用户密码
-
-通过以下几种方式可以在字符串内使用引号:
-
-- 在引号前使用转义符 (\\)。
-- 在单引号括的的字符串内,双引号无需特殊处理。同理,在双引号括的的字符串内,单引号无需特殊处理。
-
-关于引号和转义字符的使用示例如下:
-```js
+除文件路径以外,我们会对字符串常量做反转义处理,具体使用可以参考使用场景中的示例。
+
+转义字符可以参考链接:[Characters (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)](https://docs.oracle.com/javase/tutorial/java/data/characters.html)
+
+#### 使用场景
+
+- `INSERT` 或者 `SELECT` 中用于表达 `TEXT` 类型数据的场景。
+
+  ```SQL
+  # insert 示例
+  insert into root.ln.wf02.wt02(timestamp,hardware) values(1, 'v1')
+  insert into root.ln.wf02.wt02(timestamp,hardware) values(2, '\\')
+  
+  # 查询 root.ln.wf02.wt02的数据,结果如下,可以看到\\被转义为了\
+  +-----------------------------+--------------------------+
+  |                         Time|root.ln.wf02.wt02.hardware|
+  +-----------------------------+--------------------------+
+  |1970-01-01T08:00:00.001+08:00|                        v1|
+  +-----------------------------+--------------------------+
+  |1970-01-01T08:00:00.002+08:00|                         \|
+  +-----------------------------+--------------------------+
+  
+  # select 示例
+  select code from root.sg1.d1 where code in ('string1', 'string2');
+  ```
+
+- `LOAD` / `REMOVE` / `SETTLE` 指令中的文件路径。由于windows系统使用反斜杠\作为路径分隔符,文件路径我们不会做反转义处理。
+
+  ```SQL
+  # load 示例
+  LOAD 'examplePath'
+  
+  # remove 示例
+  REMOVE 'examplePath'
+  
+  # SETTLE 示例
+  SETTLE 'examplePath'
+  ```
+
+- 用户密码。
+
+  ```SQL
+  # 示例,'write_pwd'即为用户密码
+  CREATE USER ln_write_user 'write_pwd'
+  ```
+
+- 触发器和 UDF 中的类全类名,示例如下:
+
+  ```SQL
+  # 触发器示例,AS 后使用字符串表示类全类名
+  CREATE TRIGGER `alert-listener-sg1d1s1`
+  AFTER INSERT
+  ON root.sg1.d1.s1
+  AS 'org.apache.iotdb.db.engine.trigger.example.AlertListener'
+  WITH (
+    'lo' = '0', 
+    'hi' = '100.0'
+  )
+  
+  # UDF 示例,AS 后使用字符串表示类全类名
+  CREATE FUNCTION example AS 'org.apache.iotdb.udf.UDTFExample'
+  ```
+
+- Select 子句中可以为结果集中的值指定别名,别名可以被定义为字符串或者标识符,示例如下:
+
+  ```SQL
+  select s1 as 'temperature', s2 as 'speed' from root.ln.wf01.wt01;
+  
+  # 表头如下所示
+  +-----------------------------+-----------|-----+
+  |                         Time|temperature|speed|
+  +-----------------------------+-----------|-----+
+  ```
+
+- 用于表示键值对,键值对的键可以被定义成字符串或者标识符,键值对的值可以被定义成常量(包括字符串)或者标识符,更推荐将键值对表示为字符串。示例如下:
+
+  1. 触发器中表示触发器属性的键值对。参考示例语句中 WITH 后的属性键值对。
+
+  ```SQL
+  # 示例
+  CREATE TRIGGER `alert-listener-sg1d1s1`
+  AFTER INSERT
+  ON root.sg1.d1.s1
+  AS 'org.apache.iotdb.db.engine.trigger.example.AlertListener'
+  WITH (
+    'lo' = '0', 
+    'hi' = '100.0'
+  )
+  ```
+
+  2. UDF 中函数输入参数中的属性键值对。参考示例语句中 SELECT 子句中的属性键值对。
+
+  ```SQL
+  # 示例
+  SELECT example(s1, s2, 'key1'='value1', 'key2'='value2') FROM root.sg.d1;
+  ```
+
+  3. 时间序列中用于表示标签和属性的键值对。
+
+  ```SQL
+  # 创建时间序列时设定标签和属性
+  CREATE timeseries root.turbine.d1.s1(temprature) 
+  WITH datatype=FLOAT, encoding=RLE, compression=SNAPPY, 'max_point_number' = '5'
+  TAGS('tag1' = 'v1', 'tag2'= 'v2') ATTRIBUTES('attr1' = 'v1', 'attr2' = 'v2')
+  
+  # 修改时间序列的标签和属性
+  ALTER timeseries root.turbine.d1.s1 SET 'newTag1' = 'newV1', 'attr1' = 'newV1'
+  
+  # 修改标签名
+  ALTER timeseries root.turbine.d1.s1 RENAME 'tag1' TO 'newTag1'
+  
+  # 插入别名、标签、属性
+  ALTER timeseries root.turbine.d1.s1 UPSERT 
+  ALIAS='newAlias' TAGS('tag2' = 'newV2', tag3=v3) ATTRIBUTES('attr3' ='v3', 'attr4'='v4')
+  
+  # 添加新的标签
+  ALTER timeseries root.turbine.d1.s1 ADD TAGS 'tag3' = 'v3', 'tag4' = 'v4'
+  
+  # 添加新的属性
+  ALTER timeseries root.turbine.d1.s1 ADD ATTRIBUTES 'attr3' = 'v3', 'attr4' = 'v4'
+  
+  # 查询符合条件的时间序列信息
+  SHOW timeseries root.ln.** WHRER 'unit' = 'c'
+  ```
+
+  4. 创建 Pipe 以及 PipeSink 时表示属性的键值对。
+
+  ```SQL
+  # 创建 PipeSink 时表示属性
+  CREATE PIPESINK my_iotdb AS IoTDB ('ip' = '输入你的IP')
+  
+  # 创建 Pipe 时在 WITH 子句中表示属性
+  CREATE PIPE my_pipe TO my_iotdb FROM 
+  (select ** from root WHERE time>=yyyy-mm-dd HH:MM:SS) WITH 'SyncDelOp' = 'true'
+  ```
+
+#### 如何在字符串内使用引号
+
+- 在单引号引起的字符串内,双引号无需特殊处理。同理,在双引号引起的字符串内,单引号无需特殊处理。
+
+- 在引号前使用转义符 (\)。
+
+- 在单引号引起的字符串里,可以通过双写单引号来表示一个单引号,即单引号 ' 可以表示为 ''。
+
+- 在双引号引起的字符串里,可以通过双写双引号来表示一个双引号,即双引号 " 可以表示为 ""。
+
+字符串内使用引号的示例如下:
+
+```Plain%20Text
 'string'  // string
 '"string"'  // "string"
 '""string""'  // ""string""
 'str\'ing'  // str'ing
 '\'string'  // 'string
+'''string'  // 'string
+
 "string" // string
 "'string'"  // 'string'
 "''string''"  // ''string''
 "str\"ing"  // str"ing
 "\"string"  // "string
+"""string"  // "string
 ```
 
 ### 数值型常量
@@ -75,7 +212,7 @@
 
 ### 时间戳常量
 
-时间戳是一个数据到来的时间点,在 IoTDB 中分为绝对时间戳和相对时间戳。详细信息可参考 [数据类型文档](../Data-Concept/Data-Type.md)。
+时间戳是一个数据到来的时间点,在 IoTDB 中分为绝对时间戳和相对时间戳。详细信息可参考 [数据类型文档](https://iotdb.apache.org/zh/UserGuide/Master/Data-Concept/Data-Type.html)。
 
 特别地,`NOW()`表示语句开始执行时的服务端系统时间戳。
 
@@ -89,126 +226,277 @@
 
 ## 标识符
 
-在 IoTDB 中,触发器名称、UDF函数名、元数据模板名称、用户与角色名等被称为标识符。
+### 使用场景
+
+在 IoTDB 中,触发器名称、UDF函数名、元数据模板名称、用户与角色名、连续查询标识、Pipe、PipeSink、键值对中的键和值、别名等被称为标识符。
+
+### 约束
+
+请注意,此处约束是标识符的通用约束,具体标识符可能还附带其它约束条件,如用户名限制字符数大于等于4,更严格的约束请参考具体标识符相关的说明文档。
 
 标识符命名有以下约束:
 
-- 在不含引用的标识符中,允许出现以下字符:
-  - [0-9 a-z A-Z _ : @ # $ { }] (字母,数字,部分特殊字符)
+- 不使用反引号括起的标识符中,允许出现以下字符:
+
+  - [ 0-9 a-z A-Z _ : @ # $ { } ] (字母,数字,部分特殊字符)
+
   - ['\u2E80'..'\u9FFF'] (UNICODE 中文字符)
-- 标识符允许使用数字开头、允许全部为数字(**不推荐!**)。
+
+- 标识符允许使用数字开头、不使用反引号括起的标识符不能全部为数字。
+
 - 标识符是大小写敏感的。
-- 注意:用户与角色名对大小写不敏感,并且不允许转义特殊字符。
-
-如果标识符要包含不允许的特殊字符,或者使用系统关键字,需要用反引号(`)对标识符进行引用。反引号引用的标识符中出现反引号需要反斜杠转义。
-
-示例如下:
-```sql
-id  // 合法,被解析为 id
-ID  // 合法,被解析为 ID,与 id 不同
-id0  // 合法,被解析为 id0
-_id  // 合法,被解析为 _id
-0id  // 合法,被解析为 0id
-233  // 合法,被解析为 233 (不推荐!)
-ab!  // 不合法,包含不被允许的特殊字符
-`ab!`  // 合法,被解析为 ab!
-`"ab"`  // 合法,被解析为 "ab"
-`a`b`  // 不合法,反引号应使用反斜杠进行转义
-`a\`b`  // 合法,被解析为 a`b
-```
 
-## 路径节点名
+如果出现如下情况,标识符需要使用反引号进行引用:
 
-我们称一个路径中由 `.` 分割的部分叫做节点(node name)。
+- 标识符包含不允许的特殊字符。
+- 标识符为系统关键字。
+- 标识符为纯数字。
 
-路径节点名的约束与标识符基本一致,但要额外注意以下几点:
+### 如何在反引号引起的标识符中使用引号
 
-- `root` 只允许出现时间序列的开头,若其他层级出现 `root`,则无法解析,提示报错。
-- 无论是否使用反引号引用,路径分隔符(`.`)都不能出现在路径节点名中。 如果路径节点名中一定要出现 `.` (不推荐!),需要用单引号或双引号括起。在这种情况下,为避免引发歧义,引号被系统视为节点名的一部分。
-- 在反引号括起的路径节点名中,单引号和双引号需要使用反斜杠进行转义。
-- 特别地,如果系统在 Windows 系统上部署,那么存储组层级名称是**大小写不敏感**的。例如,同时创建 `root.ln` 和 `root.LN` 是不被允许的。
+在反引号引起的标识符中可以直接使用单引号和双引号。
 
-示例如下:
+在用反引号引用的标识符中,可以通过双写反引号的方式使用反引号,即 ` 可以表示为 ``,示例如下:
 
-```sql
-CREATE TIMESERIES root.a.b.s1+s2/s3.c WITH DATATYPE=INT32, ENCODING=RLE
-// 解析失败!
+```SQL
+# 创建模板 t1't"t
+create schema template `t1't"t` 
+(temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)
 
-CREATE TIMESERIES root.a.b.`s1+s2/s3`.c WITH DATATYPE=INT32, ENCODING=RLE
-// root.a.b.`s1+s2/s3`.c 将被解析为 Path[root, a, b, s1+s2/s3, c]
+# 创建模板 t1`t
+create schema template `t1``t` 
+(temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)
 ```
 
-```sql
-CREATE TIMESERIES root.a.b.select WITH DATATYPE=INT32, ENCODING=RLE
-// 解析失败!
-
-CREATE TIMESERIES root.a.b.`select` WITH DATATYPE=INT32, ENCODING=RLE
-// root.a.b.`select` 将被解析为 Path[root, a, b, select]
+### 特殊情况示例
+
+需要使用反引号进行引用的部分情况示例:
+
+- 触发器名称出现上述特殊情况时需使用反引号引用:
+
+  ```sql
+  # 创建触发器 alert.`listener-sg1d1s1
+  CREATE TRIGGER `alert.``listener-sg1d1s1`
+  AFTER INSERT
+  ON root.sg1.d1.s1
+  AS 'org.apache.iotdb.db.engine.trigger.example.AlertListener'
+  WITH (
+    'lo' = '0', 
+    'hi' = '100.0'
+  )
+  ```
+
+- UDF 名称出现上述特殊情况时需使用反引号引用:
+
+  ```sql
+  # 创建名为 select 的 UDF,select 为系统关键字,所以需要用反引号引用
+  CREATE FUNCTION `select` AS 'org.apache.iotdb.udf.UDTFExample'
+  ```
+
+- 元数据模板名称出现上述特殊情况时需使用反引号引用:
+
+  ```sql
+  # 创建名为 111 的元数据模板,111 为纯数字,需要用反引号引用
+  create schema template `111` 
+  (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)
+  ```
+
+- 用户名、角色名出现上述特殊情况时需使用反引号引用,同时无论是否使用反引号引用,用户名、角色名中均不允许出现空格,具体请参考权限管理章节中的说明。
+
+  ```sql
+  # 创建用户 special`user.
+  CREATE USER `special``user.` 'write_pwd'
+  
+  # 创建角色 `select`
+  CREATE ROLE `select`
+  ```
+
+- 连续查询标识出现上述特殊情况时需使用反引号引用:
+
+  ```sql
+  # 创建连续查询 test.cq
+  CREATE CONTINUOUS QUERY `test.cq` 
+  BEGIN 
+    SELECT max_value(temperature) 
+    INTO temperature_max 
+    FROM root.ln.*.* 
+    GROUP BY time(10s) 
+  END
+  ```
+
+- Pipe、PipeSink 名称出现上述特殊情况时需使用反引号引用:
+
+  ```sql
+  # 创建 PipeSink test.*1
+  CREATE PIPESINK `test.*1` AS IoTDB ('ip' = '输入你的IP')
+  
+  # 创建 Pipe test.*2
+  CREATE PIPE `test.*2` TO `test.*1` FROM 
+  (select ** from root WHERE time>=yyyy-mm-dd HH:MM:SS) WITH 'SyncDelOp' = 'true'
+  ```
+
+- Select 子句中可以结果集中的值指定别名,别名可以被定义为字符串或者标识符,示例如下:
+
+  ```sql
+  select s1 as temperature, s2 as speed from root.ln.wf01.wt01;
+  # 表头如下所示
+  +-----------------------------+-----------|-----+
+  |                         Time|temperature|speed|
+  +-----------------------------+-----------|-----+
+  ```
+
+- 用于表示键值对,键值对的键可以被定义成字符串或者标识符,键值对的值可以被定义成常量(包括字符串)或者标识符,更推荐将键值对表示为字符串。键值对的使用范围和字符串常量中提到的一致,下面以时间序列中用于表示标签和属性的键值对作为示例:
+
+  ```SQL
+  # 创建时间序列时设定标签和属性
+  CREATE timeseries root.turbine.d1.s1(temprature) 
+  WITH datatype=FLOAT, encoding=RLE, compression=SNAPPY, max_point_number = 5
+  TAGS(tag1 = v1, tag2= v2) ATTRIBUTES(attr1 = v1, attr2 = v2)
+  
+  # 修改时间序列的标签和属性
+  ALTER timeseries root.turbine.d1.s1 SET newTag1 = newV1, attr1 = newV1
+  
+  # 修改标签名
+  ALTER timeseries root.turbine.d1.s1 RENAME tag1 TO newTag1
+  
+  # 插入别名、标签、属性
+  ALTER timeseries root.turbine.d1.s1 UPSERT 
+  ALIAS = newAlias TAGS(tag2 = newV2, tag3 = v3) ATTRIBUTES(attr3 = v3, attr4 = v4)
+  
+  # 添加新的标签
+  ALTER timeseries root.turbine.d1.s1 ADD TAGS tag3 = v3, tag4 = v4
+  
+  # 添加新的属性
+  ALTER timeseries root.turbine.d1.s1 ADD ATTRIBUTES attr3 = v3, attr4 = v4
+  
+  # 查询符合条件的时间序列信息
+  SHOW timeseries root.ln.** WHRER unit = c
+  ```
+
+## 路径结点名
+
+路径结点名是特殊的标识符,其还可以是通配符 \* 或 \*\*。在创建时间序列时,各层级的路径结点名不能为通配符 \* 或 \*\*。在查询语句中,可以用通配符 \* 或 \*\* 来表示路径结点名,以匹配一层或多层路径。
+
+### 通配符
+
+`*`在路径中表示一层。例如`root.vehicle.*.sensor1`代表的是以`root.vehicle`为前缀,以`sensor1`为后缀,层次等于 4 层的路径。
+
+`**`在路径中表示是(`*`)+,即为一层或多层`*`。例如`root.vehicle.device1.**`代表的是`root.vehicle.device1.*`, `root.vehicle.device1.*.*`, `root.vehicle.device1.*.*.*`等所有以`root.vehicle.device1`为前缀路径的大于等于 4 层的路径;`root.vehicle.**.sensor1`代表的是以`root.vehicle`为前缀,以`sensor1`为后缀,层次大于等于 4 层的路径。
+
+由于通配符 * 在查询表达式中也可以表示乘法符号,下述例子用于帮助您区分两种情况:
+
+```SQL
+# 创建时间序列 root.sg.a*b
+create timeseries root.sg.`a*b` with datatype=FLOAT,encoding=PLAIN;
+# 请注意,如标识符部分所述,a*b包含特殊字符,需要用``括起来使用
+# create timeseries root.sg.a*b with datatype=FLOAT,encoding=PLAIN 是错误用法
+
+# 创建时间序列 root.sg.a
+create timeseries root.sg.a with datatype=FLOAT,encoding=PLAIN;
+
+# 创建时间序列 root.sg.b
+create timeseries root.sg.b with datatype=FLOAT,encoding=PLAIN;
+
+# 查询时间序列 root.sg.a*b
+select `a*b` from root.sg
+# 其结果集表头为
+|Time|root.sg.a*b|
+
+# 查询时间序列 root.sg.a 和 root.sg.b的乘积
+select a*b from root.sg
+# 其结果集表头为
+|Time|root.sg.a * root.sg.b|
 ```
 
-```sql
-CREATE TIMESERIES root.a.b.`s1.s2`.c WITH DATATYPE=INT32, ENCODING=RLE
-// 解析失败!
+### 标识符
 
-CREATE TIMESERIES root.a.b."s1.s2".c WITH DATATYPE=INT32, ENCODING=RLE
-// root.a.b."s1.s2".c 将被解析为 Path[root, a, b, "s1.s2", c]
-```
+路径结点名不为通配符时,使用方法和标识符一致。
 
-```sql
-CREATE TIMESERIES root.a.b.`s1"s2`.c WITH DATATYPE=INT32, ENCODING=RLE
-// 解析失败!
+使用反引号引起的路径结点名,若其中含有特殊字符 . `,在结果集中展示时会添加反引号,其它情况下会正常展示,具体请参考特殊情况示例中结果集的示例。
 
-CREATE TIMESERIES root.a.b.`s1\"s2`.c WITH DATATYPE=INT32, ENCODING=RLE
-// root.a.b.`s1\"s2`.c 将被解析为 Path[root, a, b, s1\"s2, c]
-```
+需要使用反引号进行引用的部分特殊情况示例:
 
-## 关键字和保留字
+- 创建时间序列时,如下情况需要使用反引号对特殊节点名进行引用:
 
-关键字是在 SQL 具有特定含义的词,不能直接用于标识符或路径节点名,需要使用反引号进行转义。保留字是关键字的一个子集,保留字不能用于标识符或路径节点名(即使进行了转义)。
+```SQL
+# 路径结点名中包含特殊字符,时间序列各结点为["root","sg","www.`baidu.com"]
+create timeseries root.sg.`www.``baidu.com`.a with datatype=FLOAT,encoding=PLAIN;
 
-关于 IoTDB 的关键字和保留字列表,可以查看 [关键字和保留字](Keywords.md) 。
+# 路径结点名为系统关键字
+create timeseries root.sg.`select`.a with datatype=FLOAT,encoding=PLAIN;
 
-## 表达式
+# 路径结点名为纯数字
+create timeseries root.sg.`111` with datatype=FLOAT,encoding=PLAIN;
+```
 
-IoTDB 支持在 `select` 子句中执行由数字常量、时间序列、算数运算表达式和时间序列生成函数(包括用户自定义函数)组成的任意嵌套表达式。
+依次执行示例中语句后,执行 show timeseries,结果如下:
 
-注意:当参与表达式的路径节点名由纯数字、单引号、或双引号组成(不推荐!)时,必须使用反引号(`)括起,以免引起歧义。示例如下:
-```sql
--- 存在时间序列: root.sg.d.0, root.sg.d.'a' 和 root.sg."d".b
-select 0 from root.sg.d  -- 存在歧义,解析失败
-select 'a' from root.sg.d -- 存在歧义,解析失败
-select "d".b from root.sg -- 存在歧义,解析失败
-select `0` from root.sg.d  -- 对时间序列 root.sg.d.0 进行查询
-select `0` + 0 from root.sg.d -- 表达式,对时间序列 root.sg.d.0 的每一个查询结果加 0
-select myudf(`'a'`, 'x') from root.sg.d -- 表达式,调用函数 myudf,第一个参数为时间序列 root.sg.d.'a',第二个参数为字符串常量 'x'
+```SQL
++---------------------------+-----+-------------+--------+--------+-----------+----+----------+
+|                 timeseries|alias|storage group|dataType|encoding|compression|tags|attributes|
++---------------------------+-----+-------------+--------+--------+-----------+----+----------+
+|           root.sg.select.a| null|      root.sg|   FLOAT|   PLAIN|     SNAPPY|null|      null|
+|              root.sg.111.a| null|      root.sg|   FLOAT|   PLAIN|     SNAPPY|null|      null|
+|root.sg.`www.``baidu.com`.a| null|      root.sg|   FLOAT|   PLAIN|     SNAPPY|null|      null|
++---------------------------+-----+-------------+--------+--------+-----------+----+----------+
 ```
 
-## 引用符号
+- 插入数据时,如下情况需要使用反引号对特殊节点名进行引用:
 
-### 双引号(")、单引号(')
+```SQL
+# 路径结点名中包含特殊字符 . 和 `
+insert into root.sg.`www.``baidu.com`(timestamp, a) values(1, 2);
 
-双引号、单引号的使用场景如下:
+# 路径结点名为系统关键字
+insert into root.sg.`select`(timestamp, a) values (1, 2);
 
-1. 字符串字面值由单引号或双引号括起的字符串表示。
-2. 如果要在路径节点名中使用路径分隔符(`.`),则需要将路径节点名用单引号或双引号括起。在这种情况下,为避免引发歧义,引号被系统视为节点名的一部分。
+# 路径结点名为纯数字
+insert into root.sg(timestamp, `111`) values (1, 2);
+```
+
+- 查询数据时,如下情况需要使用反引号对特殊节点名进行引用:
+
+```SQL
+# 路径结点名中包含特殊字符 . 和 `
+select a from root.sg.`www.``baidu.com`;
 
-### 反引号(\`)
+# 路径结点名为系统关键字
+select a from root.sg.`select`
 
-反引号的使用场景如下:
+# 路径结点名为纯数字
+select `111` from root.sg
+```
 
-1. 在标识符中使用特殊字符时,标识符需要使用反引号括起。
-2. 在路径节点名中使用除路径分隔符之外的特殊字符时,路径节点名需要使用反引号括起。在这种情况下,反引号不会被系统视为节点名的一部分。
+结果集分别为:
+
+```SQL
+# select a from root.sg.`www.``baidu.com` 结果集
++-----------------------------+---------------------------+
+|                         Time|root.sg.`www.``baidu.com`.a|
++-----------------------------+---------------------------+
+|1970-01-01T08:00:00.001+08:00|                        2.0|
++-----------------------------+---------------------------+
+
+# select a from root.sg.`select` 结果集
++-----------------------------+----------------+
+|                         Time|root.sg.select.a|
++-----------------------------+----------------+
+|1970-01-01T08:00:00.001+08:00|             2.0|
++-----------------------------+----------------+
+
+# select `111` from root.sg 结果集
++-----------------------------+-----------+
+|                         Time|root.sg.111|
++-----------------------------+-----------+
+|1970-01-01T08:00:00.001+08:00|        2.0|
++-----------------------------+-----------+
+```
 
-### 反斜杠(\)
+## 关键字和保留字
 
-反斜杠的使用场景如下:
-- 在字符串常量中,出现双引号或单引号时,要使用反斜杠进行转义。
-  - 如:"str\\"ing" 解析为 str"ing、'str\\'ing' 解析为 str'ing。
-- 在标识符中,出现反引号时,要使用反斜杠进行转义。
-  - 如:\`na\\\`me\` 解析为 na\`me。
-- 在路径节点名中,出现双引号或单引号时,要使用反斜杠进行转义。注意,为了避免歧义,反斜杠会被系统视为节点名的一部分。 
-  - 如:root.sg1.d1."a\\"b" 解析为 Path[root, sg1, d1, "a\\"b"]、root.sg1.d1.'a\\'b' 解析为 Path[root, sg1, d1, 'a\\'b']、root.sg1.d1.\`a\\"b\` 解析为 Path[root, sg1, d1, a\\"b]、root.sg1.d1.\`a\\'b\` 解析为 Path[root, sg1, d1, a\\'b]。
+关键字是在 SQL 具有特定含义的词,不能直接用于标识符,需要使用反引号进行转义。保留字是关键字的一个子集,保留字不能用于标识符(即使进行了转义)。
 
+关于 IoTDB 的关键字和保留字列表,可以查看 [关键字和保留字](https://iotdb.apache.org/zh/UserGuide/Master/Reference/Keywords.html) 。
 
 ## 了解更多
 
diff --git a/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java b/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java
index e880ba93eb..c8d03df1cf 100644
--- a/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java
+++ b/example/session/src/main/java/org/apache/iotdb/DataMigrationExample.java
@@ -117,7 +117,7 @@ public class DataMigrationExample {
 
     public LoadThread(int i, Path series, TSDataType dataType) {
       this.i = i;
-      this.device = series.getDevice();
+      this.device = series.getDeviceIdString();
       this.measurement = series.getMeasurement();
       this.dataType = dataType;
       this.series = series;
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBAliasIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBAliasIT.java
index 14d574960b..016de9d8f4 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBAliasIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBAliasIT.java
@@ -275,7 +275,7 @@ public class IoTDBAliasIT {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
 
-      statement.execute("ALTER timeseries root.sg.d2.s3 UPSERT ALIAS=powerNew");
+      statement.execute("ALTER timeseries root.sg.d2.s3 UPSERT ALIAS='powerNew'");
       boolean hasResult = statement.execute("show timeseries root.sg.d2.s3");
       assertTrue(hasResult);
       try (ResultSet resultSet = statement.getResultSet()) {
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBAsIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBAsIT.java
index 17cc237d7d..afe4de75fd 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBAsIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBAsIT.java
@@ -269,7 +269,7 @@ public class IoTDBAsIT {
         Statement statement = connection.createStatement()) {
       boolean hasResultSet =
           statement.execute(
-              "select count(s1) as s1_num from root.sg.d1 group by ([100,500), 80ms)");
+              "select count(s1) as 's1_num' from root.sg.d1 group by ([100,500), 80ms)");
       Assert.assertTrue(hasResultSet);
 
       try (ResultSet resultSet = statement.getResultSet()) {
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCreateTimeseriesIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCreateTimeseriesIT.java
index a504a1adee..aa759e8732 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCreateTimeseriesIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBCreateTimeseriesIT.java
@@ -209,24 +209,10 @@ public class IoTDBCreateTimeseriesIT {
     }
 
     String[] timeSeriesArray = {
-      "root.sg.d.\"a.b\"",
-      "root.sg.d.\"a“(Φ)”b\"",
-      "root.sg.d.\"a>b\"",
-      "root.sg.d.'a.b'",
-      "root.sg.d.'a“(Φ)”b'",
-      "root.sg.d.'a>b'",
-      "root.sg.d.`a“(Φ)”b`",
-      "root.sg.d.`a>b`"
+      "root.sg.d.`a.b`", "root.sg.d.`a“(Φ)”b`", "root.sg.d.`a>b`",
     };
     String[] timeSeriesResArray = {
-      "root.sg.d.\"a.b\"",
-      "root.sg.d.\"a“(Φ)”b\"",
-      "root.sg.d.\"a>b\"",
-      "root.sg.d.'a.b'",
-      "root.sg.d.'a“(Φ)”b'",
-      "root.sg.d.'a>b'",
-      "root.sg.d.a“(Φ)”b",
-      "root.sg.d.a>b"
+      "root.sg.d.`a.b`", "root.sg.d.a“(Φ)”b", "root.sg.d.a>b",
     };
 
     for (String timeSeries : timeSeriesArray) {
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
index 92089fd8a8..a05c920524 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
@@ -428,11 +428,11 @@ public class IoTDBDeletionIT {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "CREATE TIMESERIES root.ln.d1.\"status,01\" WITH DATATYPE=BOOLEAN, ENCODING=PLAIN");
-      statement.execute("INSERT INTO root.ln.d1(timestamp,\"status,01\") VALUES(300, true)");
-      statement.execute("INSERT INTO root.ln.d1(timestamp,\"status,01\") VALUES(500, false)");
+          "CREATE TIMESERIES root.ln.d1.`status,01` WITH DATATYPE=BOOLEAN, ENCODING=PLAIN");
+      statement.execute("INSERT INTO root.ln.d1(timestamp,`status,01`) VALUES(300, true)");
+      statement.execute("INSERT INTO root.ln.d1(timestamp,`status,01`) VALUES(500, false)");
 
-      try (ResultSet resultSet = statement.executeQuery("select `\"status,01\"` from root.ln.d1")) {
+      try (ResultSet resultSet = statement.executeQuery("select `status,01` from root.ln.d1")) {
         int cnt = 0;
         while (resultSet.next()) {
           cnt++;
@@ -440,9 +440,9 @@ public class IoTDBDeletionIT {
         Assert.assertEquals(2, cnt);
       }
 
-      statement.execute("DELETE FROM root.ln.d1.\"status,01\" WHERE time <= 400");
+      statement.execute("DELETE FROM root.ln.d1.`status,01` WHERE time <= 400");
 
-      try (ResultSet resultSet = statement.executeQuery("select `\"status,01\"` from root.ln.d1")) {
+      try (ResultSet resultSet = statement.executeQuery("select `status,01` from root.ln.d1")) {
         int cnt = 0;
         while (resultSet.next()) {
           cnt++;
@@ -450,9 +450,9 @@ public class IoTDBDeletionIT {
         Assert.assertEquals(1, cnt);
       }
 
-      statement.execute("DELETE FROM root.ln.d1.\"status,01\"");
+      statement.execute("DELETE FROM root.ln.d1.`status,01`");
 
-      try (ResultSet resultSet = statement.executeQuery("select `\"status,01\"` from root.ln.d1")) {
+      try (ResultSet resultSet = statement.executeQuery("select `status,01` from root.ln.d1")) {
         int cnt = 0;
         while (resultSet.next()) {
           cnt++;
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBExecuteBatchIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBExecuteBatchIT.java
index 8570331299..e12508555f 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBExecuteBatchIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBExecuteBatchIT.java
@@ -88,9 +88,11 @@ public class IoTDBExecuteBatchIT {
           "insert into root.ln.wf01.wt01(timestamp,temperature) values(1509465600001,2.3)");
       statement.addBatch("delete timeseries root.ln.wf01.wt01.**");
       statement.addBatch(
-          "create timeseries root.turbine.d1.s1(s1) with datatype=boolean, encoding=plain , compression=snappy tags(tag1=v1, tag2=v2) attributes(attr1=v3, attr2=v4)");
+          "create timeseries root.turbine.d1.s1(s1) with datatype=boolean, encoding=plain , compression=snappy "
+              + "tags('tag1'='v1', 'tag2'='v2') attributes('attr1'='v3', 'attr2'='v4')");
       statement.addBatch(
-          "create timeseries root.turbine.d1.s2(s2) with datatype=float, encoding=rle, compression=uncompressed tags(tag1=v5, tag2=v6) attributes(attr1=v7, attr2=v8) ");
+          "create timeseries root.turbine.d1.s2(s2) with datatype=float, encoding=rle, compression=uncompressed "
+              + "tags('tag1'='v5', 'tag2'='v6') attributes('attr1'='v7', 'attr2'='v8') ");
       statement.addBatch(
           "insert into root.ln.wf01.wt01(timestamp,temperature) values(1509465600002,3.4)");
       statement.addBatch(
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBFloatPrecisionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBFloatPrecisionIT.java
index d5f7c6fedd..773be7152f 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBFloatPrecisionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBFloatPrecisionIT.java
@@ -50,7 +50,7 @@ import static org.junit.Assert.fail;
 public class IoTDBFloatPrecisionIT {
 
   private static final String CREATE_TEMPLATE_SQL =
-      "CREATE TIMESERIES root.vehicle.%s.%s WITH DATATYPE=%s, ENCODING=%s, MAX_POINT_NUMBER=%d";
+      "CREATE TIMESERIES root.vehicle.%s.%s WITH DATATYPE=%s, ENCODING=%s, 'MAX_POINT_NUMBER'='%d'";
   private static final String INSERT_TEMPLATE_SQL =
       "insert into root.vehicle.%s(timestamp,%s) values(%d,%s)";
   private static List<String> sqls = new ArrayList<>();
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBInsertNaNIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBInsertNaNIT.java
index 65ce45733b..0fda69296c 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBInsertNaNIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBInsertNaNIT.java
@@ -50,7 +50,7 @@ import static org.junit.Assert.fail;
 public class IoTDBInsertNaNIT {
 
   private static final String CREATE_TEMPLATE_SQL =
-      "CREATE TIMESERIES root.vehicle.%s.%s WITH DATATYPE=%s, ENCODING=%s, MAX_POINT_NUMBER=%d";
+      "CREATE TIMESERIES root.vehicle.%s.%s WITH DATATYPE=%s, ENCODING=%s, 'MAX_POINT_NUMBER'='%d'";
   private static final String INSERT_TEMPLATE_SQL =
       "insert into root.vehicle.%s(timestamp,%s) values(%d,%s)";
   private static final String INSERT_BRAND_NEW_TEMPLATE_SQL =
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
index f87265c7e6..e6b0e5aee8 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
@@ -67,14 +67,14 @@ public class IoTDBMetadataFetchIT {
             "SET STORAGE GROUP TO root.ln2.wf01.wt01",
             "CREATE TIMESERIES root.ln.wf01.wt01.status WITH DATATYPE = BOOLEAN, ENCODING = PLAIN",
             "CREATE TIMESERIES root.ln.wf01.wt01.temperature WITH DATATYPE = FLOAT, ENCODING = RLE, "
-                + "compressor = SNAPPY, MAX_POINT_NUMBER = 3",
+                + "compressor = SNAPPY, 'MAX_POINT_NUMBER' = '3' ",
             "CREATE ALIGNED TIMESERIES root.ln.wf01.wt02(s1 INT32, s2 DOUBLE)",
             "CREATE TIMESERIES root.ln1.wf01.wt01.status WITH DATATYPE = BOOLEAN, ENCODING = PLAIN",
             "CREATE TIMESERIES root.ln1.wf01.wt01.temperature WITH DATATYPE = FLOAT, ENCODING = RLE, "
-                + "compressor = SNAPPY, MAX_POINT_NUMBER = 3",
+                + "compressor = SNAPPY, 'MAX_POINT_NUMBER' = '3'",
             "CREATE TIMESERIES root.ln2.wf01.wt01.status WITH DATATYPE = BOOLEAN, ENCODING = PLAIN",
             "CREATE TIMESERIES root.ln2.wf01.wt01.temperature WITH DATATYPE = FLOAT, ENCODING = RLE, "
-                + "compressor = SNAPPY, MAX_POINT_NUMBER = 3"
+                + "compressor = SNAPPY, 'MAX_POINT_NUMBER' = '3'"
           };
 
       for (String sql : insertSqls) {
@@ -595,7 +595,7 @@ public class IoTDBMetadataFetchIT {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "create aligned timeseries root.sg.d(s1(alias1) int32 tags(tag1=v1, tag2=v2), s2 double attributes(attr3=v3))");
+          "create aligned timeseries root.sg.d(s1(alias1) int32 tags('tag1'='v1', 'tag2'='v2'), s2 double attributes('attr3'='v3'))");
       String[] expected =
           new String[] {
             "root.sg.d.s1,alias1,root.sg,INT32,RLE,SNAPPY,{\"tag1\":\"v1\",\"tag2\":\"v2\"},null,",
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
index 317f7dfd1e..c74ce71b6d 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBNestedQueryIT.java
@@ -584,4 +584,27 @@ public class IoTDBNestedQueryIT {
       Assert.fail(e.getMessage());
     }
   }
+
+  @Test
+  public void testRegularLikeInExpressions() {
+    try (Connection connection =
+            DriverManager.getConnection(
+                Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
+        Statement statement = connection.createStatement()) {
+      String query =
+          "SELECT ((CAST(s1, 'type'='TEXT') LIKE '_') REGEXP '[0-9]') IN ('4', '2', '3') "
+              + "FROM root.vehicle.d1";
+      try (ResultSet rs = statement.executeQuery(query)) {
+        for (int i = 2; i <= 4; i++) {
+          Assert.assertTrue(rs.next());
+          Assert.assertEquals(i, rs.getLong(1));
+          Assert.assertEquals(String.valueOf(i), rs.getString(2));
+        }
+        Assert.assertFalse(rs.next());
+      }
+    } catch (SQLException e) {
+      e.printStackTrace();
+      Assert.fail(e.getMessage());
+    }
+  }
 }
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQuotedPathIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQuotedPathIT.java
index 597786555b..8a1086dada 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQuotedPathIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBQuotedPathIT.java
@@ -62,21 +62,21 @@ public class IoTDBQuotedPathIT {
           };
       statement.execute("SET STORAGE GROUP TO root.ln");
       statement.execute(
-          "CREATE TIMESERIES root.ln.\"wf+01\".wt01.\"status+2+3\" WITH DATATYPE=BOOLEAN, ENCODING=PLAIN");
+          "CREATE TIMESERIES root.ln.`wf+01`.wt01.`status+2+3` WITH DATATYPE=BOOLEAN, ENCODING=PLAIN");
       statement.execute(
-          "INSERT INTO root.ln.\"wf+01\".wt01(timestamp,\"status+2+3\") values(1509465600000,true)");
+          "INSERT INTO root.ln.`wf+01`.wt01(timestamp,`status+2+3`) values(1509465600000,true)");
       statement.execute(
-          "INSERT INTO root.ln.\"wf+01\".wt01(timestamp,\"status+2+3\") values(1509465600001,true)");
+          "INSERT INTO root.ln.`wf+01`.wt01(timestamp,`status+2+3`) values(1509465600001,true)");
       statement.execute(
-          "INSERT INTO root.ln.\"wf+01\".wt01(timestamp,\"status+2+3\") values(1509465600002,false)");
+          "INSERT INTO root.ln.`wf+01`.wt01(timestamp,`status+2+3`) values(1509465600002,false)");
       statement.execute(
-          "INSERT INTO root.ln.\"wf+01\".wt01(timestamp,\"status+2+3\") values(1509465600003,false)");
+          "INSERT INTO root.ln.`wf+01`.wt01(timestamp,`status+2+3`) values(1509465600003,false)");
       statement.execute(
-          "CREATE TIMESERIES root.ln.\"wf+01\".wt02.\"abd\" WITH DATATYPE=BOOLEAN, ENCODING=PLAIN");
+          "CREATE TIMESERIES root.ln.`wf+01`.wt02.`abd` WITH DATATYPE=BOOLEAN, ENCODING=PLAIN");
       statement.execute(
-          "CREATE TIMESERIES root.ln.\"wf+01\".wt02.\"asd12\" WITH DATATYPE=BOOLEAN, ENCODING=PLAIN");
+          "CREATE TIMESERIES root.ln.`wf+01`.wt02.`asd12` WITH DATATYPE=BOOLEAN, ENCODING=PLAIN");
 
-      boolean hasResultSet = statement.execute("SELECT * FROM root.ln.\"wf+01\".wt01");
+      boolean hasResultSet = statement.execute("SELECT * FROM root.ln.`wf+01`.wt01");
       assertTrue(hasResultSet);
       ResultSet resultSet = statement.getResultSet();
       try {
@@ -87,7 +87,7 @@ public class IoTDBQuotedPathIT {
         }
 
         hasResultSet =
-            statement.execute("SELECT * FROM root.ln.\"wf+01\".wt01 WHERE \"status+2+3\" = false");
+            statement.execute("SELECT * FROM root.ln.`wf+01`.wt01 WHERE `status+2+3` = false");
         assertTrue(hasResultSet);
         exp = new String[] {"1509465600002,false", "1509465600003,false"};
         cnt = 0;
@@ -98,7 +98,7 @@ public class IoTDBQuotedPathIT {
         }
 
         statement.execute(
-            "DELETE FROM root.ln.\"wf+01\".wt01.\"status+2+3\" WHERE time < 1509465600001");
+            "DELETE FROM root.ln.`wf+01`.wt01.`status+2+3` WHERE time < 1509465600001");
       } finally {
         resultSet.close();
       }
@@ -112,10 +112,10 @@ public class IoTDBQuotedPathIT {
   public void testIllegalStorageGroup() throws SQLException {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
-      statement.execute("SET STORAGE GROUP TO root.\"ln\"");
+      statement.execute("SET STORAGE GROUP TO root.`\"ln`");
     } catch (IoTDBSQLException e) {
       Assert.assertEquals(
-          "315: The storage group name can only be characters, numbers and underscores. root.\"ln\" is not a legal path",
+          "315: The storage group name can only be characters, numbers and underscores. root.\"ln is not a legal path",
           e.getMessage());
     } catch (Exception e) {
       e.printStackTrace();
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java
index 72e46de30a..24dd0f2417 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSimpleQueryIT.java
@@ -88,7 +88,8 @@ public class IoTDBSimpleQueryIT {
       statement.execute("SET STORAGE GROUP TO root.sg1");
       // test set sdt property
       statement.execute(
-          "CREATE TIMESERIES root.sg1.d0.s1 WITH DATATYPE=INT32,ENCODING=PLAIN,LOSS=SDT,COMPDEV=2");
+          "CREATE TIMESERIES root.sg1.d0.s1 WITH DATATYPE=INT32,ENCODING=PLAIN,"
+              + "'LOSS'='SDT','COMPDEV'='2'");
     } catch (SQLException e) {
       e.printStackTrace();
     }
@@ -109,7 +110,7 @@ public class IoTDBSimpleQueryIT {
       // test set sdt property
       statement.execute(
           "CREATE TIMESERIES root.sg1.d0.s1 WITH DATATYPE=INT32,ENCODING=PLAIN,"
-              + "LOSS=SDT,COMPDEV=2,COMPMINTIME=2,COMPMAXTIME=10");
+              + "'LOSS'='SDT','COMPDEV'='2','COMPMINTIME'='2','COMPMAXTIME'='10'");
     } catch (SQLException e) {
       e.printStackTrace();
     }
@@ -130,7 +131,7 @@ public class IoTDBSimpleQueryIT {
       statement.execute("SET STORAGE GROUP TO root.sg1");
       try {
         statement.execute(
-            "CREATE TIMESERIES root.sg1.d0.s1 WITH DATATYPE=INT32,ENCODING=PLAIN,LOSS=SDT,COMPDEV=-2");
+            "CREATE TIMESERIES root.sg1.d0.s1 WITH DATATYPE=INT32,ENCODING=PLAIN,'LOSS'='SDT','COMPDEV'='-2'");
       } catch (Exception e) {
         assertEquals(
             "318: SDT compression deviation cannot be negative. Failed to create timeseries for path root.sg1.d0.s1",
@@ -284,8 +285,10 @@ public class IoTDBSimpleQueryIT {
       double compDev = 2;
       // test set sdt property
       statement.execute(
-          "CREATE TIMESERIES root.sg1.d0.s0 WITH DATATYPE=INT32,ENCODING=PLAIN,LOSS=SDT,COMPDEV="
-              + compDev);
+          "CREATE TIMESERIES root.sg1.d0.s0 WITH DATATYPE=INT32,ENCODING=PLAIN,'LOSS'='SDT','COMPDEV'="
+              + "'"
+              + compDev
+              + "'");
 
       int[] originalValues = new int[1000];
 
@@ -1117,16 +1120,16 @@ public class IoTDBSimpleQueryIT {
       statement.execute("SET STORAGE GROUP TO root.sg1");
       statement.execute(
           "CREATE TIMESERIES root.sg1.d1.s1 with datatype=FLOAT, encoding=TS_2DIFF, "
-              + "max_point_number=4");
+              + "'max_point_number'='4'");
       statement.execute(
           "CREATE TIMESERIES root.sg1.d1.s2 with datatype=FLOAT, encoding=TS_2DIFF, "
-              + "max_point_number=2.5");
+              + "'max_point_number'='2.5'");
       statement.execute(
           "CREATE TIMESERIES root.sg1.d1.s3 with datatype=FLOAT, encoding=RLE, "
-              + "max_point_number=q");
+              + "'max_point_number'='q'");
       statement.execute(
           "CREATE TIMESERIES root.sg1.d1.s4 with datatype=FLOAT, encoding=RLE, "
-              + "max_point_number=-1");
+              + "'max_point_number'='-1'");
       statement.execute(
           "insert into root.sg1.d1(timestamp,s1,s2,s3,s4) values(1,1.1234,1.1234,1.1234,1.1234)");
 
@@ -1227,16 +1230,16 @@ public class IoTDBSimpleQueryIT {
       statement.execute("SET STORAGE GROUP TO root.sg1");
       statement.execute(
           "CREATE TIMESERIES root.sg1.d1.s1 with datatype=FLOAT, encoding=TS_2DIFF, "
-              + "max_point_number=4");
+              + "'max_point_number'='4'");
       statement.execute(
           "CREATE TIMESERIES root.sg1.d1.s2 with datatype=FLOAT, encoding=TS_2DIFF, "
-              + "max_point_number=2.5");
+              + "'max_point_number'='2.5'");
       statement.execute(
           "CREATE TIMESERIES root.sg1.d1.s3 with datatype=FLOAT, encoding=RLE, "
-              + "max_point_number=q");
+              + "'max_point_number'='q'");
       statement.execute(
           "CREATE TIMESERIES root.sg1.d1.s4 with datatype=FLOAT, encoding=RLE, "
-              + "max_point_number=-1");
+              + "'max_point_number'='-1'");
       statement.execute(
           "insert into root.sg1.da1cb(timestamp,s1,s2,s3,s4) values(1,1.1234,1.1234,1.1234,1.1234)");
       statement.execute(
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSortedShowTimeseriesIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSortedShowTimeseriesIT.java
index 6a7c4ef0d2..b54368d9ac 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSortedShowTimeseriesIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSortedShowTimeseriesIT.java
@@ -47,29 +47,41 @@ public class IoTDBSortedShowTimeseriesIT {
         "SET STORAGE GROUP TO root.turbine",
         "SET STORAGE GROUP TO root.ln",
         "create timeseries root.turbine.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(unit=f, description='turbine this is a test1') attributes(H_Alarm=100, M_Alarm=50)",
+            + "tags('unit'='f', 'description'='turbine this is a test1') "
+            + "attributes('H_Alarm'='100', 'M_Alarm'='50')",
         "create timeseries root.turbine.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(unit=kw, description='turbine this is a test2') attributes(H_Alarm=99.9, M_Alarm=44.4)",
+            + "tags('unit'='kw', 'description'='turbine this is a test2') "
+            + "attributes('H_Alarm'='99.9', 'M_Alarm'='44.4')",
         "create timeseries root.turbine.d0.s2(cpu) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(unit=cores, description='turbine this is a cpu') attributes(H_Alarm=99.9, M_Alarm=44.4)",
+            + "tags('unit'='cores', 'description'='turbine this is a cpu') "
+            + "attributes('H_Alarm'='99.9', 'M_Alarm'='44.4')",
         "create timeseries root.turbine.d0.s3(gpu0) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(unit=cores, description='turbine this is a gpu') attributes(H_Alarm=99.9, M_Alarm=44.4)",
+            + "tags('unit'='cores', 'description'='turbine this is a gpu') "
+            + "attributes('H_Alarm'='99.9', 'M_Alarm'='44.4')",
         "create timeseries root.turbine.d0.s4(tpu0) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(unit=cores, description='turbine this is a tpu') attributes(H_Alarm=99.9, M_Alarm=44.4)",
+            + "tags('unit'='cores', 'description'='turbine this is a tpu') "
+            + "attributes('H_Alarm'='99.9', 'M_Alarm'='44.4')",
         "create timeseries root.turbine.d1.s0(status) with datatype=INT32, encoding=RLE "
-            + "tags(description='turbine this is a test3') attributes(H_Alarm=9, M_Alarm=5)",
+            + "tags('description'='turbine this is a test3') "
+            + "attributes('H_Alarm'='9', 'M_Alarm'='5')",
         "create timeseries root.turbine.d2.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(unit=f, description='turbine d2 this is a test1') attributes(MaxValue=100, MinValue=1)",
+            + "tags('unit'='f', 'description'='turbine d2 this is a test1') "
+            + "attributes('MaxValue'='100', 'MinValue'='1')",
         "create timeseries root.turbine.d2.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(unit=kw, description='turbine d2 this is a test2') attributes(MaxValue=99.9, MinValue=44.4)",
+            + "tags('unit'='kw', 'description'='turbine d2 this is a test2') "
+            + "attributes('MaxValue'='99.9', 'MinValue'='44.4')",
         "create timeseries root.turbine.d2.s3(status) with datatype=INT32, encoding=RLE "
-            + "tags(description='turbine d2 this is a test3') attributes(MaxValue=9, MinValue=5)",
+            + "tags('description'='turbine d2 this is a test3') "
+            + "attributes('MaxValue'='9', 'MinValue'='5')",
         "create timeseries root.ln.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(unit=c, description='ln this is a test1') attributes(H_Alarm=1000, M_Alarm=500)",
+            + "tags('unit'='c', 'description'='ln this is a test1') "
+            + "attributes('H_Alarm'='1000', 'M_Alarm'='500')",
         "create timeseries root.ln.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(unit=w, description='ln this is a test2') attributes(H_Alarm=9.9, M_Alarm=4.4)",
+            + "tags('unit'='w', 'description'='ln this is a test2') "
+            + "attributes('H_Alarm'='9.9', 'M_Alarm'='4.4')",
         "create timeseries root.ln.d1.s0(status) with datatype=INT32, encoding=RLE "
-            + "tags(description='ln this is a test3') attributes(H_Alarm=90, M_Alarm=50)",
+            + "tags('description'='ln this is a test3') "
+            + "attributes('H_Alarm'='90', 'M_Alarm'='50')",
         "insert into root.turbine.d0(timestamp,s0) values(1, 1)",
         "insert into root.turbine.d0(timestamp,s1) values(2, 2)",
         "insert into root.turbine.d0(timestamp,s2) values(3, 3)",
@@ -279,7 +291,7 @@ public class IoTDBSortedShowTimeseriesIT {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
 
-      boolean hasResultSet = statement.execute("show LATEST timeseries where unit=cores");
+      boolean hasResultSet = statement.execute("show LATEST timeseries where 'unit'='cores'");
       Assert.assertTrue(hasResultSet);
       ResultSet resultSet = statement.getResultSet();
       int count = 0;
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSyntaxConventionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSyntaxConventionIT.java
deleted file mode 100644
index 0d868ca1e7..0000000000
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSyntaxConventionIT.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- * 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.db.integration;
-
-import org.apache.iotdb.integration.env.EnvFactory;
-import org.apache.iotdb.itbase.category.ClusterTest;
-import org.apache.iotdb.itbase.category.LocalStandaloneTest;
-import org.apache.iotdb.itbase.category.RemoteTest;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import static org.junit.Assert.fail;
-
-@Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
-public class IoTDBSyntaxConventionIT {
-
-  @Before
-  public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-  }
-
-  @Test
-  public void testStringLiteral() {
-    String[] insertData = {
-      "'string'",
-      "'\"string\"'",
-      "'\"\"string\"\"'",
-      "'\\'string'",
-      "\"string\"",
-      "\"'string'\"",
-      "\"''string''\"",
-      "\"\\\"string\""
-    };
-    String[] resultData = {
-      "string",
-      "\"string\"",
-      "\"\"string\"\"",
-      "'string",
-      "string",
-      "'string'",
-      "''string''",
-      "\"string"
-    };
-
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.s1 TEXT");
-      for (int i = 0; i < insertData.length; i++) {
-        String insertSql =
-            String.format("INSERT INTO root.sg1.d1(time, s1) values (%d, %s)", i, insertData[i]);
-        System.out.println("INSERT STATEMENT: " + insertSql);
-        statement.execute(insertSql);
-      }
-
-      boolean hasResult = statement.execute("SELECT s1 FROM root.sg1.d1");
-      Assert.assertTrue(hasResult);
-
-      int cnt = 0;
-      ResultSet resultSet = statement.getResultSet();
-      while (resultSet.next()) {
-        Assert.assertEquals(resultData[cnt], resultSet.getString("root.sg1.d1.s1"));
-        cnt++;
-      }
-      Assert.assertEquals(8, cnt);
-
-      for (int i = 0; i < insertData.length; i++) {
-        String querySql = String.format("SELECT s1 FROM root.sg1.d1 WHERE s1 = %s", insertData[i]);
-        System.out.println("QUERY STATEMENT: " + querySql);
-        hasResult = statement.execute(querySql);
-        Assert.assertTrue(hasResult);
-
-        resultSet = statement.getResultSet();
-        Assert.assertTrue(resultSet.next());
-      }
-
-    } catch (SQLException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  @Test
-  public void testIllegalStringLiteral1() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.s1 TEXT");
-      statement.execute("INSERT INTO root.sg1.d1(time, s1) values (1, string)");
-      fail();
-    } catch (SQLException ignored) {
-    }
-  }
-
-  @Test
-  public void testIllegalStringLiteral2() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.s1 TEXT");
-      statement.execute("INSERT INTO root.sg1.d1(time, s1) values (1, `string`)");
-      fail();
-    } catch (SQLException ignored) {
-    }
-  }
-
-  @Test
-  public void testExpression1() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.`1` INT32");
-      boolean hasResult = statement.execute("SELECT `1` FROM root.sg1.d1");
-      Assert.assertTrue(hasResult);
-
-      ResultSet resultSet = statement.getResultSet();
-      Assert.assertFalse(resultSet.next());
-    } catch (SQLException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  @Test
-  public void testIllegalExpression1() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.`1` INT32");
-      statement.execute("SELECT 1 FROM root.sg1.d1");
-      fail();
-    } catch (SQLException ignored) {
-    }
-  }
-
-  @Test
-  public void testExpression2() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.`1` INT32");
-      boolean hasResult = statement.execute("SELECT `1` + 1 FROM root.sg1.d1");
-      Assert.assertTrue(hasResult);
-
-      ResultSet resultSet = statement.getResultSet();
-      Assert.assertFalse(resultSet.next());
-    } catch (SQLException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  @Test
-  public void testIllegalExpression2() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.`1` INT32");
-      statement.execute("SELECT 1 + 1 FROM root.sg1.d1");
-      fail();
-    } catch (SQLException ignored) {
-    }
-  }
-
-  @Test
-  public void testExpression3() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.`1` INT64");
-      boolean hasResult = statement.execute("SELECT sin(`1`) FROM root.sg1.d1");
-      Assert.assertTrue(hasResult);
-
-      ResultSet resultSet = statement.getResultSet();
-      Assert.assertFalse(resultSet.next());
-    } catch (SQLException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  @Test
-  public void testIllegalExpression3() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.`1` INT64");
-      statement.execute("SELECT sin(1) FROM root.sg1.d1");
-      fail();
-    } catch (SQLException ignored) {
-    }
-  }
-
-  @Test
-  public void testIllegalExpression4() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.'a' INT64");
-      try {
-        statement.execute("SELECT 'a' FROM root.sg1.d1");
-        fail();
-      } catch (SQLException e) {
-        // ignored
-      }
-    } catch (SQLException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  @Test
-  public void testNodeName() {
-    String[] createNodeNames = {
-      "`select`",
-      "'select'",
-      "\"select\"",
-      "`a+b`",
-      "'a+b'",
-      "\"a+b\"",
-      "'a.b'",
-      "\"a.b\"",
-      "\"a'.'b\"",
-      "\"a.\"",
-      "\".a\"",
-      "'a.'",
-      "'.a'",
-      "`\\\"a`",
-      "`a\\\"`",
-      "\"a\\\".\\\"b\""
-    };
-    String[] selectNodeNames = {
-      "`select`",
-      "`'select'`",
-      "`\"select\"`",
-      "`a+b`",
-      "`'a+b'`",
-      "`\"a+b\"`",
-      "`'a.b'`",
-      "`\"a.b\"`",
-      "`\"a'.'b\"`",
-      "`\"a.\"`",
-      "`\".a\"`",
-      "`'a.'`",
-      "`'.a'`",
-      "`\\\"a`",
-      "`a\\\"`",
-      "`\"a\\\".\\\"b\"`"
-    };
-    String[] resultNodeNames = {
-      "select",
-      "'select'",
-      "\"select\"",
-      "a+b",
-      "'a+b'",
-      "\"a+b\"",
-      "'a.b'",
-      "\"a.b\"",
-      "\"a'.'b\"",
-      "\"a.\"",
-      "\".a\"",
-      "'a.'",
-      "'.a'",
-      "\\\"a",
-      "a\\\"",
-      "\"a\\\".\\\"b\""
-    };
-    String[] resultTimeseries = {
-      "root.sg1.d1.select",
-      "root.sg1.d1.'select'",
-      "root.sg1.d1.\"select\"",
-      "root.sg1.d1.a+b",
-      "root.sg1.d1.'a+b'",
-      "root.sg1.d1.\"a+b\"",
-      "root.sg1.d1.'a.b'",
-      "root.sg1.d1.\"a.b\"",
-      "root.sg1.d1.\"a'.'b\"",
-      "root.sg1.d1.\"a.\"",
-      "root.sg1.d1.\".a\"",
-      "root.sg1.d1.'a.'",
-      "root.sg1.d1.'.a'",
-      "root.sg1.d1.\\\"a",
-      "root.sg1.d1.a\\\"",
-      "root.sg1.d1.\"a\\\".\\\"b\""
-    };
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      for (int i = 0; i < createNodeNames.length; i++) {
-        String createSql =
-            String.format("CREATE TIMESERIES root.sg1.d1.%s INT32", createNodeNames[i]);
-        String insertSql =
-            String.format("INSERT INTO root.sg1.d1(time, %s) VALUES(1, 1)", createNodeNames[i]);
-        System.out.println("CREATE TIMESERIES: " + createSql);
-        statement.execute(createSql);
-        statement.execute(insertSql);
-      }
-
-      boolean hasResult = statement.execute("SHOW TIMESERIES");
-      Assert.assertTrue(hasResult);
-      Set<String> expectedResult = new HashSet<>(Arrays.asList(resultTimeseries));
-
-      ResultSet resultSet = statement.getResultSet();
-      while (resultSet.next()) {
-        Assert.assertTrue(expectedResult.contains(resultSet.getString("timeseries")));
-        expectedResult.remove(resultSet.getString("timeseries"));
-      }
-      Assert.assertEquals(0, expectedResult.size());
-
-      for (int i = 0; i < selectNodeNames.length; i++) {
-        String selectSql =
-            String.format("SELECT %s FROM root.sg1.d1 WHERE time = 1", selectNodeNames[i]);
-        System.out.println("SELECT STATEMENT: " + selectSql);
-        hasResult = statement.execute(selectSql);
-        Assert.assertTrue(hasResult);
-
-        resultSet = statement.getResultSet();
-        Assert.assertTrue(resultSet.next());
-        Assert.assertEquals(1, resultSet.getInt("root.sg1.d1." + resultNodeNames[i]));
-      }
-
-    } catch (SQLException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  @Test
-  public void testIllegalNodeName() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      try {
-        statement.execute("CREATE TIMESERIES root.sg1.d1.`a.b` TEXT");
-        fail();
-      } catch (SQLException ignored) {
-      }
-      try {
-        statement.execute("CREATE TIMESERIES root.sg.d1.`\"a`.s1 TEXT");
-        fail();
-      } catch (SQLException ignored) {
-      }
-      try {
-        statement.execute("CREATE TIMESERIES root.sg.d1.`a\"`.s1 TEXT");
-        fail();
-      } catch (SQLException ignored) {
-      }
-      try {
-        statement.execute("CREATE TIMESERIES root.sg.d1.`'a`.s1 TEXT");
-        fail();
-      } catch (SQLException ignored) {
-      }
-      try {
-        statement.execute("CREATE TIMESERIES root.sg.d1.`a'`.s1 TEXT");
-        fail();
-      } catch (SQLException ignored) {
-      }
-      try {
-        statement.execute("CREATE TIMESERIES root.sg1.d1.\"a\".b\" TEXT");
-        fail();
-      } catch (SQLException ignored) {
-      }
-      try {
-        statement.execute("CREATE TIMESERIES root.sg.`\"a`.`\"` TEXT");
-        fail();
-      } catch (SQLException ignored) {
-      }
-      try {
-        statement.execute("CREATE TIMESERIES root.sg.`\"ab`.`cd\"` TEXT");
-        fail();
-      } catch (SQLException ignored) {
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  @Test
-  public void testIdentifier() {
-    String[] createIdentifiers = {
-      "id",
-      "ID",
-      "id0",
-      "_id",
-      "0id",
-      "233",
-      "`ab!`",
-      "`\"ab\"`",
-      "`\\\"ac\\\"`",
-      "`'ab'`",
-      "`a.b`",
-      "`a\\`b`"
-    };
-    String[] resultIdentifiers = {
-      "id", "ID", "id0", "_id", "0id", "233", "ab!", "\"ab\"", "\"ac\"", "'ab'", "a.b", "a`b"
-    };
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      for (int i = 0; i < createIdentifiers.length; i++) {
-        String createTemplateSql =
-            String.format(
-                "create schema template %s (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)",
-                createIdentifiers[i]);
-        System.out.println("CREATE TEMPLATE: " + createTemplateSql);
-        statement.execute(createTemplateSql);
-      }
-
-      boolean hasResult = statement.execute("SHOW TEMPLATES");
-      Assert.assertTrue(hasResult);
-      Set<String> expectedResult = new HashSet<>(Arrays.asList(resultIdentifiers));
-
-      ResultSet resultSet = statement.getResultSet();
-      while (resultSet.next()) {
-        Assert.assertTrue(expectedResult.contains(resultSet.getString("template name")));
-        expectedResult.remove(resultSet.getString("template name"));
-      }
-      Assert.assertEquals(0, expectedResult.size());
-
-    } catch (SQLException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  @Test
-  public void testIllegaltIdentifier() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      try {
-        statement.execute(
-            "create schema template ab! (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)");
-        fail();
-      } catch (SQLException ignored) {
-      }
-      try {
-        statement.execute(
-            "create schema template `a`b` (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)");
-        fail();
-      } catch (SQLException ignored) {
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSyntaxConventionIdentifierIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSyntaxConventionIdentifierIT.java
new file mode 100644
index 0000000000..81fb785122
--- /dev/null
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSyntaxConventionIdentifierIT.java
@@ -0,0 +1,838 @@
+/*
+ * 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.db.integration;
+
+import org.apache.iotdb.integration.env.EnvFactory;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
+
+public class IoTDBSyntaxConventionIdentifierIT {
+  @Before
+  public void setUp() throws Exception {
+    EnvFactory.getEnv().initBeforeTest();
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    EnvFactory.getEnv().cleanAfterTest();
+  }
+
+  @Test
+  public void testNodeName() {
+    String[] createNodeNames = {
+      "a_1",
+      "A@#{}:",
+      "aaa",
+      "`select`",
+      "`a.b`",
+      "`111`",
+      "`a``b`",
+      "`a.\"b`",
+      "`a.'b`",
+      "````",
+      "`c.d.```",
+    };
+
+    String[] resultTimeseries = {
+      "root.sg1.d1.a_1",
+      "root.sg1.d1.A@#{}:",
+      "root.sg1.d1.aaa",
+      "root.sg1.d1.select",
+      "root.sg1.d1.`a.b`",
+      "root.sg1.d1.111",
+      "root.sg1.d1.`a``b`",
+      "root.sg1.d1.`a.\"b`",
+      "root.sg1.d1.`a.'b`",
+      "root.sg1.d1.````",
+      "root.sg1.d1.`c.d.```",
+    };
+
+    String[] selectNodeNames = {
+      "a_1",
+      "A@#{}:",
+      "aaa",
+      "`select`",
+      "`a.b`",
+      "`111`",
+      "`a``b`",
+      "`a.\"b`",
+      "`a.'b`",
+      "````",
+      "`c.d.```",
+    };
+
+    String[] suffixInResultColumns = {
+      "a_1",
+      "A@#{}:",
+      "aaa",
+      "select",
+      "`a.b`",
+      "111",
+      "`a``b`",
+      "`a.\"b`",
+      "`a.'b`",
+      "````",
+      "`c.d.```",
+    };
+
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      for (int i = 0; i < createNodeNames.length; i++) {
+        String createSql =
+            String.format("CREATE TIMESERIES root.sg1.d1.%s INT32", createNodeNames[i]);
+        String insertSql =
+            String.format("INSERT INTO root.sg1.d1(time, %s) VALUES(1, 1)", createNodeNames[i]);
+        statement.execute(createSql);
+        statement.execute(insertSql);
+      }
+
+      boolean hasResult = statement.execute("SHOW TIMESERIES");
+      Assert.assertTrue(hasResult);
+      Set<String> expectedResult = new HashSet<>(Arrays.asList(resultTimeseries));
+
+      ResultSet resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        Assert.assertTrue(expectedResult.contains(resultSet.getString("timeseries")));
+        expectedResult.remove(resultSet.getString("timeseries"));
+      }
+      Assert.assertEquals(0, expectedResult.size());
+
+      for (int i = 0; i < selectNodeNames.length; i++) {
+        String selectSql =
+            String.format("SELECT %s FROM root.sg1.d1 WHERE time = 1", selectNodeNames[i]);
+        hasResult = statement.execute(selectSql);
+        Assert.assertTrue(hasResult);
+
+        resultSet = statement.getResultSet();
+        Assert.assertTrue(resultSet.next());
+        Assert.assertEquals(1, resultSet.getInt("root.sg1.d1." + suffixInResultColumns[i]));
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testNodeNameIllegal() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+
+      // nodeName with special characters should be quoted with '`'
+      try {
+        statement.execute("create timeseries root.sg1.d1.`a INT32");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create timeseries root.sg1.d1.[a INT32");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create timeseries root.sg1.d1.a! INT32");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create timeseries root.sg1.d1.a\" INT32");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create timeseries root.sg1.d1.a' INT32");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      // nodeName consists of numbers should be quoted with '`'
+      try {
+        statement.execute("create timeseries root.sg1.d1.111 INT32");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create timeseries root.sg1.d1.012 INT32");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      // shouled use double '`' in a quoted nodeName
+      try {
+        statement.execute("create timeseries root.sg1.d1.`a`` INT32");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testExpression() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.sg1.d1.`1` INT32");
+      statement.execute("CREATE TIMESERIES root.sg1.d1.`a.b` INT32");
+      statement.execute("CREATE TIMESERIES root.sg1.d1.`a.``b` INT32");
+      int pointCnt = 3;
+      for (int i = 0; i < pointCnt; i++) {
+        statement.execute(
+            String.format(
+                "insert into root.sg1.d1(time,%s,%s,%s) values(%d,%d,%d,%d)",
+                "`1`", "`a.b`", "`a.``b`", i, i, i, i));
+      }
+
+      int cnt = 0;
+      boolean hasResult = statement.execute("SELECT `1` + 1 FROM root.sg1.d1");
+      Assert.assertTrue(hasResult);
+      ResultSet resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        cnt++;
+      }
+      Assert.assertEquals(pointCnt, cnt);
+
+      cnt = 0;
+      hasResult = statement.execute("SELECT (`1`*`1`)+1-`a.b` FROM root.sg1.d1 where `1` > 1");
+      Assert.assertTrue(hasResult);
+
+      resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        cnt++;
+      }
+      Assert.assertEquals(1, cnt);
+
+      cnt = 0;
+      hasResult = statement.execute("SELECT (`1`*`1`)+1-`a.b` FROM root.sg1.d1");
+      Assert.assertTrue(hasResult);
+
+      resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        cnt++;
+      }
+      Assert.assertEquals(pointCnt, cnt);
+
+      cnt = 0;
+      hasResult = statement.execute("SELECT (`1`*`1`)+1-`a.b` FROM root.sg1.d1 where `1`>0");
+      Assert.assertTrue(hasResult);
+
+      resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        cnt++;
+      }
+      Assert.assertEquals(2, cnt);
+
+      cnt = 0;
+      hasResult = statement.execute("SELECT avg(`1`)+1 FROM root.sg1.d1");
+      Assert.assertTrue(hasResult);
+
+      resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        cnt++;
+      }
+      Assert.assertEquals(1, cnt);
+
+      cnt = 0;
+      hasResult = statement.execute("SELECT count(`1`)+1 FROM root.sg1.d1 where `1`>1");
+      Assert.assertTrue(hasResult);
+
+      resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        Assert.assertEquals(2.0, resultSet.getDouble(1), 1e-7);
+        cnt++;
+      }
+      Assert.assertEquals(1, cnt);
+
+      cnt = 0;
+      hasResult = statement.execute("SELECT sin(`1`) + 1 FROM root.sg1.d1");
+      Assert.assertTrue(hasResult);
+
+      resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        cnt++;
+      }
+      Assert.assertEquals(pointCnt, cnt);
+
+      cnt = 0;
+      hasResult = statement.execute("SELECT sin(`1`) + 1 FROM root.sg1.d1 where `1`>1");
+      Assert.assertTrue(hasResult);
+
+      resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        cnt++;
+      }
+      Assert.assertEquals(1, cnt);
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testUDFName() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      String[] udfNames = {"udf", "`udf.test`", "`012`", "`udf```"};
+
+      String[] resultNames = {"udf", "udf.test", "012", "udf`"};
+
+      String createSql = "create function %s as 'org.apache.iotdb.db.query.udf.example.Adder'";
+      for (int i = 0; i < udfNames.length; i++) {
+        statement.execute(String.format(createSql, udfNames[i]));
+      }
+      statement.execute("show functions");
+      Set<String> expectedResult = new HashSet<>(Arrays.asList(resultNames));
+      ResultSet resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        if (resultSet.getString(2).equals("external UDTF")) {
+          String udf = resultSet.getString(1).toLowerCase();
+          Assert.assertTrue(expectedResult.contains(udf));
+          expectedResult.remove(udf);
+        }
+      }
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testUDFNameIllegal() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      try {
+        statement.execute("create function udf` as 'org.apache.iotdb.db.query.udf.example.Adder'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "create function ``udf` as 'org.apache.iotdb.db.query.udf.example.Adder'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create function 111 as 'org.apache.iotdb.db.query.udf.example.Adder'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create function 'udf' as 'org.apache.iotdb.db.query.udf.example.Adder'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "create function \"udf\" as 'org.apache.iotdb.db.query.udf.example.Adder'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testTriggerName() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      String[] timeseries = {
+        "root.vehicle.d1.s1",
+        "root.vehicle.d1.s2",
+        "root.vehicle.d1.s3",
+        "root.vehicle.d1.s4",
+        "root.vehicle.d1.s5",
+      };
+
+      String[] triggerNames = {
+        "`trigger`", "trigger1", "`test```", "`111`", "`[trigger]`",
+      };
+
+      String[] resultNames = {
+        "trigger", "trigger1", "test`", "111", "[trigger]",
+      };
+      // show
+      ResultSet resultSet = statement.executeQuery("show triggers");
+      assertFalse(resultSet.next());
+
+      String createTimeSereisSql = "CREATE TIMESERIES %s FLOAT";
+      String createTriggerSql =
+          "create trigger %s before insert on %s "
+              + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'";
+      for (int i = 0; i < timeseries.length; ++i) {
+        statement.execute(String.format(createTimeSereisSql, timeseries[i]));
+        statement.execute(String.format(createTriggerSql, triggerNames[i], timeseries[i]));
+      }
+      Set<String> expectedResult = new HashSet<>(Arrays.asList(resultNames));
+      resultSet = statement.executeQuery("show triggers");
+      while (resultSet.next()) {
+        String trigger = resultSet.getString(1).toLowerCase();
+        Assert.assertTrue(expectedResult.contains(trigger));
+        expectedResult.remove(trigger);
+      }
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testTriggerNameIllegal() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      try {
+        statement.execute(
+            "create trigger trigger before insert on root.sg1.d1  "
+                + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "create trigger `trigger`` before insert on root.sg1.d1  "
+                + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "create trigger 111 before insert on root.sg1.d1  "
+                + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "create trigger 'tri' before insert on root.sg1.d1  "
+                + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "create trigger \"tri\" before insert on root.sg1.d1  "
+                + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testContinuousQueryNameIllegal() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      try {
+        statement.execute(
+            "CREATE CONTINUOUS QUERY `cq1 "
+                + "BEGIN SELECT max_value(temperature) INTO temperature_max FROM root.ln.*.*.* "
+                + "GROUP BY time(1s) END");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "CREATE CONTINUOUS QUERY 111 "
+                + "BEGIN SELECT max_value(temperature) INTO temperature_max FROM root.ln.*.*.* "
+                + "GROUP BY time(1s) END");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "CREATE CONTINUOUS QUERY ``cq1` "
+                + "BEGIN SELECT max_value(temperature) INTO temperature_max FROM root.ln.*.*.* "
+                + "GROUP BY time(1s) END");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "CREATE CONTINUOUS QUERY 'cq1' "
+                + "BEGIN SELECT max_value(temperature) INTO temperature_max FROM root.ln.*.*.* "
+                + "GROUP BY time(1s) END");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "CREATE CONTINUOUS QUERY \"cq1\" "
+                + "BEGIN SELECT max_value(temperature) INTO temperature_max FROM root.ln.*.*.* "
+                + "GROUP BY time(1s) END");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testTemplateName() {
+    String[] templateNames = {
+      "id",
+      "ID",
+      "id0",
+      "_id",
+      "0id",
+      "`233`",
+      "`ab!`",
+      "`\"ab\"`",
+      "`\\\"ac\\\"`",
+      "`'ab'`",
+      "`a.b`",
+      "`a``b`"
+    };
+
+    String[] resultNames = {
+      "id", "ID", "id0", "_id", "0id", "233", "ab!", "\"ab\"", "\"ac\"", "'ab'", "a.b", "a`b"
+    };
+
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      for (String templateName : templateNames) {
+        String createTemplateSql =
+            String.format(
+                "create schema template %s (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)",
+                templateName);
+        statement.execute(createTemplateSql);
+      }
+
+      boolean hasResult = statement.execute("SHOW TEMPLATES");
+      Assert.assertTrue(hasResult);
+      Set<String> expectedResult = new HashSet<>(Arrays.asList(resultNames));
+
+      ResultSet resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        Assert.assertTrue(expectedResult.contains(resultSet.getString("template name")));
+        expectedResult.remove(resultSet.getString("template name"));
+      }
+      Assert.assertEquals(0, expectedResult.size());
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testTemplateNameIllegal() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      try {
+        statement.execute(
+            "create schema template `a`` "
+                + "(temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "create schema template 111 "
+                + "(temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "create schema template `a "
+                + "(temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "create schema template 'a' "
+                + "(temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute(
+            "create schema template \"a\" "
+                + "(temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testUserName() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      String[] userNames =
+          new String[] {
+            "userid",
+            "userid0",
+            "user_id",
+            "user0id",
+            "`22233`",
+            "`userab!`",
+            "`user'ab'`",
+            "`usera.b`",
+            "`usera``b`"
+          };
+
+      String[] resultNames =
+          new String[] {
+            "root",
+            "userid",
+            "userid0",
+            "user_id",
+            "user0id",
+            "22233",
+            "userab!",
+            "user'ab'",
+            "usera.b",
+            "usera`b"
+          };
+
+      String createUsersSql = "create user %s 'pwd123' ";
+      for (String userName : userNames) {
+        statement.execute(String.format(createUsersSql, userName));
+      }
+      Set<String> expectedResult = new HashSet<>(Arrays.asList(resultNames));
+      ResultSet resultSet = statement.executeQuery("list user");
+      while (resultSet.next()) {
+        String user = resultSet.getString("user").toLowerCase();
+        Assert.assertTrue(expectedResult.contains(user));
+        expectedResult.remove(user);
+      }
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testUserNameIllegal() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      try {
+        statement.execute("create user `abcd`` 'pwd123'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create user `abcd 'pwd123'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create user 12345 'pwd123'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create user a.b.c 'pwd123'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create user a!@bc 'pwd123'");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testRoleName() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      String[] roleNames =
+          new String[] {
+            "roleid",
+            "roleid0",
+            "role_id",
+            "role0id",
+            "`22233`",
+            "`roleab!`",
+            "`role'ab'`",
+            "`rolea.b`",
+            "`rolea``b`"
+          };
+
+      String[] resultNames =
+          new String[] {
+            "roleid",
+            "roleid0",
+            "role_id",
+            "role0id",
+            "22233",
+            "roleab!",
+            "role'ab'",
+            "rolea.b",
+            "rolea`b"
+          };
+      String createRolesSql = "create role %s";
+      for (String roleName : roleNames) {
+        statement.execute(String.format(createRolesSql, roleName));
+      }
+      Set<String> expectedResult = new HashSet<>(Arrays.asList(resultNames));
+      ResultSet resultSet = statement.executeQuery("list role");
+      while (resultSet.next()) {
+        String role = resultSet.getString("role").toLowerCase();
+        Assert.assertTrue(expectedResult.contains(role));
+        expectedResult.remove(role);
+      }
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testRoleNameIllegal() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      try {
+        statement.execute("create role `abcd``");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create role `abcd");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create role 123456");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create role a.b.c");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("create role a!b%c");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testPipeSinkNameIllegal() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      try {
+        statement.execute("CREATE PIPESINK test` AS IoTDB (`ip` = '127.0.0.1')");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("CREATE PIPESINK ``test` AS IoTDB (`ip` = '127.0.0.1')");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("CREATE PIPESINK test.1 AS IoTDB (`ip` = '127.0.0.1')");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("CREATE PIPESINK 12345 AS IoTDB (`ip` = '127.0.0.1')");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+      try {
+        statement.execute("CREATE PIPESINK a!@cb AS IoTDB (`ip` = '127.0.0.1')");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSyntaxConventionStringLiteralIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSyntaxConventionStringLiteralIT.java
new file mode 100644
index 0000000000..0e39251fbd
--- /dev/null
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBSyntaxConventionStringLiteralIT.java
@@ -0,0 +1,764 @@
+/*
+ * 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.db.integration;
+
+import org.apache.iotdb.db.query.udf.builtin.BuiltinFunction;
+import org.apache.iotdb.integration.env.EnvFactory;
+import org.apache.iotdb.itbase.category.ClusterTest;
+import org.apache.iotdb.itbase.category.LocalStandaloneTest;
+import org.apache.iotdb.itbase.category.RemoteTest;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import static org.apache.iotdb.commons.conf.IoTDBConstant.FUNCTION_TYPE_NATIVE;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+@Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
+public class IoTDBSyntaxConventionStringLiteralIT {
+
+  @Before
+  public void setUp() throws Exception {
+    EnvFactory.getEnv().initBeforeTest();
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    EnvFactory.getEnv().cleanAfterTest();
+  }
+
+  /** Legal cases of using StringLiteral with single quote in insert and select clause. */
+  @Test
+  public void testStringLiteralWithSingleQuote() {
+    String[] insertData = {
+      "'string'",
+      "'`string`'",
+      "'``string'",
+      "'\"string\"'",
+      "'\"\"string'",
+      "'\\\"string\\\"'",
+      "'''string'",
+      "'\\'string'",
+      "'\\nstring'",
+      "'\\rstring'",
+      "'@#$%^&*()string'",
+    };
+
+    String[] resultData = {
+      "string",
+      "`string`",
+      "``string",
+      "\"string\"",
+      "\"\"string",
+      "\"string\"",
+      "'string",
+      "'string",
+      "\nstring",
+      "\rstring",
+      "@#$%^&*()string",
+    };
+
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.sg1.d1.s1 TEXT");
+      for (int i = 0; i < insertData.length; i++) {
+        String insertSql =
+            String.format("INSERT INTO root.sg1.d1(time, s1) values (%d, %s)", i, insertData[i]);
+        System.out.println("INSERT STATEMENT: " + insertSql);
+        statement.execute(insertSql);
+      }
+
+      boolean hasResult = statement.execute("SELECT s1 FROM root.sg1.d1");
+      Assert.assertTrue(hasResult);
+
+      int cnt = 0;
+      ResultSet resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        Assert.assertEquals(resultData[cnt], resultSet.getString("root.sg1.d1.s1"));
+        cnt++;
+      }
+      Assert.assertEquals(insertData.length, cnt);
+
+      for (int i = 0; i < insertData.length; i++) {
+        String querySql = String.format("SELECT s1 FROM root.sg1.d1 WHERE s1 = %s", insertData[i]);
+        System.out.println("QUERY STATEMENT: " + querySql);
+        hasResult = statement.execute(querySql);
+        Assert.assertTrue(hasResult);
+
+        resultSet = statement.getResultSet();
+        Assert.assertTrue(resultSet.next());
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  /** Legal cases of using StringLiteral with double quote in insert and select clause. */
+  @Test
+  public void testStringLiteralWithDoubleQuote() {
+    String[] insertData = {
+      "\"string\"",
+      "\"`string`\"",
+      "\"``string\"",
+      "\"'string'\"",
+      "\"''string\"",
+      "\"\\'string\\'\"",
+      "\"\"\"string\"",
+      "\"\\\"string\"",
+      "\"\\nstring\"",
+      "\"\\rstring\"",
+      "\"@#$%^&*()string\"",
+    };
+
+    String[] resultData = {
+      "string",
+      "`string`",
+      "``string",
+      "'string'",
+      "''string",
+      "'string'",
+      "\"string",
+      "\"string",
+      "\nstring",
+      "\rstring",
+      "@#$%^&*()string",
+    };
+
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.sg1.d1.s1 TEXT");
+      for (int i = 0; i < insertData.length; i++) {
+        String insertSql =
+            String.format("INSERT INTO root.sg1.d1(time, s1) values (%d, %s)", i, insertData[i]);
+        System.out.println("INSERT STATEMENT: " + insertSql);
+        statement.execute(insertSql);
+      }
+
+      boolean hasResult = statement.execute("SELECT s1 FROM root.sg1.d1");
+      Assert.assertTrue(hasResult);
+
+      int cnt = 0;
+      ResultSet resultSet = statement.getResultSet();
+      while (resultSet.next()) {
+        Assert.assertEquals(resultData[cnt], resultSet.getString("root.sg1.d1.s1"));
+        cnt++;
+      }
+      Assert.assertEquals(insertData.length, cnt);
+
+      for (int i = 0; i < insertData.length; i++) {
+        String querySql = String.format("SELECT s1 FROM root.sg1.d1 WHERE s1 = %s", insertData[i]);
+        System.out.println("QUERY STATEMENT: " + querySql);
+        hasResult = statement.execute(querySql);
+        Assert.assertTrue(hasResult);
+
+        resultSet = statement.getResultSet();
+        Assert.assertTrue(resultSet.next());
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testStringLiteralIllegalCase() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:45 no viable alternative at input '(1, string'";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.sg1.d1.s1 TEXT");
+      // without ' or "
+      statement.execute("INSERT INTO root.sg1.d1(time, s1) values (1, string)");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testStringLiteralIllegalCase1() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:45 no viable alternative at input '(1, `string`'";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.sg1.d1.s1 TEXT");
+      // wrap STRING_LITERAL with ``
+      statement.execute("INSERT INTO root.sg1.d1(time, s1) values (1, `string`)");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testStringLiteralIllegalCase2() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:53 token recognition error at: '')'";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.sg1.d1.s1 TEXT");
+      // single ' in ''
+      statement.execute("INSERT INTO root.sg1.d1(time, s1) values (1, ''string')");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testStringLiteralIllegalCase3() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:53 token recognition error at: '\")'";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.sg1.d1.s1 TEXT");
+      // single " in ""
+      statement.execute("INSERT INTO root.sg1.d1(time, s1) values (1, \"\"string\")");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  /**
+   * LOAD/REMOVE/SETTLE use STRING_LITERAL to represent file path legal cases are in
+   * IoTDBLoadExternalTsfileIT
+   */
+  @Test
+  public void testFilePath() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("LOAD 'path'");
+      fail();
+    } catch (SQLException ignored) {
+    }
+  }
+
+  @Test
+  public void testFilePath1() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:5 no viable alternative at input 'LOAD path'";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("LOAD path");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testFilePath2() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("REMOVE 'path'");
+      fail();
+    } catch (SQLException ignored) {
+    }
+  }
+
+  @Test
+  public void testFilePath3() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:7 mismatched input 'path' expecting STRING_LITERAL";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("REMOVE path");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testFilePath4() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("SETTLE 'path'");
+      fail();
+    } catch (SQLException ignored) {
+    }
+  }
+
+  @Test
+  public void testFilePath5() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:7 mismatched input 'path' expecting {ROOT, STRING_LITERAL}";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("SETTLE path");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testUserPassword() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:17 mismatched input 'test' expecting STRING_LITERAL";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE USER test 'test'");
+      // password should be STRING_LITERAL
+      statement.execute("CREATE USER test test");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testUserPassword1() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:17 mismatched input '`test`' expecting STRING_LITERAL";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE USER test \"test\"");
+      // password should be STRING_LITERAL
+      statement.execute("CREATE USER test `test`");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testTriggerClassName() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:64 mismatched input 'org' expecting {AS, '.'}";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      // show
+      ResultSet resultSet = statement.executeQuery("show triggers");
+      assertFalse(resultSet.next());
+
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s1 FLOAT");
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s2 FLOAT");
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s3 FLOAT");
+      // create trigger, trigger class name should be STRING_LITERAL
+      statement.execute(
+          "create trigger trigger_1 before insert on root.vehicle.d1.s1 "
+              + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator'");
+      statement.execute(
+          "create trigger trigger_2 after insert on root.vehicle.d1.s2 "
+              + "as 'org.apache.iotdb.db.engine.trigger.example.Counter'");
+
+      // show
+      resultSet = statement.executeQuery("show triggers");
+      assertTrue(resultSet.next());
+      assertTrue(resultSet.next());
+      assertFalse(resultSet.next());
+
+      // show
+      resultSet = statement.executeQuery("show triggers");
+      assertTrue(resultSet.next());
+      assertTrue(resultSet.next());
+      assertFalse(resultSet.next());
+
+      statement.execute(
+          "create trigger trigger_1 before insert on root.vehicle.d1.s3 "
+              + "as org.apache.iotdb.db.engine.trigger.example.Accumulator");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testTriggerClassName1() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:64 mismatched input '`org.apache.iotdb.db.engine.trigger.example.Accumulator`' "
+            + "expecting {AS, '.'}";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s1 FLOAT");
+      statement.execute(
+          "create trigger trigger_1 before insert on root.vehicle.d1.s1 "
+              + "as `org.apache.iotdb.db.engine.trigger.example.Accumulator`");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testUDFClassName() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:23 mismatched input 'org' expecting STRING_LITERAL";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      // udf class name should be STRING_LITERAL
+      statement.execute("create function udf as 'org.apache.iotdb.db.query.udf.example.Adder'");
+
+      // executed correctly
+      ResultSet resultSet = statement.executeQuery("show functions");
+      assertEquals(3, resultSet.getMetaData().getColumnCount());
+      int count = 0;
+      while (resultSet.next()) {
+        StringBuilder stringBuilder = new StringBuilder();
+        for (int i = 1; i <= resultSet.getMetaData().getColumnCount(); ++i) {
+          stringBuilder.append(resultSet.getString(i)).append(",");
+        }
+        String result = stringBuilder.toString();
+        if (result.contains(FUNCTION_TYPE_NATIVE)) {
+          continue;
+        }
+        ++count;
+      }
+      Assert.assertEquals(1 + BuiltinFunction.values().length, count);
+      resultSet.close();
+      statement.execute("drop function udf");
+
+      // without '' or ""
+      statement.execute("create function udf as org.apache.iotdb.db.query.udf.example.Adder");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testUDFClassName1() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:23 mismatched input '`org.apache.iotdb.db.query.udf.example.Adder`' "
+            + "expecting STRING_LITERAL";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      // udf class name should be STRING_LITERAL
+      statement.execute("create function udf as `org.apache.iotdb.db.query.udf.example.Adder`");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  // attribute can be constant | identifier
+  @Test
+  public void testTriggerAttribute() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s1 FLOAT");
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s2 FLOAT");
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s3 FLOAT");
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s4 FLOAT");
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s5 FLOAT");
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s6 FLOAT");
+      // trigger attribute should be STRING_LITERAL
+      statement.execute(
+          "create trigger trigger_1 before insert on root.vehicle.d1.s1 "
+              + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator' with ('k1'='v1')");
+
+      statement.execute(
+          "create trigger trigger_2 before insert on root.vehicle.d1.s2 "
+              + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator' with (k1='v1')");
+
+      statement.execute(
+          "create trigger trigger_3 before insert on root.vehicle.d1.s3 "
+              + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator' with ('k1'=v1)");
+
+      statement.execute(
+          "create trigger trigger_4 before insert on root.vehicle.d1.s4 "
+              + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator' with (k1=v1)");
+
+      statement.execute(
+          "create trigger trigger_5 before insert on root.vehicle.d1.s5 "
+              + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator' with (`k1`=`v1`)");
+
+      statement.execute(
+          "create trigger trigger_6 before insert on root.vehicle.d1.s6 "
+              + "as 'org.apache.iotdb.db.engine.trigger.example.Accumulator' with (`k1`=v1)");
+
+      boolean hasResult = statement.execute("show triggers");
+      assertTrue(hasResult);
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testUDFAttribute() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.vehicle.d1.s1 FLOAT");
+      statement.execute("INSERT INTO root.vehicle.d1(time,s1) values (1,2.0),(2,3.0)");
+
+      ResultSet resultSet =
+          statement.executeQuery("select bottom_k(s1,'k' = '1') from root.vehicle.d1");
+      assertTrue(resultSet.next());
+      Assert.assertEquals("2.0", resultSet.getString(2));
+
+      resultSet = statement.executeQuery("select bottom_k(s1,k = 1) from root.vehicle.d1");
+      assertTrue(resultSet.next());
+      Assert.assertEquals("2.0", resultSet.getString(2));
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testUDFAttribute1() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:22 token recognition error at: '` = 1) from root.vehicle.d1'";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      // UDF attribute should be STRING_LITERAL
+      statement.executeQuery("select bottom_k(s1,``k` = 1) from root.vehicle.d1");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  @Test
+  public void testCreateTimeSeriesAttribute() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      // besides datatype,encoding,compression,compressor, attributes in create time series clause
+      // should be STRING_LITERAL
+      statement.execute(
+          "create timeseries root.vehicle.d1.s1 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s2 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY, max_point_number = 5");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s3 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY, 'max_point_number' = '5'");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s4 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY, max_point_number = '5'");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s5 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY, `max_point_number` = 5");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s6 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY, `max_point_number` = `5`");
+      ResultSet resultSet = statement.executeQuery("show timeseries");
+      int cnt = 0;
+      while (resultSet.next()) {
+        cnt++;
+      }
+      Assert.assertEquals(6, cnt);
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testCreateTimeSeriesTags() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute(
+          "create timeseries root.vehicle.d1.s1 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "tags(tag1=v1)");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s2 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "tags(`tag1`=v1)");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s3 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "tags('tag1'=v1)");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s4 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "tags(\"tag1\"=v1)");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s5 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "tags(tag1=`v1`)");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s6 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "tags(tag1='v1')");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s7 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "tags(tag1=\"v1\")");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s8 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "tags(tag1=v1)");
+      boolean hasResult = statement.execute("show timeseries");
+      Assert.assertTrue(hasResult);
+      ResultSet resultSet = statement.getResultSet();
+      int cnt = 0;
+      while (resultSet.next()) {
+        cnt++;
+      }
+      Assert.assertEquals(8, cnt);
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testCreateTimeSeriesAttributeClause() {
+
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute(
+          "create timeseries root.vehicle.d1.s1 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "attributes('attr1'='v1', 'attr2'='v2')");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s2 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "attributes(attr1=v1, attr2=v2)");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s3 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "attributes(`attr1`=`v1`, `attr2`=v2)");
+      statement.execute(
+          "create timeseries root.vehicle.d1.s4 "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY "
+              + "attributes('attr1'=v1, attr2=v2)");
+      ResultSet resultSet = statement.executeQuery("show timeseries");
+      int cnt = 0;
+      while (resultSet.next()) {
+        cnt++;
+      }
+      Assert.assertEquals(4, cnt);
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testPipeSinkAttribute() {
+    String errorMsg =
+        "401: Error occurred while parsing SQL to physical plan: "
+            + "line 1:40 token recognition error at: '` = '127.0.0.1')'";
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE PIPESINK `test.*1` AS IoTDB (``ip` = '127.0.0.1')");
+      fail();
+    } catch (SQLException e) {
+      Assert.assertEquals(errorMsg, e.getMessage());
+    }
+  }
+
+  // alias can be identifier or STRING_LITERAL
+  @Test
+  public void testAliasInResultColumn() {
+    String[] alias = {
+      "b", "test", "`test.1`", "`1``1`", "'test'", "\"test\"", "\"\\\\test\"",
+    };
+
+    String[] res = {
+      "b", "test", "test.1", "1`1", "test", "test", "\\test",
+    };
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute(
+          "create timeseries root.sg.a "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY ");
+      statement.execute("insert into root.sg(time, a) values (1,1)");
+
+      String selectSql = "select a as %s from root.sg";
+      for (int i = 0; i < alias.length; i++) {
+        boolean hasResult = statement.execute(String.format(selectSql, alias[i]));
+        assertTrue(hasResult);
+        ResultSet resultSet = statement.getResultSet();
+        Assert.assertEquals(res[i], resultSet.getMetaData().getColumnName(2));
+      }
+
+      try {
+        statement.execute("select a as test.b from root.sg");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+
+  @Test
+  public void testAliasInAlterClause() {
+    String[] alias = {
+      "b", "test", "`test.1`", "`1``1`", "'test'", "\"test\"", "\"\\\\test\"",
+    };
+
+    String[] res = {
+      "b", "test", "test.1", "1`1", "test", "test", "\\test",
+    };
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute(
+          "create timeseries root.sg.a "
+              + "with datatype=INT64, encoding=PLAIN, compression=SNAPPY ");
+
+      String alterSql = "ALTER timeseries root.sg.a UPSERT alias = %s";
+      for (int i = 0; i < alias.length; i++) {
+        statement.execute(String.format(alterSql, alias[i]));
+        statement.execute("show timeseries");
+        ResultSet resultSet = statement.getResultSet();
+        resultSet.next();
+        Assert.assertEquals(res[i], resultSet.getString("alias"));
+      }
+
+      try {
+        statement.execute("ALTER timeseries root.sg.a UPSERT alias = test.a");
+        fail();
+      } catch (Exception ignored) {
+      }
+
+    } catch (SQLException e) {
+      e.printStackTrace();
+      fail();
+    }
+  }
+}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTagAlterIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTagAlterIT.java
index e396b3deec..0132ea28ab 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTagAlterIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTagAlterIT.java
@@ -62,7 +62,8 @@ public class IoTDBTagAlterIT {
     };
     String sql =
         "create timeseries root.turbine.d1.s1(temperature) with datatype=FLOAT,"
-            + " encoding=RLE, compression=SNAPPY tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)";
+            + " encoding=RLE, compression=SNAPPY tags('tag1'='v1', 'tag2'='v2') "
+            + "attributes('attr1'='v1', 'attr2'='v2')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql);
@@ -97,7 +98,7 @@ public class IoTDBTagAlterIT {
       assertEquals(ret1.length, count);
 
       try {
-        statement.execute("ALTER timeseries root.turbine.d1.s1 RENAME tag3 TO tagNew3");
+        statement.execute("ALTER timeseries root.turbine.d1.s1 RENAME 'tag3' TO 'tagNew3'");
         fail();
       } catch (Exception e) {
         assertTrue(
@@ -106,7 +107,7 @@ public class IoTDBTagAlterIT {
       }
 
       try {
-        statement.execute("ALTER timeseries root.turbine.d1.s1 RENAME tag1 TO tag2");
+        statement.execute("ALTER timeseries root.turbine.d1.s1 RENAME 'tag1' TO 'tag2'");
         fail();
       } catch (Exception e) {
         assertTrue(
@@ -115,7 +116,7 @@ public class IoTDBTagAlterIT {
                     "TimeSeries [root.turbine.d1.s1] already has a tag/attribute named [tag2]."));
       }
 
-      statement.execute("ALTER timeseries root.turbine.d1.s1 RENAME tag1 TO tagNew1");
+      statement.execute("ALTER timeseries root.turbine.d1.s1 RENAME 'tag1' TO 'tagNew1'");
       hasResult = statement.execute("show timeseries");
       assertTrue(hasResult);
       resultSet = statement.getResultSet();
@@ -164,7 +165,7 @@ public class IoTDBTagAlterIT {
 
     String sql =
         "create timeseries root.turbine.d1.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)";
+            + "tags('tag1'='v1', 'tag2'='v2') attributes('attr1'='v1', 'attr2'='v2')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql);
@@ -199,7 +200,7 @@ public class IoTDBTagAlterIT {
       assertEquals(ret.length, count);
 
       try {
-        statement.execute("ALTER timeseries root.turbine.d1.s1 SET tag3=v3");
+        statement.execute("ALTER timeseries root.turbine.d1.s1 SET 'tag3'='v3'");
         fail();
       } catch (Exception e) {
         assertTrue(
@@ -207,7 +208,7 @@ public class IoTDBTagAlterIT {
                 .contains("TimeSeries [root.turbine.d1.s1] does not have tag/attribute [tag3]."));
       }
 
-      statement.execute("ALTER timeseries root.turbine.d1.s1 SET tag1=newV1, attr2=newV2");
+      statement.execute("ALTER timeseries root.turbine.d1.s1 SET 'tag1'='newV1', 'attr2'='newV2'");
       hasResult = statement.execute("show timeseries");
       assertTrue(hasResult);
       resultSet = statement.getResultSet();
@@ -255,7 +256,7 @@ public class IoTDBTagAlterIT {
 
     String sql =
         "create timeseries root.turbine.d1.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)";
+            + "tags('tag1'='v1', 'tag2'='v2') attributes('attr1'='v1', 'attr2'='v2')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql);
@@ -289,7 +290,7 @@ public class IoTDBTagAlterIT {
       }
       assertEquals(ret.length, count);
 
-      statement.execute("ALTER timeseries root.turbine.d1.s1 DROP attr1,tag1");
+      statement.execute("ALTER timeseries root.turbine.d1.s1 DROP 'attr1','tag1'");
       hasResult = statement.execute("show timeseries");
       assertTrue(hasResult);
       resultSet = statement.getResultSet();
@@ -320,7 +321,7 @@ public class IoTDBTagAlterIT {
       }
       assertEquals(ret2.length, count);
 
-      try (ResultSet rs = statement.executeQuery("show timeseries where tag1=v1")) {
+      try (ResultSet rs = statement.executeQuery("show timeseries where 'tag1'='v1'")) {
         assertFalse(rs.next());
       }
     } catch (Exception e) {
@@ -342,7 +343,7 @@ public class IoTDBTagAlterIT {
 
     String sql =
         "create timeseries root.turbine.d1.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)";
+            + "tags('tag1'='v1', 'tag2'='v2') attributes('attr1'='v1', 'attr2'='v2')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql);
@@ -376,8 +377,8 @@ public class IoTDBTagAlterIT {
       }
       assertEquals(ret.length, count);
 
-      statement.execute("ALTER timeseries root.turbine.d1.s1 ADD TAGS tag3=v3, tag4=v4");
-      hasResult = statement.execute("show timeseries where tag3=v3");
+      statement.execute("ALTER timeseries root.turbine.d1.s1 ADD TAGS 'tag3'='v3', 'tag4'='v4'");
+      hasResult = statement.execute("show timeseries where 'tag3'='v3'");
       assertTrue(hasResult);
       resultSet = statement.getResultSet();
       count = 0;
@@ -425,7 +426,7 @@ public class IoTDBTagAlterIT {
 
     String sql =
         "create timeseries root.turbine.d1.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)";
+            + "tags('tag1'='v1', 'tag2'='v2') attributes('attr1'='v1', 'attr2'='v2')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql);
@@ -459,7 +460,8 @@ public class IoTDBTagAlterIT {
       }
       assertEquals(ret.length, count);
 
-      statement.execute("ALTER timeseries root.turbine.d1.s1 ADD ATTRIBUTES attr3=v3, attr4=v4");
+      statement.execute(
+          "ALTER timeseries root.turbine.d1.s1 ADD ATTRIBUTES 'attr3'='v3', 'attr4'='v4'");
       hasResult = statement.execute("show timeseries");
       assertTrue(hasResult);
       resultSet = statement.getResultSet();
@@ -512,7 +514,7 @@ public class IoTDBTagAlterIT {
 
     String sql =
         "create timeseries root.turbine.d1.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)";
+            + "tags('tag1'='v1', 'tag2'='v2') attributes('attr1'='v1', 'attr2'='v2')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql);
@@ -546,8 +548,9 @@ public class IoTDBTagAlterIT {
       }
       assertEquals(ret.length, count);
 
-      statement.execute("ALTER timeseries root.turbine.d1.s1 UPSERT TAGS(tag3=v3, tag2=newV2)");
-      hasResult = statement.execute("show timeseries where tag3=v3");
+      statement.execute(
+          "ALTER timeseries root.turbine.d1.s1 UPSERT TAGS('tag3'='v3', 'tag2'='newV2')");
+      hasResult = statement.execute("show timeseries where 'tag3'='v3'");
       assertTrue(hasResult);
       resultSet = statement.getResultSet();
       count = 0;
@@ -578,8 +581,9 @@ public class IoTDBTagAlterIT {
       assertEquals(ret2.length, count);
 
       statement.execute(
-          "ALTER timeseries root.turbine.d1.s1 UPSERT TAGS(tag1=newV1, tag3=newV3) ATTRIBUTES(attr1=newA1, attr3=v3)");
-      hasResult = statement.execute("show timeseries where tag3=newV3");
+          "ALTER timeseries root.turbine.d1.s1 UPSERT TAGS('tag1'='newV1', 'tag3'='newV3') "
+              + "ATTRIBUTES('attr1'='newA1', 'attr3'='v3')");
+      hasResult = statement.execute("show timeseries where 'tag3'='newV3'");
       assertTrue(hasResult);
       resultSet = statement.getResultSet();
       count = 0;
@@ -606,7 +610,7 @@ public class IoTDBTagAlterIT {
         }
         assertEquals(ret3.length, count);
 
-        statement.execute("show timeseries where tag3=v3");
+        statement.execute("show timeseries where 'tag3'='v3'");
         resultSet = statement.getResultSet();
         assertFalse(resultSet.next());
       } finally {
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTagIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTagIT.java
index 47bf8b7202..7ff6f085ba 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTagIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBTagIT.java
@@ -63,7 +63,8 @@ public class IoTDBTagIT {
                 + "{\"tag1\":\"v1\",\"tag2\":\"v2\"},{\"attr2\":\"v2\",\"attr1\":\"v1\"}");
     String sql =
         "create timeseries root.turbine.d1.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)";
+            + "tags('tag1'='v1', 'tag2'='v2') "
+            + "attributes('attr1'='v1', 'attr2'='v2')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql);
@@ -112,10 +113,12 @@ public class IoTDBTagIT {
                 + "\"tag3\":\"t3\"},{\"attr4\":\"a4\",\"attr3\":\"a3\"}");
     String sql1 =
         "create timeseries root.turbine.d2.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=t1, tag2=t2) attributes(attr1=a1, attr2=a2)";
+            + "tags('tag1'='t1', 'tag2'='t2') "
+            + "attributes('attr1'='a1', 'attr2'='a2')";
     String sql2 =
         "create timeseries root.turbine.d2.s2(status) with datatype=INT32, encoding=RLE "
-            + "tags(tag2=t2, tag3=t3) attributes(attr3=a3, attr4=a4)";
+            + "tags('tag2'='t2', 'tag3'='t3') "
+            + "attributes('attr3'='a3', 'attr4'='a4')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql1);
@@ -166,10 +169,12 @@ public class IoTDBTagIT {
                 + ":\"t3\"},{\"attr4\":\"a4\",\"attr3\":\"a3\"}");
     String sql1 =
         "create timeseries root.turbine.d2.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=t1, tag2=t2) attributes(attr1=a1, attr2=a2)";
+            + "tags('tag1'='t1', 'tag2'='t2') "
+            + "attributes('attr1'='a1', 'attr2'='a2')";
     String sql2 =
         "create timeseries root.turbine.d2.s2(status) with datatype=INT32, encoding=RLE "
-            + "tags(tag2=t2, tag3=t3) attributes(attr3=a3, attr4=a4)";
+            + "tags('tag2'='t2', 'tag3'='t3') "
+            + "attributes('attr3'='a3', 'attr4'='a4')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql1);
@@ -213,10 +218,12 @@ public class IoTDBTagIT {
   public void createDuplicateAliasTimeseriesTest1() {
     String sql1 =
         "create timeseries root.turbine.d3.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=t1, tag2=t2) attributes(attr1=a1, attr2=a2)";
+            + "tags('tag1'='t1', 'tag2'='t2') "
+            + "attributes('attr1'='a1', 'attr2'='a2')";
     String sql2 =
         "create timeseries root.turbine.d3.s2(temperature) with datatype=INT32, encoding=RLE "
-            + "tags(tag2=t2, tag3=t3) attributes(attr3=a3, attr4=a4)";
+            + "tags('tag2'='t2', 'tag3'='t3') "
+            + "attributes('attr3'='a3', 'attr4'='a4')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql1);
@@ -238,10 +245,12 @@ public class IoTDBTagIT {
   public void createDuplicateAliasTimeseriesTest2() {
     String sql1 =
         "create timeseries root.turbine.d4.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=t1, tag2=t2) attributes(attr1=a1, attr2=a2)";
+            + "tags('tag1'='t1', 'tag2'='t2') "
+            + "attributes('attr1'='a1', 'attr2'='a2')";
     String sql2 =
         "create timeseries root.turbine.d4.temperature with datatype=INT32, encoding=RLE "
-            + "tags(tag2=t2, tag3=t3) attributes(attr3=a3, attr4=a4)";
+            + "tags('tag2'='t2', 'tag3'='t3') "
+            + "attributes('attr3'='a3', 'attr4'='a4')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql1);
@@ -261,10 +270,12 @@ public class IoTDBTagIT {
   public void createDuplicateAliasTimeseriesTest3() {
     String sql1 =
         "create timeseries root.turbine.d5.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=t1, tag2=t2) attributes(attr1=a1, attr2=a2)";
+            + "tags('tag1'='t1', 'tag2'='t2') "
+            + "attributes('attr1'='a1', 'attr2'='a2')";
     String sql2 =
         "create timeseries root.turbine.d5.s2(s1) with datatype=INT32, encoding=RLE "
-            + "tags(tag2=t2, tag3=t3) attributes(attr3=a3, attr4=a4)";
+            + "tags('tag2'='t2', 'tag3'='t3') "
+            + "attributes('attr3'='a3', 'attr4'='a4')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql1);
@@ -289,7 +300,8 @@ public class IoTDBTagIT {
                 + "{\"tag1\":\"v1\",\"tag2\":\"v2\"},{\"attr2\":\"v2\",\"attr1\":\"v1\"}");
     String sql =
         "create timeseries root.turbine.d6.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)";
+            + "tags('tag1'='v1', 'tag2'='v2') "
+            + "attributes('attr1'='v1', 'attr2'='v2')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql);
@@ -337,16 +349,19 @@ public class IoTDBTagIT {
         Statement statement = connection.createStatement()) {
       statement.execute(
           "create timeseries root.turbine.d1.s1(temperature1) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-              + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)");
+              + "tags('tag1'='v1', 'tag2'='v2') "
+              + "attributes('attr1'='v1', 'attr2'='v2')");
       statement.execute(
           "create timeseries root.turbine.d1.s2(temperature2) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-              + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)");
+              + "tags('tag1'='v1', 'tag2'='v2') "
+              + "attributes('attr1'='v1', 'attr2'='v2')");
       statement.execute(
           "create timeseries root.turbine.d1.s3(temperature3) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-              + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)");
-
+              + "tags('tag1'='v1', 'tag2'='v2') "
+              + "attributes('attr1'='v1', 'attr2'='v2')");
       boolean hasResult =
-          statement.execute("show timeseries root.turbine.d1.** where tag1=v1 limit 2 offset 1");
+          statement.execute(
+              "show timeseries root.turbine.d1.** where 'tag1'='v1' limit 2 offset 1");
       assertTrue(hasResult);
       int count = 0;
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -393,10 +408,12 @@ public class IoTDBTagIT {
 
     String sql1 =
         "create timeseries root.turbine.d7.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=t1, tag2=t2) attributes(attr1=a1, attr2=a2)";
+            + "tags('tag1'='t1', 'tag2'='t2') "
+            + "attributes('attr1'='a1', 'attr2'='a2')";
     String sql2 =
         "create timeseries root.turbine.d7.s2(status) with datatype=INT32, encoding=RLE "
-            + "tags(tag2=t2, tag3=t3) attributes(attr3=a3, attr4=a4)";
+            + "tags('tag2'='t2', 'tag3'='t3') "
+            + "attributes('attr3'='a3', 'attr4'='a4')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql1);
@@ -478,10 +495,12 @@ public class IoTDBTagIT {
 
     String sql1 =
         "create timeseries root.turbine.d7.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=t1, tag2=t2) attributes(attr1=a1, attr2=a2)";
+            + "tags('tag1'='t1', 'tag2'='t2') "
+            + "attributes('attr1'='a1', 'attr2'='a2')";
     String sql2 =
         "create timeseries root.turbine.d7.s2(status) with datatype=INT32, encoding=RLE "
-            + "tags(tag2=t2, tag3=t3) attributes(attr3=a3, attr4=a4)";
+            + "tags('tag2'='t2', 'tag3'='t3') "
+            + "attributes('attr3'='a3', 'attr4'='a4')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql1);
@@ -581,23 +600,32 @@ public class IoTDBTagIT {
 
     String[] sqls = {
       "create timeseries root.turbine.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='turbine this is a test1') attributes(H_Alarm=100, M_Alarm=50)",
+          + "tags('unit'='f', 'description'='turbine this is a test1') "
+          + "attributes('H_Alarm'='100', 'M_Alarm'='50')",
       "create timeseries root.turbine.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=kw, description='turbine this is a test2') attributes(H_Alarm=99.9, M_Alarm=44.4)",
+          + "tags('unit'='kw', 'description'='turbine this is a test2') "
+          + "attributes('H_Alarm'='99.9', 'M_Alarm'='44.4')",
       "create timeseries root.turbine.d1.s0(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='turbine this is a test3') attributes(H_Alarm=9, M_Alarm=5)",
+          + "tags('description'='turbine this is a test3') "
+          + "attributes('H_Alarm'='9', 'M_Alarm'='5')",
       "create timeseries root.turbine.d2.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='turbine d2 this is a test1') attributes(MaxValue=100, MinValue=1)",
+          + "tags('unit'='f', 'description'='turbine d2 this is a test1') "
+          + "attributes('MaxValue'='100', 'MinValue'='1')",
       "create timeseries root.turbine.d2.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=kw, description='turbine d2 this is a test2') attributes(MaxValue=99.9, MinValue=44.4)",
+          + "tags('unit'='kw', 'description'='turbine d2 this is a test2') "
+          + "attributes('MaxValue'='99.9', 'MinValue'='44.4')",
       "create timeseries root.turbine.d2.s3(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='turbine d2 this is a test3') attributes(MaxValue=9, MinValue=5)",
+          + "tags('description'='turbine d2 this is a test3') "
+          + "attributes('MaxValue'='9', 'MinValue'='5')",
       "create timeseries root.ln.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=c, description='ln this is a test1') attributes(H_Alarm=1000, M_Alarm=500)",
+          + "tags('unit'='c', 'description'='ln this is a test1') "
+          + "attributes('H_Alarm'='1000', 'M_Alarm'='500')",
       "create timeseries root.ln.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=w, description='ln this is a test2') attributes(H_Alarm=9.9, M_Alarm=4.4)",
+          + "tags('unit'='w', 'description'='ln this is a test2') "
+          + "attributes('H_Alarm'='9.9', 'M_Alarm'='4.4')",
       "create timeseries root.ln.d1.s0(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='ln this is a test3') attributes(H_Alarm=90, M_Alarm=50)",
+          + "tags('description'='ln this is a test3') "
+          + "attributes('H_Alarm'='90', 'M_Alarm'='50')",
     };
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
@@ -631,7 +659,7 @@ public class IoTDBTagIT {
         }
         assertEquals(ret1.size(), count);
       }
-      hasResult = statement.execute("show timeseries where unit=f");
+      hasResult = statement.execute("show timeseries where 'unit'='f'");
       assertTrue(hasResult);
       count = 0;
       Set<String> res = new HashSet<>();
@@ -677,23 +705,32 @@ public class IoTDBTagIT {
 
     String[] sqls = {
       "create timeseries root.turbine.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='turbine this is a test1') attributes(H_Alarm=100, M_Alarm=50)",
+          + "tags('unit'='f', 'description'='turbine this is a test1') "
+          + "attributes('H_Alarm'='100', 'M_Alarm'='50')",
       "create timeseries root.turbine.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=kw, description='turbine this is a test2') attributes(H_Alarm=99.9, M_Alarm=44.4)",
+          + "tags('unit'='kw', 'description'='turbine this is a test2') "
+          + "attributes('H_Alarm'='99.9', 'M_Alarm'='44.4')",
       "create timeseries root.turbine.d1.s0(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='turbine this is a test3') attributes(H_Alarm=9, M_Alarm=5)",
+          + "tags('description'='turbine this is a test3') "
+          + "attributes('H_Alarm'='9', 'M_Alarm'='5')",
       "create timeseries root.turbine.d2.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='turbine d2 this is a test1') attributes(MaxValue=100, MinValue=1)",
+          + "tags('unit'='f', 'description'='turbine d2 this is a test1') "
+          + "attributes('MaxValue'='100', 'MinValue'='1')",
       "create timeseries root.turbine.d2.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=kw, description='turbine d2 this is a test2') attributes(MaxValue=99.9, MinValue=44.4)",
+          + "tags('unit'='kw', 'description'='turbine d2 this is a test2') "
+          + "attributes('MaxValue'='99.9', 'MinValue'='44.4')",
       "create timeseries root.turbine.d2.s3(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='turbine d2 this is a test3') attributes(MaxValue=9, MinValue=5)",
+          + "tags('description'='turbine d2 this is a test3') "
+          + "attributes('MaxValue'='9', 'MinValue'='5')",
       "create timeseries root.ln.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='ln this is a test1') attributes(H_Alarm=1000, M_Alarm=500)",
+          + "tags('unit'='f', 'description'='ln this is a test1') "
+          + "attributes('H_Alarm'='1000', 'M_Alarm'='500')",
       "create timeseries root.ln.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=w, description='ln this is a test2') attributes(H_Alarm=9.9, M_Alarm=4.4)",
+          + "tags('unit'='w', 'description'='ln this is a test2') "
+          + "attributes('H_Alarm'='9.9', 'M_Alarm'='4.4')",
       "create timeseries root.ln.d1.s0(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='ln this is a test3') attributes(H_Alarm=90, M_Alarm=50)",
+          + "tags('description'='ln this is a test3') "
+          + "attributes('H_Alarm'='90', 'M_Alarm'='50')",
     };
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
@@ -702,7 +739,7 @@ public class IoTDBTagIT {
       }
 
       // with *
-      boolean hasResult = statement.execute("show timeseries root.turbine.** where unit=f");
+      boolean hasResult = statement.execute("show timeseries root.turbine.** where 'unit'='f'");
       assertTrue(hasResult);
       int count = 0;
       Set<String> res = new HashSet<>();
@@ -733,7 +770,7 @@ public class IoTDBTagIT {
       assertEquals(ret.size(), count);
 
       // no *
-      hasResult = statement.execute("show timeseries root.turbine.** where unit=f");
+      hasResult = statement.execute("show timeseries root.turbine.** where 'unit'='f'");
       assertTrue(hasResult);
       count = 0;
       res.clear();
@@ -763,7 +800,7 @@ public class IoTDBTagIT {
         assertEquals(ret.size(), count);
       }
 
-      statement.execute("show timeseries root.turbine where unit=c");
+      statement.execute("show timeseries root.turbine where 'unit'='c'");
       count = 0;
       try (ResultSet resultSet = statement.getResultSet()) {
         while (resultSet.next()) {
@@ -790,23 +827,32 @@ public class IoTDBTagIT {
 
     String[] sqls = {
       "create timeseries root.turbine.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='turbine this is a test1') attributes(H_Alarm=100, M_Alarm=50)",
+          + "tags('unit'='f', 'description'='turbine this is a test1') "
+          + "attributes('H_Alarm'='100', 'M_Alarm'='50')",
       "create timeseries root.turbine.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=kw, description='turbine this is a test2') attributes(H_Alarm=99.9, M_Alarm=44.4)",
+          + "tags('unit'='kw', 'description'='turbine this is a test2') "
+          + "attributes('H_Alarm'='99.9', 'M_Alarm'='44.4')",
       "create timeseries root.turbine.d1.s0(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='turbine this is a test3') attributes(H_Alarm=9, M_Alarm=5)",
+          + "tags('description'='turbine this is a test3') "
+          + "attributes('H_Alarm'='9', 'M_Alarm'='5')",
       "create timeseries root.turbine.d2.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='turbine d2 this is a test1') attributes(MaxValue=100, MinValue=1)",
+          + "tags('unit'='f', 'description'='turbine d2 this is a test1') "
+          + "attributes('MaxValue'='100', 'MinValue'='1')",
       "create timeseries root.turbine.d2.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=kw, description='turbine d2 this is a test2') attributes(MaxValue=99.9, MinValue=44.4)",
+          + "tags('unit'='kw', 'description'='turbine d2 this is a test2') "
+          + "attributes('MaxValue'='99.9', 'MinValue'='44.4')",
       "create timeseries root.turbine.d2.s3(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='turbine d2 this is a test3') attributes(MaxValue=9, MinValue=5)",
+          + "tags('description'='turbine d2 this is a test3') "
+          + "attributes('MaxValue'='9', 'MinValue'='5')",
       "create timeseries root.ln.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='ln this is a test1') attributes(H_Alarm=1000, M_Alarm=500)",
+          + "tags('unit'='f', 'description'='ln this is a test1') "
+          + "attributes('H_Alarm'='1000', 'M_Alarm'='500')",
       "create timeseries root.ln.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=w, description='ln this is a test2') attributes(H_Alarm=9.9, M_Alarm=4.4)",
+          + "tags('unit'='w', 'description'='ln this is a test2') "
+          + "attributes('H_Alarm'='9.9', 'M_Alarm'='4.4')",
       "create timeseries root.ln.d1.s0(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='ln this is a test3') attributes(H_Alarm=90, M_Alarm=50)",
+          + "tags('description'='ln this is a test3') "
+          + "attributes('H_Alarm'='90', 'M_Alarm'='50')",
     };
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
@@ -817,7 +863,7 @@ public class IoTDBTagIT {
       statement.execute("delete timeseries root.turbine.d2.s0");
 
       // with *
-      boolean hasResult = statement.execute("show timeseries where unit=f");
+      boolean hasResult = statement.execute("show timeseries where 'unit'='f'");
       assertTrue(hasResult);
       int count = 0;
       Set<String> res = new HashSet<>();
@@ -873,23 +919,32 @@ public class IoTDBTagIT {
 
     String[] sqls = {
       "create timeseries root.turbine.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='turbine this is a test1') attributes(H_Alarm=100, M_Alarm=50)",
+          + "tags('unit'='f', 'description'='turbine this is a test1') "
+          + "attributes('H_Alarm'='100', 'M_Alarm'='50')",
       "create timeseries root.turbine.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=kw, description='turbine this is a test2') attributes(H_Alarm=99.9, M_Alarm=44.4)",
+          + "tags('unit'='kw', 'description'='turbine this is a test2') "
+          + "attributes('H_Alarm'='99.9', 'M_Alarm'='44.4')",
       "create timeseries root.turbine.d1.s0(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='turbine this is a test3') attributes(H_Alarm=9, M_Alarm=5)",
+          + "tags('description'='turbine this is a test3') "
+          + "attributes('H_Alarm'='9', 'M_Alarm'='5')",
       "create timeseries root.turbine.d2.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='turbine d2 this is a test1') attributes(MaxValue=100, MinValue=1)",
+          + "tags('unit'='f', 'description'='turbine d2 this is a test1') "
+          + "attributes('MaxValue'='100', 'MinValue'='1')",
       "create timeseries root.turbine.d2.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=kw, description='turbine d2 this is a test2') attributes(MaxValue=99.9, MinValue=44.4)",
+          + "tags('unit'='kw', 'description'='turbine d2 this is a test2') "
+          + "attributes('MaxValue'='99.9', 'MinValue'='44.4')",
       "create timeseries root.turbine.d2.s3(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='turbine d2 this is a test3') attributes(MaxValue=9, MinValue=5)",
+          + "tags('description'='turbine d2 this is a test3') "
+          + "attributes('MaxValue'='9', 'MinValue'='5')",
       "create timeseries root.ln.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='ln this is a test1') attributes(H_Alarm=1000, M_Alarm=500)",
+          + "tags('unit'='f', 'description'='ln this is a test1') "
+          + "attributes('H_Alarm'='1000', 'M_Alarm'='500')",
       "create timeseries root.ln.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=w, description='ln this is a test2') attributes(H_Alarm=9.9, M_Alarm=4.4)",
+          + "tags('unit'='w', 'description'='ln this is a test2') "
+          + "attributes('H_Alarm'='9.9', 'M_Alarm'='4.4')",
       "create timeseries root.ln.d1.s0(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='ln this is a test3') attributes(H_Alarm=90, M_Alarm=50)",
+          + "tags('description'='ln this is a test3') "
+          + "attributes('H_Alarm'='90', 'M_Alarm'='50')",
     };
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
@@ -897,7 +952,7 @@ public class IoTDBTagIT {
         statement.execute(sql);
       }
 
-      boolean hasResult = statement.execute("show timeseries where description contains 'test1'");
+      boolean hasResult = statement.execute("show timeseries where 'description' contains 'test1'");
       assertTrue(hasResult);
       int count = 0;
       Set<String> res = new HashSet<>();
@@ -929,7 +984,7 @@ public class IoTDBTagIT {
       assertEquals(ret.size(), count);
 
       hasResult =
-          statement.execute("show timeseries root.ln.** where description contains 'test1'");
+          statement.execute("show timeseries root.ln.** where 'description' contains 'test1'");
       assertTrue(hasResult);
       count = 0;
       res.clear();
@@ -969,23 +1024,32 @@ public class IoTDBTagIT {
   public void queryWithWhereOnNoneTagTest() {
     String[] sqls = {
       "create timeseries root.turbine.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='turbine this is a test1') attributes(H_Alarm=100, M_Alarm=50)",
+          + "tags('unit'='f', 'description'='turbine this is a test1') "
+          + "attributes('H_Alarm'='100', 'M_Alarm'='50')",
       "create timeseries root.turbine.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=kw, description='turbine this is a test2') attributes(H_Alarm=99.9, M_Alarm=44.4)",
+          + "tags('unit'='kw', 'description'='turbine this is a test2') "
+          + "attributes('H_Alarm'='99.9', 'M_Alarm'='44.4')",
       "create timeseries root.turbine.d1.s0(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='turbine this is a test3') attributes(H_Alarm=9, M_Alarm=5)",
+          + "tags('description'='turbine this is a test3') "
+          + "attributes('H_Alarm'='9', 'M_Alarm'='5')",
       "create timeseries root.turbine.d2.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='turbine d2 this is a test1') attributes(MaxValue=100, MinValue=1)",
+          + "tags('unit'='f', 'description'='turbine d2 this is a test1') "
+          + "attributes('MaxValue'='100', 'MinValue'='1')",
       "create timeseries root.turbine.d2.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=kw, description='turbine d2 this is a test2') attributes(MaxValue=99.9, MinValue=44.4)",
+          + "tags('unit'='kw', 'description'='turbine d2 this is a test2') "
+          + "attributes('MaxValue'='99.9', 'MinValue'='44.4')",
       "create timeseries root.turbine.d2.s3(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='turbine d2 this is a test3') attributes(MaxValue=9, MinValue=5)",
+          + "tags('description'='turbine d2 this is a test3') "
+          + "attributes('MaxValue'='9', 'MinValue'='5')",
       "create timeseries root.ln.d0.s0(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=f, description='ln this is a test1') attributes(H_Alarm=1000, M_Alarm=500)",
+          + "tags('unit'='c', 'description'='ln this is a test1') "
+          + "attributes('H_Alarm'='1000', 'M_Alarm'='500')",
       "create timeseries root.ln.d0.s1(power) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-          + "tags(unit=w, description='ln this is a test2') attributes(H_Alarm=9.9, M_Alarm=4.4)",
+          + "tags('unit'='w', 'description'='ln this is a test2') "
+          + "attributes('H_Alarm'='9.9', 'M_Alarm'='4.4')",
       "create timeseries root.ln.d1.s0(status) with datatype=INT32, encoding=RLE "
-          + "tags(description='ln this is a test3') attributes(H_Alarm=90, M_Alarm=50)",
+          + "tags('description'='ln this is a test3') "
+          + "attributes('H_Alarm'='90', 'M_Alarm'='50')",
     };
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
@@ -993,7 +1057,7 @@ public class IoTDBTagIT {
         statement.execute(sql);
       }
 
-      try (ResultSet rs = statement.executeQuery("show timeseries where H_Alarm=90")) {
+      try (ResultSet rs = statement.executeQuery("show timeseries where 'H_Alarm'='90'")) {
         assertFalse(rs.next());
       }
     } catch (Exception e) {
@@ -1006,7 +1070,8 @@ public class IoTDBTagIT {
   public void sameNameTest() {
     String sql =
         "create timeseries root.turbine.d1.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=v1, tag2=v2) attributes(tag1=v1, attr2=v2)";
+            + "tags('tag1'='v1', 'tag2'='v2') "
+            + "attributes('tag1'='v1', 'attr2'='v2')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql);
@@ -1025,7 +1090,8 @@ public class IoTDBTagIT {
 
     String sql =
         "create timeseries root.turbine.d1.s1(temperature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY "
-            + "tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)";
+            + "tags('tag1'='v1', 'tag2'='v2') "
+            + "attributes('attr1'='v1', 'attr2'='v2')";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(sql);
@@ -1057,7 +1123,7 @@ public class IoTDBTagIT {
       assertEquals(ret.size(), count);
 
       statement.execute("delete storage group root.turbine");
-      try (ResultSet rs = statement.executeQuery("show timeseries where tag1=v1")) {
+      try (ResultSet rs = statement.executeQuery("show timeseries where 'tag1'='v1'")) {
         assertFalse(rs.next());
       }
     } catch (Exception e) {
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFBuiltinFunctionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFBuiltinFunctionIT.java
index bf75cdc5f0..b6349c914f 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFBuiltinFunctionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/IoTDBUDTFBuiltinFunctionIT.java
@@ -767,4 +767,142 @@ public class IoTDBUDTFBuiltinFunctionIT {
       e.printStackTrace();
     }
   }
+
+  @Test
+  public void testEqualBucketSampleForOutlier() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE TIMESERIES root.sg.d6.s1 with datatype=INT32,encoding=PLAIN");
+      statement.execute("CREATE TIMESERIES root.sg.d6.s2 with datatype=INT64,encoding=PLAIN");
+      statement.execute("CREATE TIMESERIES root.sg.d6.s3 with datatype=DOUBLE,encoding=PLAIN");
+      statement.execute("CREATE TIMESERIES root.sg.d6.s4 with datatype=FLOAT,encoding=PLAIN");
+      statement.execute("CREATE TIMESERIES root.sg.d6.s5 with datatype=FLOAT,encoding=PLAIN");
+    } catch (SQLException throwable) {
+      fail(throwable.getMessage());
+    }
+    String[] SQL_FOR_SAMPLE_S1 = new String[100];
+    String[] SQL_FOR_SAMPLE_S2 = new String[100];
+    String[] SQL_FOR_SAMPLE_S3 = new String[100];
+    String[] SQL_FOR_SAMPLE_S4 = new String[100];
+    String[] SQL_FOR_SAMPLE_S5 = new String[20];
+    for (int i = 0; i < 100; i++) {
+      SQL_FOR_SAMPLE_S1[i] =
+          String.format(
+              "insert into root.sg.d6(time, s1) values (%d, %d)",
+              i, i % 5 == 0 && i % 10 != 0 ? i + 100 : i);
+      SQL_FOR_SAMPLE_S2[i] =
+          String.format(
+              "insert into root.sg.d6(time, s2) values (%d, %d)", i, i % 10 == 6 ? i + 100 : i);
+      if (i % 10 == 9 || i % 20 == 0) {
+        SQL_FOR_SAMPLE_S2[i] = String.format("insert into root.sg.d6(time, s2) values (%d, 0)", i);
+      }
+      SQL_FOR_SAMPLE_S3[i] =
+          String.format(
+              "insert into root.sg.d6(time, s3) values (%d, %d)", i, i % 10 == 7 ? i + 100 : i);
+      SQL_FOR_SAMPLE_S4[i] =
+          String.format(
+              "insert into root.sg.d6(time, s4) values (%d, %d)", i, i % 10 == 8 ? i + 100 : i);
+    }
+    for (int i = 0; i < 20; i++) {
+      SQL_FOR_SAMPLE_S5[i] =
+          String.format("insert into root.sg.d6(time, s5) values (%d, %d)", i, i);
+    }
+    int[] ANSWER1 = new int[] {105, 115, 125, 135, 145, 155, 165, 175, 185, 195};
+    long[] ANSWER2 = new long[] {106, 116, 126, 136, 146, 156, 166, 176, 186, 196};
+    double[] ANSWER3 = new double[] {107, 117, 127, 137, 147, 157, 167, 177, 187, 197};
+    float[] ANSWER4 = new float[] {108, 118, 128, 138, 148, 158, 168, 178, 188, 198};
+    float[] ANSWER5 = new float[] {0, 2, 4, 6, 8, 10, 12, 14, 16, 18};
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      for (int i = 0; i < 100; i++) {
+        statement.execute(SQL_FOR_SAMPLE_S1[i]);
+        statement.execute(SQL_FOR_SAMPLE_S2[i]);
+        statement.execute(SQL_FOR_SAMPLE_S3[i]);
+        statement.execute(SQL_FOR_SAMPLE_S4[i]);
+      }
+      for (int i = 0; i < 20; i++) {
+        statement.execute(SQL_FOR_SAMPLE_S5[i]);
+      }
+    } catch (SQLException throwable) {
+      fail(throwable.getMessage());
+    }
+
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      String functionName = "EQUAL_SIZE_BUCKET_OUTLIER_SAMPLE";
+      double proportionValue = 0.1;
+
+      ResultSet resultSet0 =
+          statement.executeQuery(
+              String.format(
+                  "select "
+                      + "%s(s1, 'proportion'='%f', 'type'='%s', 'number'='%d') "
+                      + "from root.sg.d6",
+                  functionName, proportionValue, "avg", 2));
+      int columnCount0 = resultSet0.getMetaData().getColumnCount();
+      assertEquals(1 + 1, columnCount0);
+      for (int i = 0; i < 10; i++) {
+        resultSet0.next();
+        assertEquals(ANSWER1[i], resultSet0.getInt(2));
+      }
+
+      ResultSet resultSet1 =
+          statement.executeQuery(
+              String.format(
+                  "select "
+                      + "%s(s2, 'proportion'='%f', 'type'='%s', 'number'='%d') "
+                      + "from root.sg.d6",
+                  functionName, proportionValue, "stendis", 2));
+      int columnCount1 = resultSet1.getMetaData().getColumnCount();
+      assertEquals(1 + 1, columnCount1);
+      for (int i = 0; i < 10; i++) {
+        resultSet1.next();
+        assertEquals(ANSWER2[i], resultSet1.getLong(2));
+      }
+
+      ResultSet resultSet2 =
+          statement.executeQuery(
+              String.format(
+                  "select "
+                      + "%s(s3, 'proportion'='%f', 'type'='%s', 'number'='%d') "
+                      + "from root.sg.d6",
+                  functionName, proportionValue, "cos", 2));
+      int columnCount2 = resultSet2.getMetaData().getColumnCount();
+      assertEquals(1 + 1, columnCount2);
+      for (int i = 0; i < 10; i++) {
+        resultSet2.next();
+        assertEquals(ANSWER3[i], resultSet2.getDouble(2), 0.01);
+      }
+
+      ResultSet resultSet3 =
+          statement.executeQuery(
+              String.format(
+                  "select "
+                      + "%s(s4, 'proportion'='%f', 'type'='%s', 'number'='%d') "
+                      + "from root.sg.d6",
+                  functionName, proportionValue, "prenextdis", 2));
+      int columnCount3 = resultSet3.getMetaData().getColumnCount();
+      assertEquals(1 + 1, columnCount3);
+      for (int i = 0; i < 10; i++) {
+        resultSet3.next();
+        assertEquals(ANSWER4[i], resultSet3.getFloat(2), 0.01);
+      }
+
+      ResultSet resultSet4 =
+          statement.executeQuery(
+              String.format(
+                  "select "
+                      + "%s(s5, 'proportion'='%f', 'type'='%s', 'number'='%d') "
+                      + "from root.sg.d6",
+                  functionName, 0.5, "cos", 1));
+      int columnCount4 = resultSet4.getMetaData().getColumnCount();
+      assertEquals(1 + 1, columnCount4);
+      for (int i = 0; i < 10; i++) {
+        resultSet4.next();
+        assertEquals(ANSWER5[i], resultSet4.getFloat(2), 0.01);
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
 }
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationIT.java
index f3bd89cd8b..bb2c8a7124 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationIT.java
@@ -198,6 +198,11 @@ public class IoTDBAggregationIT {
         Assert.assertEquals(3, cnt);
       }
 
+      try {
+        statement.execute("SELECT max(root.temperature) from root.ln.wf01.wt01");
+        fail();
+      } catch (Exception ignored) {
+      }
     } catch (Exception e) {
       e.printStackTrace();
       fail(e.getMessage());
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/aligned/IoTDBDeletionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/aligned/IoTDBDeletionIT.java
index 2cc07160ee..c22071994d 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/aligned/IoTDBDeletionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/aligned/IoTDBDeletionIT.java
@@ -384,11 +384,11 @@ public class IoTDBDeletionIT {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute(
-          "CREATE TIMESERIES root.ln.d1.\"status,01\" WITH DATATYPE=BOOLEAN, ENCODING=PLAIN");
-      statement.execute("INSERT INTO root.ln.d1(timestamp,\"status,01\") VALUES(300, true)");
-      statement.execute("INSERT INTO root.ln.d1(timestamp,\"status,01\") VALUES(500, false)");
+          "CREATE TIMESERIES root.ln.d1.`status,01` WITH DATATYPE=BOOLEAN, ENCODING=PLAIN");
+      statement.execute("INSERT INTO root.ln.d1(timestamp,`status,01`) VALUES(300, true)");
+      statement.execute("INSERT INTO root.ln.d1(timestamp,`status,01`) VALUES(500, false)");
 
-      try (ResultSet resultSet = statement.executeQuery("select `\"status,01\"` from root.ln.d1")) {
+      try (ResultSet resultSet = statement.executeQuery("select `status,01` from root.ln.d1")) {
         int cnt = 0;
         while (resultSet.next()) {
           cnt++;
@@ -396,9 +396,9 @@ public class IoTDBDeletionIT {
         Assert.assertEquals(2, cnt);
       }
 
-      statement.execute("DELETE FROM root.ln.d1.\"status,01\" WHERE time <= 400");
+      statement.execute("DELETE FROM root.ln.d1.`status,01` WHERE time <= 400");
 
-      try (ResultSet resultSet = statement.executeQuery("select `\"status,01\"` from root.ln.d1")) {
+      try (ResultSet resultSet = statement.executeQuery("select `status,01` from root.ln.d1")) {
         int cnt = 0;
         while (resultSet.next()) {
           cnt++;
@@ -406,9 +406,9 @@ public class IoTDBDeletionIT {
         Assert.assertEquals(1, cnt);
       }
 
-      statement.execute("DELETE FROM root.ln.d1.\"status,01\"");
+      statement.execute("DELETE FROM root.ln.d1.`status,01`");
 
-      try (ResultSet resultSet = statement.executeQuery("select `\"status,01\"` from root.ln.d1")) {
+      try (ResultSet resultSet = statement.executeQuery("select `status,01` from root.ln.d1")) {
         int cnt = 0;
         while (resultSet.next()) {
           cnt++;
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncSenderIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncSenderIT.java
index cacf6c6f57..b746793fdb 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncSenderIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/sync/IoTDBSyncSenderIT.java
@@ -186,6 +186,19 @@ public class IoTDBSyncSenderIT {
         Arrays.asList(simpleTsFilePipeData, simpleTsFilePipeData)); // del3 do not in history
   }
 
+  private void prepareIns4() throws Exception { // ins unsealed tsfile
+    try (Connection connection =
+            DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
+        Statement statement = connection.createStatement()) {
+      statement.execute(
+          "insert into root.sg1.d1(timestamp, s1, s2, s3) values(300, 300, 316.25, 'i')");
+      statement.execute(
+          "insert into root.sg1.d1(timestamp, s1, s2, s3) values(165, 165, 165.25, 'j')");
+    }
+
+    resultMap.put("ins4", Arrays.asList(simpleTsFilePipeData, simpleTsFilePipeData));
+  }
+
   private void prepareDel1() throws Exception { // after ins1, add 2 deletions
     try (Connection connection =
             DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
@@ -239,7 +252,9 @@ public class IoTDBSyncSenderIT {
   }
 
   private void restart() throws Exception {
-    EnvironmentUtils.restartDaemon();
+    //    EnvironmentUtils.restartDaemon();
+    EnvironmentUtils.shutdownDaemon();
+    EnvironmentUtils.reactiveDaemon();
   }
 
   private void startPipe() throws Exception {
@@ -564,4 +579,43 @@ public class IoTDBSyncSenderIT {
       }
     }
   }
+
+  @Test
+  public void testRestartWithUnsealedTsFile() {
+    try {
+      prepareSchema(); // history
+      prepareIns1();
+      prepareIns2();
+      prepareDel1();
+
+      preparePipeAndSetMock(); // realtime
+      startPipe();
+      stopPipe();
+      prepareDel2();
+      restart();
+      startPipe();
+      prepareIns3();
+      stopPipe();
+      prepareDel3();
+      prepareIns4();
+      startPipe();
+      restart();
+
+      Thread.sleep(1000L); // check
+      checkResult(
+          Arrays.asList("schema", "ins1", "ins2", "del2WithoutIns3", "ins3", "del3", "ins4"),
+          transportClient.getPipeDataList());
+    } catch (Exception e) {
+      e.printStackTrace();
+      Assert.fail();
+    } finally {
+      try {
+        dropPipe();
+        Thread.sleep(1000L);
+      } catch (Exception e) {
+        e.printStackTrace();
+        Assert.fail();
+      }
+    }
+  }
 }
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBDDLVersionAdaptionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBDDLVersionAdaptionIT.java
index 4ca6f7a200..cf45460cc8 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBDDLVersionAdaptionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBDDLVersionAdaptionIT.java
@@ -64,14 +64,14 @@ public class IoTDBDDLVersionAdaptionIT {
             "SET STORAGE GROUP TO root.ln2.wf01.wt01",
             "CREATE TIMESERIES root.ln.wf01.wt01.status WITH DATATYPE = BOOLEAN, ENCODING = PLAIN",
             "CREATE TIMESERIES root.ln.wf01.wt01.temperature WITH DATATYPE = FLOAT, ENCODING = RLE, "
-                + "compressor = SNAPPY, MAX_POINT_NUMBER = 3",
+                + "compressor = SNAPPY, 'MAX_POINT_NUMBER' = '3'",
             "CREATE ALIGNED TIMESERIES root.ln.wf01.wt02(s1 INT32, s2 DOUBLE)",
             "CREATE TIMESERIES root.ln1.wf01.wt01.status WITH DATATYPE = BOOLEAN, ENCODING = PLAIN",
             "CREATE TIMESERIES root.ln1.wf01.wt01.temperature WITH DATATYPE = FLOAT, ENCODING = RLE, "
-                + "compressor = SNAPPY, MAX_POINT_NUMBER = 3",
+                + "compressor = SNAPPY, 'MAX_POINT_NUMBER' = '3'",
             "CREATE TIMESERIES root.ln2.wf01.wt01.status WITH DATATYPE = BOOLEAN, ENCODING = PLAIN",
             "CREATE TIMESERIES root.ln2.wf01.wt01.temperature WITH DATATYPE = FLOAT, ENCODING = RLE, "
-                + "compressor = SNAPPY, MAX_POINT_NUMBER = 3"
+                + "compressor = SNAPPY, 'MAX_POINT_NUMBER' = '3'"
           };
 
       for (String sql : insertSqls) {
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBSyntaxConventionVersionAdaptionIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBSyntaxConventionVersionAdaptionIT.java
deleted file mode 100644
index e514d11d61..0000000000
--- a/integration/src/test/java/org/apache/iotdb/db/integration/versionadaption/IoTDBSyntaxConventionVersionAdaptionIT.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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.db.integration.versionadaption;
-
-import org.apache.iotdb.integration.env.EnvFactory;
-import org.apache.iotdb.itbase.category.ClusterTest;
-import org.apache.iotdb.itbase.category.LocalStandaloneTest;
-import org.apache.iotdb.itbase.category.RemoteTest;
-import org.apache.iotdb.jdbc.Constant;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import static org.junit.Assert.fail;
-
-@Category({LocalStandaloneTest.class, ClusterTest.class, RemoteTest.class})
-public class IoTDBSyntaxConventionVersionAdaptionIT {
-
-  @Before
-  public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-  }
-
-  @Test
-  public void testExpression1() {
-    try (Connection connection = EnvFactory.getEnv().getConnection(Constant.Version.V_0_12);
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.1 with datatype = INT32");
-      boolean hasResult = statement.execute("SELECT 1 FROM root.sg1.d1");
-      Assert.assertTrue(hasResult);
-
-      ResultSet resultSet = statement.getResultSet();
-      Assert.assertFalse(resultSet.next());
-    } catch (SQLException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  @Test
-  public void testExpression2() {
-    try (Connection connection = EnvFactory.getEnv().getConnection(Constant.Version.V_0_12);
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.1 with datatype = INT64");
-      boolean hasResult = statement.execute("SELECT sin(1) FROM root.sg1.d1");
-      Assert.assertTrue(hasResult);
-
-      ResultSet resultSet = statement.getResultSet();
-      Assert.assertFalse(resultSet.next());
-    } catch (SQLException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  @Test
-  public void testExpression3() {
-    try (Connection connection = EnvFactory.getEnv().getConnection(Constant.Version.V_0_12);
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE TIMESERIES root.sg1.d1.\"a\" with datatype = INT64");
-      boolean hasResult = statement.execute("SELECT \"a\" FROM root.sg1.d1");
-      Assert.assertTrue(hasResult);
-
-      ResultSet resultSet = statement.getResultSet();
-      Assert.assertFalse(resultSet.next());
-    } catch (SQLException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-}
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/withoutNullFilter/IoTDBWithoutNullAllFilterIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/withoutNullFilter/IoTDBWithoutNullAllFilterIT.java
index 670c5353d6..df0c2d2b81 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/withoutNullFilter/IoTDBWithoutNullAllFilterIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/withoutNullFilter/IoTDBWithoutNullAllFilterIT.java
@@ -1253,9 +1253,9 @@ public class IoTDBWithoutNullAllFilterIT {
 
   @Test
   public void withoutNullColumnsIsFullPathQueryTest() {
-    // select s2, s3 from root.test.** without null all(`root.test.sg1.s2`, `root.test.sg2.s3`)
-    // select s2, s3 from root.test.sg1, root.test.sg2 without null all(`root.test.sg1.s2`)
-    // select s2, s3 from root.test.sg1, root.test.sg2 without null all(`root.test.sg1.s2`, s3)
+    // select s2, s3 from root.test.** without null all(root.test.sg1.s2, root.test.sg2.s3)
+    // select s2, s3 from root.test.sg1, root.test.sg2 without null all(root.test.sg1.s2)
+    // select s2, s3 from root.test.sg1, root.test.sg2 without null all(root.test.sg1.s2, s3)
     System.out.println("withoutNullColumnsIsFullPathQueryTest");
     String[] retArray1 =
         new String[] {
@@ -1305,7 +1305,7 @@ public class IoTDBWithoutNullAllFilterIT {
         Statement statement = connection.createStatement()) {
       boolean hasResultSet =
           statement.execute(
-              "select s2, s3 from root.test.** without null all(`root.test.sg1.s2`, `root.test.sg2.s3`)");
+              "select s2, s3 from root.test.** without null all(root.test.sg1.s2, root.test.sg2.s3)");
       String[] columns =
           new String[] {
             "root.test.sg1.s2", "root.test.sg1.s3", "root.test.sg2.s2", "root.test.sg2.s3"
@@ -1333,7 +1333,7 @@ public class IoTDBWithoutNullAllFilterIT {
 
       hasResultSet =
           statement.execute(
-              "select s2, s3 from root.test.sg1, root.test.sg2 without null all(`root.test.sg1.s2`)");
+              "select s2, s3 from root.test.sg1, root.test.sg2 without null all(root.test.sg1.s2)");
 
       Assert.assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1357,7 +1357,7 @@ public class IoTDBWithoutNullAllFilterIT {
 
       hasResultSet =
           statement.execute(
-              "select s2, s3 from root.test.sg1, root.test.sg2 without null all(`root.test.sg1.s2`, s3)");
+              "select s2, s3 from root.test.sg1, root.test.sg2 without null all(root.test.sg1.s2, s3)");
 
       Assert.assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1381,7 +1381,7 @@ public class IoTDBWithoutNullAllFilterIT {
 
       hasResultSet =
           statement.execute(
-              "select s2, s3 from root.test.sg1, root.test.sg2 without null all(`root.test.*.s2`)");
+              "select s2, s3 from root.test.sg1, root.test.sg2 without null all(root.test.*.s2)");
 
       Assert.assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1478,7 +1478,7 @@ public class IoTDBWithoutNullAllFilterIT {
         Statement statement = connection.createStatement()) {
       boolean hasResultSet =
           statement.execute(
-              "select last_value(*) from root.test.** group by([1,10), 2ms) without null all(last_value(`root.test.sg1.s2`)) align by device");
+              "select last_value(*) from root.test.** group by([1,10), 2ms) without null all(last_value(root.test.sg1.s2)) align by device");
     } catch (Exception e) {
       Assert.assertTrue(e.getMessage().contains(QueryPlan.WITHOUT_NULL_FILTER_ERROR_MESSAGE));
     }
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/withoutNullFilter/IoTDBWithoutNullAnyFilterIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/withoutNullFilter/IoTDBWithoutNullAnyFilterIT.java
index a4073f363e..076ed3e709 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/withoutNullFilter/IoTDBWithoutNullAnyFilterIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/withoutNullFilter/IoTDBWithoutNullAnyFilterIT.java
@@ -1254,7 +1254,7 @@ public class IoTDBWithoutNullAnyFilterIT {
         Statement statement = connection.createStatement()) {
       boolean hasResultSet =
           statement.execute(
-              "select s2, s3 from root.test.** without null any(`root.test.sg1.s2`, `root.test.sg2.s3`)");
+              "select s2, s3 from root.test.** without null any(`root`.test.sg1.s2, `root`.test.sg2.s3)");
       String[] columns =
           new String[] {
             "root.test.sg1.s2", "root.test.sg1.s3", "root.test.sg2.s2", "root.test.sg2.s3"
@@ -1282,7 +1282,7 @@ public class IoTDBWithoutNullAnyFilterIT {
 
       hasResultSet =
           statement.execute(
-              "select s2, s3 from root.test.sg1, root.test.sg2 without null any(`root.test.sg1.s2`)");
+              "select s2, s3 from root.test.sg1, root.test.sg2 without null any(`root`.test.sg1.s2)");
 
       Assert.assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1306,7 +1306,7 @@ public class IoTDBWithoutNullAnyFilterIT {
 
       hasResultSet =
           statement.execute(
-              "select s2, s3 from root.test.sg1, root.test.sg2 without null any(`root.test.sg1.s2`, s3)");
+              "select s2, s3 from root.test.sg1, root.test.sg2 without null any(`root`.test.sg1.s2, s3)");
 
       Assert.assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
@@ -1330,7 +1330,7 @@ public class IoTDBWithoutNullAnyFilterIT {
 
       hasResultSet =
           statement.execute(
-              "select s2, s3 from root.test.sg1, root.test.sg2 without null any(`root.test.*.s2`)");
+              "select s2, s3 from root.test.sg1, root.test.sg2 without null any(`root`.test.*.s2)");
 
       Assert.assertTrue(hasResultSet);
       try (ResultSet resultSet = statement.getResultSet()) {
diff --git a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSyntaxConventionIT.java b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSyntaxConventionIT.java
index c67f85a05b..e83726f5f2 100644
--- a/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSyntaxConventionIT.java
+++ b/integration/src/test/java/org/apache/iotdb/session/IoTDBSessionSyntaxConventionIT.java
@@ -66,7 +66,7 @@ public class IoTDBSessionSyntaxConventionIT {
 
     try {
       session.createTimeseries(
-          "root.sg.d1.\"a.s1", TSDataType.INT64, TSEncoding.RLE, CompressionType.SNAPPY);
+          "root.sg.d1.`a.s1", TSDataType.INT64, TSEncoding.RLE, CompressionType.SNAPPY);
       fail();
     } catch (Exception e) {
       Assert.assertTrue(e.getMessage().contains("is not a legal path"));
@@ -74,7 +74,7 @@ public class IoTDBSessionSyntaxConventionIT {
 
     try {
       session.createTimeseries(
-          "root.sg.d1.a\".s1", TSDataType.INT64, TSEncoding.RLE, CompressionType.SNAPPY);
+          "root.sg.d1.a`.s1", TSDataType.INT64, TSEncoding.RLE, CompressionType.SNAPPY);
       fail();
     } catch (Exception e) {
       Assert.assertTrue(e.getMessage().contains("is not a legal path"));
@@ -94,27 +94,7 @@ public class IoTDBSessionSyntaxConventionIT {
 
     String deviceId = "root.sg1.d1";
     List<String> measurements = new ArrayList<>();
-    measurements.add("a.b");
-    measurements.add("a\".\"b");
-    measurements.add("\"a.b");
 
-    List<String> values = new ArrayList<>();
-    for (int i = 0; i < measurements.size(); i++) {
-      values.add("1");
-    }
-
-    try {
-      session.insertRecord(deviceId, 1L, measurements, values);
-      fail();
-    } catch (Exception ignored) {
-
-    }
-
-    SessionDataSet dataSet = session.executeQueryStatement("show timeseries root");
-    Assert.assertFalse(dataSet.hasNext());
-
-    measurements.clear();
-    measurements.add("\"a.b\"");
     measurements.add("\"a“(Φ)”b\"");
     measurements.add("\"a>b\"");
     measurements.add("'a.b'");
@@ -123,23 +103,22 @@ public class IoTDBSessionSyntaxConventionIT {
     measurements.add("a“(Φ)”b");
     measurements.add("a>b");
     measurements.add("\\\"a");
+    List<String> values = new ArrayList<>();
 
-    values.clear();
     for (int i = 0; i < measurements.size(); i++) {
       values.add("1");
     }
 
     session.insertRecord(deviceId, 1L, measurements, values);
 
-    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.\"a.b\""));
-    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.\"a“(Φ)”b\""));
-    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.\"a>b\""));
-    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.'a.b'"));
-    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.'a“(Φ)”b'"));
-    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.'a>b'"));
+    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.`\"a“(Φ)”b\"`"));
+    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.`\"a>b\"`"));
+    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.`'a.b'`"));
+    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.`'a“(Φ)”b'`"));
+    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.`'a>b'`"));
     Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.`a“(Φ)”b`"));
     Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.`a>b`"));
-    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.`\\\"a`"));
+    Assert.assertTrue(session.checkTimeseriesExists("root.sg1.d1.`\\\\\"a`"));
 
     session.close();
   }
diff --git a/node-commons/pom.xml b/node-commons/pom.xml
index 780a533cd6..1043fce93c 100644
--- a/node-commons/pom.xml
+++ b/node-commons/pom.xml
@@ -34,8 +34,14 @@
         <commons.test.skip>false</commons.test.skip>
         <commons.it.skip>${commons.test.skip}</commons.it.skip>
         <commons.ut.skip>${commons.test.skip}</commons.ut.skip>
+        <cglib.version>3.1</cglib.version>
     </properties>
     <dependencies>
+        <dependency>
+            <groupId>cglib</groupId>
+            <artifactId>cglib-nodep</artifactId>
+            <version>${cglib.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.thrift</groupId>
             <artifactId>libthrift</artifactId>
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientManager.java b/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientManager.java
index 54a4d124de..70bd2edb29 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientManager.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientManager.java
@@ -56,7 +56,9 @@ public class ClientManager<K, V> implements IClientManager<K, V> {
       throw e;
     } catch (Exception e) {
       // external doesn't care of other exceptions
-      logger.error(String.format("Borrow client from pool for node %s failed.", node), e);
+      String errorMessage = String.format("Borrow client from pool for node %s failed.", node);
+      logger.error(errorMessage, e);
+      throw new IOException(errorMessage, e);
     }
     return client;
   }
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncConfigNodeIServiceClient.java b/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncConfigNodeIServiceClient.java
index 6966241f57..f57becd12c 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncConfigNodeIServiceClient.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncConfigNodeIServiceClient.java
@@ -34,9 +34,11 @@ import org.apache.thrift.protocol.TProtocolFactory;
 import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransportException;
 
+import java.lang.reflect.Constructor;
 import java.net.SocketException;
 
-public class SyncConfigNodeIServiceClient extends ConfigIService.Client {
+public class SyncConfigNodeIServiceClient extends ConfigIService.Client
+    implements SyncThriftClient, AutoCloseable {
 
   private final TEndPoint endpoint;
   private final ClientManager<TEndPoint, SyncConfigNodeIServiceClient> clientManager;
@@ -60,7 +62,7 @@ public class SyncConfigNodeIServiceClient extends ConfigIService.Client {
     getInputProtocol().getTransport().open();
   }
 
-  public void returnSelf() {
+  public void close() {
     if (clientManager != null) {
       clientManager.returnClient(endpoint, this);
     }
@@ -71,7 +73,7 @@ public class SyncConfigNodeIServiceClient extends ConfigIService.Client {
     ((TimeoutChangeableTransport) (getInputProtocol().getTransport())).setTimeout(timeout);
   }
 
-  public void close() {
+  public void invalidate() {
     getInputProtocol().getTransport().close();
   }
 
@@ -95,14 +97,22 @@ public class SyncConfigNodeIServiceClient extends ConfigIService.Client {
     @Override
     public void destroyObject(
         TEndPoint endpoint, PooledObject<SyncConfigNodeIServiceClient> pooledObject) {
-      pooledObject.getObject().close();
+      pooledObject.getObject().invalidate();
     }
 
     @Override
     public PooledObject<SyncConfigNodeIServiceClient> makeObject(TEndPoint endpoint)
         throws Exception {
+      Constructor<SyncConfigNodeIServiceClient> constructor =
+          SyncConfigNodeIServiceClient.class.getConstructor(
+              clientFactoryProperty.getProtocolFactory().getClass(),
+              int.class,
+              endpoint.getClass(),
+              clientManager.getClass());
       return new DefaultPooledObject<>(
-          new SyncConfigNodeIServiceClient(
+          SyncThriftClientWithErrorHandler.newErrorHandler(
+              SyncConfigNodeIServiceClient.class,
+              constructor,
               clientFactoryProperty.getProtocolFactory(),
               clientFactoryProperty.getConnectionTimeoutMs(),
               endpoint,
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncDataNodeDataBlockServiceClient.java b/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncDataNodeDataBlockServiceClient.java
index 913fc4324f..6152614684 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncDataNodeDataBlockServiceClient.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncDataNodeDataBlockServiceClient.java
@@ -34,9 +34,11 @@ import org.apache.thrift.protocol.TProtocolFactory;
 import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransportException;
 
+import java.lang.reflect.Constructor;
 import java.net.SocketException;
 
-public class SyncDataNodeDataBlockServiceClient extends DataBlockService.Client {
+public class SyncDataNodeDataBlockServiceClient extends DataBlockService.Client
+    implements SyncThriftClient, AutoCloseable {
 
   private final TEndPoint endpoint;
   private final ClientManager<TEndPoint, SyncDataNodeDataBlockServiceClient> clientManager;
@@ -60,7 +62,7 @@ public class SyncDataNodeDataBlockServiceClient extends DataBlockService.Client
     getInputProtocol().getTransport().open();
   }
 
-  public void returnSelf() {
+  public void close() {
     if (clientManager != null) {
       clientManager.returnClient(endpoint, this);
     }
@@ -71,7 +73,7 @@ public class SyncDataNodeDataBlockServiceClient extends DataBlockService.Client
     ((TimeoutChangeableTransport) (getInputProtocol().getTransport())).setTimeout(timeout);
   }
 
-  public void close() {
+  public void invalidate() {
     getInputProtocol().getTransport().close();
   }
 
@@ -96,14 +98,22 @@ public class SyncDataNodeDataBlockServiceClient extends DataBlockService.Client
     @Override
     public void destroyObject(
         TEndPoint endpoint, PooledObject<SyncDataNodeDataBlockServiceClient> pooledObject) {
-      pooledObject.getObject().close();
+      pooledObject.getObject().invalidate();
     }
 
     @Override
     public PooledObject<SyncDataNodeDataBlockServiceClient> makeObject(TEndPoint endpoint)
         throws Exception {
+      Constructor<SyncDataNodeDataBlockServiceClient> constructor =
+          SyncDataNodeDataBlockServiceClient.class.getConstructor(
+              clientFactoryProperty.getProtocolFactory().getClass(),
+              int.class,
+              endpoint.getClass(),
+              clientManager.getClass());
       return new DefaultPooledObject<>(
-          new SyncDataNodeDataBlockServiceClient(
+          SyncThriftClientWithErrorHandler.newErrorHandler(
+              SyncDataNodeDataBlockServiceClient.class,
+              constructor,
               clientFactoryProperty.getProtocolFactory(),
               clientFactoryProperty.getConnectionTimeoutMs(),
               endpoint,
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncDataNodeInternalServiceClient.java b/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncDataNodeInternalServiceClient.java
index 843efd4396..23d2c56f43 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncDataNodeInternalServiceClient.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncDataNodeInternalServiceClient.java
@@ -35,9 +35,11 @@ import org.apache.thrift.protocol.TProtocolFactory;
 import org.apache.thrift.transport.TSocket;
 import org.apache.thrift.transport.TTransportException;
 
+import java.lang.reflect.Constructor;
 import java.net.SocketException;
 
-public class SyncDataNodeInternalServiceClient extends InternalService.Client {
+public class SyncDataNodeInternalServiceClient extends InternalService.Client
+    implements SyncThriftClient, AutoCloseable {
 
   private final TEndPoint endpoint;
   private final ClientManager<TEndPoint, SyncDataNodeInternalServiceClient> clientManager;
@@ -71,7 +73,7 @@ public class SyncDataNodeInternalServiceClient extends InternalService.Client {
     return clientManager;
   }
 
-  public void returnSelf() {
+  public void close() {
     if (clientManager != null) {
       clientManager.returnClient(endpoint, this);
     }
@@ -82,7 +84,7 @@ public class SyncDataNodeInternalServiceClient extends InternalService.Client {
     ((TimeoutChangeableTransport) (getInputProtocol().getTransport())).setTimeout(timeout);
   }
 
-  public void close() {
+  public void invalidate() {
     getInputProtocol().getTransport().close();
   }
 
@@ -107,14 +109,19 @@ public class SyncDataNodeInternalServiceClient extends InternalService.Client {
     @Override
     public void destroyObject(
         TEndPoint endpoint, PooledObject<SyncDataNodeInternalServiceClient> pooledObject) {
-      pooledObject.getObject().close();
+      pooledObject.getObject().invalidate();
     }
 
     @Override
     public PooledObject<SyncDataNodeInternalServiceClient> makeObject(TEndPoint endpoint)
         throws Exception {
+      Constructor<SyncDataNodeInternalServiceClient> constructor =
+          SyncDataNodeInternalServiceClient.class.getConstructor(
+              TProtocolFactory.class, int.class, endpoint.getClass(), clientManager.getClass());
       return new DefaultPooledObject<>(
-          new SyncDataNodeInternalServiceClient(
+          SyncThriftClientWithErrorHandler.newErrorHandler(
+              SyncDataNodeInternalServiceClient.class,
+              constructor,
               clientFactoryProperty.getProtocolFactory(),
               clientFactoryProperty.getConnectionTimeoutMs(),
               endpoint,
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncThriftClient.java b/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncThriftClient.java
new file mode 100644
index 0000000000..38eaa252b2
--- /dev/null
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncThriftClient.java
@@ -0,0 +1,25 @@
+/*
+ * 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.commons.client.sync;
+
+public interface SyncThriftClient {
+
+  /** close the connection */
+  void invalidate();
+}
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncThriftClientWithErrorHandler.java b/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncThriftClientWithErrorHandler.java
new file mode 100644
index 0000000000..2792a2ba67
--- /dev/null
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/client/sync/SyncThriftClientWithErrorHandler.java
@@ -0,0 +1,64 @@
+/*
+ * 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.commons.client.sync;
+
+import net.sf.cglib.proxy.Enhancer;
+import net.sf.cglib.proxy.MethodInterceptor;
+import net.sf.cglib.proxy.MethodProxy;
+import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+public class SyncThriftClientWithErrorHandler implements MethodInterceptor {
+
+  private static final Logger LOGGER =
+      LoggerFactory.getLogger(SyncThriftClientWithErrorHandler.class);
+
+  public static <V extends SyncThriftClient> V newErrorHandler(
+      Class<V> targetClass, Constructor<V> constructor, Object... args) {
+    Enhancer enhancer = new Enhancer();
+    enhancer.setSuperclass(targetClass);
+    enhancer.setCallback(new SyncThriftClientWithErrorHandler());
+    if (constructor == null) {
+      return (V) enhancer.create();
+    }
+    return (V) enhancer.create(constructor.getParameterTypes(), args);
+  }
+
+  @Override
+  public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy)
+      throws Throwable {
+    try {
+      return methodProxy.invokeSuper(o, objects);
+    } catch (InvocationTargetException e) {
+      if (e.getTargetException() instanceof TException) {
+        LOGGER.error(
+            "Error in calling method {}, err: {}", method.getName(), e.getTargetException());
+        ((SyncThriftClient) o).invalidate();
+      }
+      throw new TException("Error in calling method " + method.getName(), e.getTargetException());
+    } catch (Exception e) {
+      throw new TException("Error in calling method " + method.getName(), e);
+    }
+  }
+}
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java b/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java
index 8c150d0ba4..df98015fb6 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java
@@ -22,6 +22,7 @@ import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet;
 import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
 import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -231,4 +232,12 @@ public class DataPartition extends Partition {
         .computeIfAbsent(seriesPartitionSlot, key -> new HashMap<>())
         .put(timePartitionSlot, Collections.singletonList(regionReplicaSet));
   }
+
+  public void serialize(ByteBuffer buffer) {
+    // TODO: Serialize DataPartition
+  }
+
+  public void deserialize(ByteBuffer buffer) {
+    // TODO: Deserialize DataPartition
+  }
 }
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java b/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java
index 2c8e415199..586c380e54 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.commons.partition;
 import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet;
 import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -156,4 +157,12 @@ public class SchemaPartition extends Partition {
         .computeIfAbsent(storageGroup, key -> new HashMap<>())
         .put(seriesPartitionSlot, regionReplicaSet);
   }
+
+  public void serialize(ByteBuffer buffer) {
+    // TODO: Serialize SchemaPartition
+  }
+
+  public void deserialize(ByteBuffer buffer) {
+    // TODO: Deserialize DataPartition
+  }
 }
diff --git a/node-commons/src/test/java/org/apache/iotdb/commons/ClientManagerTest.java b/node-commons/src/test/java/org/apache/iotdb/commons/ClientManagerTest.java
index 54eeb70625..44a4e3f777 100644
--- a/node-commons/src/test/java/org/apache/iotdb/commons/ClientManagerTest.java
+++ b/node-commons/src/test/java/org/apache/iotdb/commons/ClientManagerTest.java
@@ -37,6 +37,7 @@ import org.junit.Before;
 import org.junit.Test;
 
 import java.io.IOException;
+import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 
 public class ClientManagerTest {
@@ -83,12 +84,12 @@ public class ClientManagerTest {
     Assert.assertEquals(0, syncClusterManager.getPool().getNumIdle(endPoint));
 
     // return one sync client
-    syncClient1.returnSelf();
+    syncClient1.close();
     Assert.assertEquals(1, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(1, syncClusterManager.getPool().getNumIdle(endPoint));
 
     // return another sync client
-    syncClient2.returnSelf();
+    syncClient2.close();
     Assert.assertEquals(0, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(2, syncClusterManager.getPool().getNumIdle(endPoint));
 
@@ -185,12 +186,12 @@ public class ClientManagerTest {
     Assert.assertEquals(0, syncClusterManager.getPool().getNumIdle(endPoint));
 
     // return one sync client
-    syncClient1.returnSelf();
+    syncClient1.close();
     Assert.assertEquals(1, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(1, syncClusterManager.getPool().getNumIdle(endPoint));
 
     // return another sync client, clientManager should destroy this client
-    syncClient2.returnSelf();
+    syncClient2.close();
     Assert.assertEquals(0, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(1, syncClusterManager.getPool().getNumIdle(endPoint));
     Assert.assertFalse(syncClient2.getInputProtocol().getTransport().isOpen());
@@ -235,15 +236,21 @@ public class ClientManagerTest {
     Assert.assertEquals(1, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(0, syncClusterManager.getPool().getNumIdle(endPoint));
 
-    // get another sync client, should throw error and return null
-    long start = System.nanoTime();
-    SyncDataNodeInternalServiceClient syncClient2 = syncClusterManager.borrowClient(endPoint);
-    long end = System.nanoTime();
-    Assert.assertTrue(end - start >= DefaultProperty.WAIT_CLIENT_TIMEOUT_MS * 1_000_000);
+    // get another sync client, should wait waitClientTimeoutMS ms, throw error
+    SyncDataNodeInternalServiceClient syncClient2 = null;
+    long start = 0, end;
+    try {
+      start = System.nanoTime();
+      syncClient2 = syncClusterManager.borrowClient(endPoint);
+    } catch (IOException e) {
+      end = System.nanoTime();
+      Assert.assertTrue(end - start >= DefaultProperty.WAIT_CLIENT_TIMEOUT_MS * 1_000_000);
+      Assert.assertTrue(e.getMessage().startsWith("Borrow client from pool for node"));
+    }
     Assert.assertNull(syncClient2);
 
     // return one sync client
-    syncClient1.returnSelf();
+    syncClient1.close();
     Assert.assertEquals(0, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(1, syncClusterManager.getPool().getNumIdle(endPoint));
 
@@ -254,7 +261,7 @@ public class ClientManagerTest {
     Assert.assertEquals(syncClient1, syncClient2);
 
     // return the only client
-    syncClient2.returnSelf();
+    syncClient2.close();
     Assert.assertEquals(0, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(1, syncClusterManager.getPool().getNumIdle(endPoint));
 
@@ -302,15 +309,19 @@ public class ClientManagerTest {
     Assert.assertEquals(1, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(0, syncClusterManager.getPool().getNumIdle(endPoint));
 
-    // get another sync client, should wait waitClientTimeoutMS ms, throw error and return null
-    long start = System.nanoTime();
-    SyncDataNodeInternalServiceClient syncClient2 = syncClusterManager.borrowClient(endPoint);
-    long end = System.nanoTime();
-    Assert.assertTrue(end - start >= waitClientTimeoutMS * 1_000_000);
-    Assert.assertNull(syncClient2);
+    // get another sync client, should wait waitClientTimeoutMS ms, throw error
+    long start = 0, end;
+    try {
+      start = System.nanoTime();
+      syncClusterManager.borrowClient(endPoint);
+    } catch (IOException e) {
+      end = System.nanoTime();
+      Assert.assertTrue(end - start >= waitClientTimeoutMS * 1_000_000);
+      Assert.assertTrue(e.getMessage().startsWith("Borrow client from pool for node"));
+    }
 
     // return one sync client
-    syncClient1.returnSelf();
+    syncClient1.close();
     Assert.assertEquals(0, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(1, syncClusterManager.getPool().getNumIdle(endPoint));
 
@@ -348,13 +359,13 @@ public class ClientManagerTest {
     Assert.assertEquals(0, syncClusterManager.getPool().getNumIdle(endPoint));
 
     // return one sync client
-    syncClient1.returnSelf();
+    syncClient1.close();
     Assert.assertEquals(1, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(1, syncClusterManager.getPool().getNumIdle(endPoint));
 
     // invalid another sync client and return
     syncClient2.getInputProtocol().getTransport().close();
-    syncClient2.returnSelf();
+    syncClient2.close();
     Assert.assertEquals(0, syncClusterManager.getPool().getNumActive(endPoint));
     Assert.assertEquals(1, syncClusterManager.getPool().getNumIdle(endPoint));
 
@@ -408,7 +419,11 @@ public class ClientManagerTest {
   }
 
   public void startServer() throws IOException {
-    metaServer = new ServerSocket(9003);
+    metaServer = new ServerSocket();
+    // reuse the port to avoid `Bind Address already in use` which is caused by TIME_WAIT state
+    // because port won't be usable immediately after we close it.
+    metaServer.setReuseAddress(true);
+    metaServer.bind(new InetSocketAddress(9003));
     metaServerListeningThread =
         new Thread(
             () -> {
diff --git a/server/file-changelists/role-changelist.md b/server/file-changelists/role-changelist.md
deleted file mode 100644
index 58af89152c..0000000000
--- a/server/file-changelists/role-changelist.md
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
-
-    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.
-
--->
-
-# 0.11.x -> 0.12.x
-
-Last updated on 2020-11-9 by Tian Jiang
-
-## Update:
-No change
-
-# 0.10.x -> 0.11.x
-
-Last updated on 2020-11-9 by Tian Jiang
-
-## Update:
-No change
\ No newline at end of file
diff --git a/server/src/assembly/resources/conf/iotdb-engine.properties b/server/src/assembly/resources/conf/iotdb-engine.properties
index 27e06fe926..11382d2d56 100644
--- a/server/src/assembly/resources/conf/iotdb-engine.properties
+++ b/server/src/assembly/resources/conf/iotdb-engine.properties
@@ -1020,10 +1020,6 @@ timestamp_precision=ms
 ####################
 ### Schema File Configuration
 ####################
-# the max num of thread used for flushing metadata to schema file
-# Datatype: int
-# max_schema_flush_thread=15
-
 # The minimum size (in bytes) allocated for a node in schema file
 # A large number for this will make it faster while occupying more space, or otherwise
 # The default 0 means if a flushed internal(entity) had less than 20 children, it will get a segment with the size calculated from total size of its children
diff --git a/server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java b/server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java
index 3749e87d58..91df9d41e7 100644
--- a/server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java
+++ b/server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java
@@ -18,17 +18,20 @@
  */
 package org.apache.iotdb.db.auth;
 
+import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.commons.conf.IoTDBConstant;
-import org.apache.iotdb.db.auth.authorizer.BasicAuthorizer;
-import org.apache.iotdb.db.auth.authorizer.IAuthorizer;
+import org.apache.iotdb.db.auth.authorizer.AuthorizerManager;
 import org.apache.iotdb.db.auth.entity.PrivilegeType;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.metadata.path.PartialPath;
+import org.apache.iotdb.db.mpp.plan.constant.StatementType;
 import org.apache.iotdb.db.qp.logical.Operator;
+import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
 import java.util.List;
 
 public class AuthorityChecker {
@@ -79,16 +82,58 @@ public class AuthorityChecker {
     return true;
   }
 
+  /**
+   * check permission(datanode to confignode).
+   *
+   * @param username username
+   * @param paths paths in List structure
+   * @param type Statement Type
+   * @param targetUser target user
+   * @return if permission-check is passed
+   */
+  public static boolean checkPermission(
+      String username, List<? extends PartialPath> paths, StatementType type, String targetUser) {
+    if (SUPER_USER.equals(username)) {
+      return true;
+    }
+
+    int permission = translateToPermissionId(type);
+    if (permission == -1) {
+      return false;
+    } else if (permission == PrivilegeType.MODIFY_PASSWORD.ordinal()
+        && username.equals(targetUser)) {
+      // a user can modify his own password
+      return true;
+    }
+
+    List<String> allPath = new ArrayList<>();
+    if (paths != null && !paths.isEmpty()) {
+      for (PartialPath path : paths) {
+        allPath.add(path == null ? IoTDBConstant.PATH_ROOT : path.getFullPath());
+      }
+    } else {
+      allPath.add(IoTDBConstant.PATH_ROOT);
+    }
+
+    TSStatus status = AuthorizerManager.getInstance().checkPath(username, allPath, permission);
+    if (status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+      return true;
+    } else {
+      return false;
+    }
+  }
+
   private static boolean checkOnePath(String username, PartialPath path, int permission)
       throws AuthException {
-    IAuthorizer authorizer = BasicAuthorizer.getInstance();
+    AuthorizerManager authorizerManager = AuthorizerManager.getInstance();
     try {
       String fullPath = path == null ? IoTDBConstant.PATH_ROOT : path.getFullPath();
-      if (authorizer.checkUserPrivileges(username, fullPath, permission)) {
+      if (authorizerManager.checkUserPrivileges(username, fullPath, permission)) {
         return true;
       }
     } catch (AuthException e) {
       logger.error("Error occurs when checking the seriesPath {} for user {}", path, username, e);
+      throw new AuthException(e);
     }
     return false;
   }
@@ -177,4 +222,89 @@ public class AuthorityChecker {
         return -1;
     }
   }
+
+  private static int translateToPermissionId(StatementType type) {
+    switch (type) {
+      case GRANT_ROLE_PRIVILEGE:
+        return PrivilegeType.GRANT_ROLE_PRIVILEGE.ordinal();
+      case CREATE_ROLE:
+        return PrivilegeType.CREATE_ROLE.ordinal();
+      case CREATE_USER:
+        return PrivilegeType.CREATE_USER.ordinal();
+      case MODIFY_PASSWORD:
+        return PrivilegeType.MODIFY_PASSWORD.ordinal();
+      case GRANT_USER_PRIVILEGE:
+        return PrivilegeType.GRANT_USER_PRIVILEGE.ordinal();
+      case REVOKE_ROLE_PRIVILEGE:
+        return PrivilegeType.REVOKE_ROLE_PRIVILEGE.ordinal();
+      case REVOKE_USER_PRIVILEGE:
+        return PrivilegeType.REVOKE_USER_PRIVILEGE.ordinal();
+      case GRANT_USER_ROLE:
+        return PrivilegeType.GRANT_USER_ROLE.ordinal();
+      case DELETE_USER:
+        return PrivilegeType.DELETE_USER.ordinal();
+      case DELETE_ROLE:
+        return PrivilegeType.DELETE_ROLE.ordinal();
+      case REVOKE_USER_ROLE:
+        return PrivilegeType.REVOKE_USER_ROLE.ordinal();
+      case SET_STORAGE_GROUP:
+        return PrivilegeType.SET_STORAGE_GROUP.ordinal();
+      case DELETE_STORAGE_GROUP:
+        return PrivilegeType.DELETE_STORAGE_GROUP.ordinal();
+      case CREATE_TIMESERIES:
+      case CREATE_ALIGNED_TIMESERIES:
+        return PrivilegeType.CREATE_TIMESERIES.ordinal();
+      case DELETE_TIMESERIES:
+      case DELETE:
+      case DROP_INDEX:
+        return PrivilegeType.DELETE_TIMESERIES.ordinal();
+      case SHOW:
+      case QUERY:
+      case GROUP_BY_TIME:
+      case QUERY_INDEX:
+      case AGGREGATION:
+      case UDAF:
+      case UDTF:
+      case LAST:
+      case FILL:
+      case GROUP_BY_FILL:
+      case SELECT_INTO:
+        return PrivilegeType.READ_TIMESERIES.ordinal();
+      case INSERT:
+      case LOAD_DATA:
+      case CREATE_INDEX:
+      case BATCH_INSERT:
+      case BATCH_INSERT_ONE_DEVICE:
+      case BATCH_INSERT_ROWS:
+      case MULTI_BATCH_INSERT:
+        return PrivilegeType.INSERT_TIMESERIES.ordinal();
+      case LIST_ROLE:
+      case LIST_ROLE_USERS:
+      case LIST_ROLE_PRIVILEGE:
+        return PrivilegeType.LIST_ROLE.ordinal();
+      case LIST_USER:
+      case LIST_USER_ROLES:
+      case LIST_USER_PRIVILEGE:
+        return PrivilegeType.LIST_USER.ordinal();
+      case CREATE_FUNCTION:
+        return PrivilegeType.CREATE_FUNCTION.ordinal();
+      case DROP_FUNCTION:
+        return PrivilegeType.DROP_FUNCTION.ordinal();
+      case CREATE_TRIGGER:
+        return PrivilegeType.CREATE_TRIGGER.ordinal();
+      case DROP_TRIGGER:
+        return PrivilegeType.DROP_TRIGGER.ordinal();
+      case START_TRIGGER:
+        return PrivilegeType.START_TRIGGER.ordinal();
+      case STOP_TRIGGER:
+        return PrivilegeType.STOP_TRIGGER.ordinal();
+      case CREATE_CONTINUOUS_QUERY:
+        return PrivilegeType.CREATE_CONTINUOUS_QUERY.ordinal();
+      case DROP_CONTINUOUS_QUERY:
+        return PrivilegeType.DROP_CONTINUOUS_QUERY.ordinal();
+      default:
+        logger.error("Unrecognizable operator type ({}) for AuthorityChecker.", type);
+        return -1;
+    }
+  }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/auth/authorizer/AuthorizerManager.java b/server/src/main/java/org/apache/iotdb/db/auth/authorizer/AuthorizerManager.java
index 37fc1a5c2b..eacd13c692 100644
--- a/server/src/main/java/org/apache/iotdb/db/auth/authorizer/AuthorizerManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/auth/authorizer/AuthorizerManager.java
@@ -22,14 +22,20 @@ package org.apache.iotdb.db.auth.authorizer;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.commons.conf.IoTDBConstant;
 import org.apache.iotdb.confignode.rpc.thrift.TAuthorizerReq;
+import org.apache.iotdb.confignode.rpc.thrift.TCheckUserPrivilegesReq;
 import org.apache.iotdb.confignode.rpc.thrift.TLoginReq;
 import org.apache.iotdb.db.auth.AuthException;
+import org.apache.iotdb.db.auth.AuthorityChecker;
 import org.apache.iotdb.db.auth.entity.Role;
 import org.apache.iotdb.db.auth.entity.User;
-import org.apache.iotdb.db.mpp.execution.config.ConfigTaskResult;
+import org.apache.iotdb.db.conf.OperationType;
+import org.apache.iotdb.db.mpp.plan.execution.config.ConfigTaskResult;
+import org.apache.iotdb.db.mpp.plan.statement.Statement;
+import org.apache.iotdb.db.mpp.plan.statement.sys.AuthorStatement;
 import org.apache.iotdb.db.query.control.SessionManager;
 import org.apache.iotdb.db.query.control.SessionTimeoutManager;
 import org.apache.iotdb.db.service.basic.BasicOpenSessionResp;
+import org.apache.iotdb.rpc.RpcUtils;
 import org.apache.iotdb.rpc.TSStatusCode;
 import org.apache.iotdb.service.rpc.thrift.TSProtocolVersion;
 
@@ -42,6 +48,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import static org.apache.iotdb.db.utils.ErrorHandlingUtils.onNPEOrUnexpectedException;
+
 public class AuthorizerManager implements IAuthorizer {
 
   private static final Logger logger = LoggerFactory.getLogger(AuthorizerManager.class);
@@ -254,4 +262,40 @@ public class AuthorizerManager implements IAuthorizer {
     SessionTimeoutManager.getInstance().register(sessionId);
     return openSessionResp.sessionId(sessionId);
   }
+
+  /** Check whether specific Session has the authorization to given plan. */
+  public TSStatus checkAuthority(Statement statement, long sessionId) {
+    try {
+      if (!checkAuthorization(statement, sessionManager.getUsername(sessionId))) {
+        return RpcUtils.getStatus(
+            TSStatusCode.NO_PERMISSION_ERROR,
+            "No permissions for this operation " + statement.getType());
+      }
+    } catch (AuthException e) {
+      logger.warn("meet error while checking authorization.", e);
+      return RpcUtils.getStatus(TSStatusCode.UNINITIALIZED_AUTH_ERROR, e.getMessage());
+    } catch (Exception e) {
+      return onNPEOrUnexpectedException(
+          e, OperationType.CHECK_AUTHORITY, TSStatusCode.EXECUTE_STATEMENT_ERROR);
+    }
+    return RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
+  }
+
+  /** Check whether specific user has the authorization to given plan. */
+  public boolean checkAuthorization(Statement statement, String username) throws AuthException {
+    if (!statement.isAuthenticationRequired()) {
+      return true;
+    }
+    String targetUser = null;
+    if (statement instanceof AuthorStatement) {
+      targetUser = ((AuthorStatement) statement).getUserName();
+    }
+    return AuthorityChecker.checkPermission(
+        username, statement.getPaths(), statement.getType(), targetUser);
+  }
+
+  public TSStatus checkPath(String username, List<String> allPath, int permission) {
+    return clusterAuthorizer.checkUserPrivileges(
+        new TCheckUserPrivilegesReq(username, allPath, permission));
+  }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/auth/authorizer/ClusterAuthorizer.java b/server/src/main/java/org/apache/iotdb/db/auth/authorizer/ClusterAuthorizer.java
index 85ed49a992..81dbb3ee6e 100644
--- a/server/src/main/java/org/apache/iotdb/db/auth/authorizer/ClusterAuthorizer.java
+++ b/server/src/main/java/org/apache/iotdb/db/auth/authorizer/ClusterAuthorizer.java
@@ -23,21 +23,29 @@ import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.commons.exception.BadNodeUrlException;
 import org.apache.iotdb.confignode.rpc.thrift.TAuthorizerReq;
 import org.apache.iotdb.confignode.rpc.thrift.TAuthorizerResp;
+import org.apache.iotdb.confignode.rpc.thrift.TCheckUserPrivilegesReq;
 import org.apache.iotdb.confignode.rpc.thrift.TLoginReq;
 import org.apache.iotdb.db.client.ConfigNodeClient;
-import org.apache.iotdb.db.mpp.execution.config.ConfigTaskResult;
+import org.apache.iotdb.db.mpp.common.header.ColumnHeader;
+import org.apache.iotdb.db.mpp.common.header.DatasetHeader;
+import org.apache.iotdb.db.mpp.plan.execution.config.ConfigTaskResult;
 import org.apache.iotdb.db.qp.logical.sys.AuthorOperator;
 import org.apache.iotdb.rpc.ConfigNodeConnectionException;
 import org.apache.iotdb.rpc.IoTDBConnectionException;
 import org.apache.iotdb.rpc.StatementExecutionException;
 import org.apache.iotdb.rpc.TSStatusCode;
-import org.apache.iotdb.tsfile.read.common.block.TsBlock;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.block.TsBlockBuilder;
+import org.apache.iotdb.tsfile.utils.Binary;
 
 import com.google.common.util.concurrent.SettableFuture;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Locale;
+import java.util.Map;
 
 public class ClusterAuthorizer {
 
@@ -78,7 +86,6 @@ public class ClusterAuthorizer {
   public SettableFuture<ConfigTaskResult> queryPermission(TAuthorizerReq authorizerReq) {
     SettableFuture<ConfigTaskResult> future = SettableFuture.create();
     ConfigNodeClient configNodeClient = null;
-    TsBlock tsBlock = null;
     TAuthorizerResp authorizerResp;
     try {
       configNodeClient = new ConfigNodeClient();
@@ -94,8 +101,34 @@ public class ClusterAuthorizer {
             authorizerResp.getStatus());
         future.setException(new StatementExecutionException(authorizerResp.getStatus()));
       } else {
-        // TODO: Construct result
-        future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS, tsBlock, null));
+        // build TSBlock
+        List<TSDataType> types = new ArrayList<>();
+        Map<String, List<String>> authorizerInfo = authorizerResp.getAuthorizerInfo();
+        for (int i = 0; i < authorizerInfo.size(); i++) {
+          types.add(TSDataType.TEXT);
+        }
+        TsBlockBuilder builder = new TsBlockBuilder(types);
+        List<ColumnHeader> headerList = new ArrayList<>();
+
+        for (String header : authorizerInfo.keySet()) {
+          headerList.add(new ColumnHeader(header, TSDataType.TEXT));
+        }
+        // The Time column will be ignored by the setting of ColumnHeader.
+        // So we can put a meaningless value here
+        for (String value : authorizerInfo.get(headerList.get(0).getColumnName())) {
+          builder.getTimeColumnBuilder().writeLong(0L);
+          builder.getColumnBuilder(0).writeBinary(new Binary(value));
+          builder.declarePosition();
+        }
+        for (int i = 1; i < headerList.size(); i++) {
+          for (String value : authorizerInfo.get(headerList.get(i).getColumnName())) {
+            builder.getColumnBuilder(i).writeBinary(new Binary(value));
+          }
+        }
+
+        DatasetHeader datasetHeader = new DatasetHeader(headerList, true);
+        future.set(
+            new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS, builder.build(), datasetHeader));
       }
     } catch (IoTDBConnectionException | BadNodeUrlException e) {
       LOGGER.error("Failed to connect to config node.");
@@ -129,4 +162,24 @@ public class ClusterAuthorizer {
     }
     return status;
   }
+
+  public TSStatus checkUserPrivileges(TCheckUserPrivilegesReq req) {
+    ConfigNodeClient configNodeClient = null;
+    TSStatus status = null;
+    try {
+      configNodeClient = new ConfigNodeClient();
+      // Send request to some API server
+      status = configNodeClient.checkUserPrivileges(req);
+    } catch (IoTDBConnectionException | BadNodeUrlException e) {
+      throw new ConfigNodeConnectionException("Couldn't connect config node");
+    } finally {
+      if (configNodeClient != null) {
+        configNodeClient.close();
+      }
+      if (status == null) {
+        status = new TSStatus();
+      }
+    }
+    return status;
+  }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeClient.java b/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeClient.java
index 9069fe2d67..7464c0a48e 100644
--- a/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeClient.java
+++ b/server/src/main/java/org/apache/iotdb/db/client/ConfigNodeClient.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.commons.utils.CommonUtils;
 import org.apache.iotdb.confignode.rpc.thrift.ConfigIService;
 import org.apache.iotdb.confignode.rpc.thrift.TAuthorizerReq;
 import org.apache.iotdb.confignode.rpc.thrift.TAuthorizerResp;
+import org.apache.iotdb.confignode.rpc.thrift.TCheckUserPrivilegesReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCountStorageGroupResp;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeLocationResp;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRegisterReq;
@@ -365,4 +366,19 @@ public class ConfigNodeClient {
     }
     throw new IoTDBConnectionException(MSG_RECONNECTION_FAIL);
   }
+
+  public TSStatus checkUserPrivileges(TCheckUserPrivilegesReq req) throws IoTDBConnectionException {
+    for (int i = 0; i < RETRY_NUM; i++) {
+      try {
+        TSStatus status = client.checkUserPrivileges(req);
+        if (!updateConfigNodeLeader(status)) {
+          return status;
+        }
+      } catch (TException e) {
+        configLeader = null;
+      }
+      reconnect();
+    }
+    throw new IoTDBConnectionException(MSG_RECONNECTION_FAIL);
+  }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index 65d8264126..2baa72707a 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -827,9 +827,6 @@ public class IoTDBConfig {
   /** the memory used for metadata cache when using persistent schema */
   private int cachedMNodeSizeInSchemaFileMode = -1;
 
-  /** the max num of thread used for flushing metadata to schema file */
-  private int maxSchemaFlushThreadNum = 15;
-
   /** the minimum size (in bytes) of segment inside a schema file page */
   private short minimumSegmentInSchemaFile = 0;
 
@@ -903,7 +900,7 @@ public class IoTDBConfig {
 
   /**
    * Cache size of partition cache in {@link
-   * org.apache.iotdb.db.mpp.sql.analyze.ClusterPartitionFetcher}
+   * org.apache.iotdb.db.mpp.plan.analyze.ClusterPartitionFetcher}
    */
   private int partitionCacheSize = 10000;
 
@@ -2681,14 +2678,6 @@ public class IoTDBConfig {
     this.cachedMNodeSizeInSchemaFileMode = cachedMNodeSizeInSchemaFileMode;
   }
 
-  public int getMaxSchemaFlushThreadNum() {
-    return maxSchemaFlushThreadNum;
-  }
-
-  public void setMaxSchemaFlushThreadNum(int maxSchemaFlushThreadNum) {
-    this.maxSchemaFlushThreadNum = maxSchemaFlushThreadNum;
-  }
-
   public short getMinimumSegmentInSchemaFile() {
     return minimumSegmentInSchemaFile;
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
index 556c03b582..c1651f66eb 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
@@ -766,11 +766,6 @@ public class IoTDBDescriptor {
                   "cached_mnode_size_in_schema_file_mode",
                   String.valueOf(conf.getCachedMNodeSizeInSchemaFileMode()))));
 
-      conf.setMaxSchemaFlushThreadNum(
-          Integer.parseInt(
-              properties.getProperty(
-                  "max_schema_flush_thread", String.valueOf(conf.getMaxSchemaFlushThreadNum()))));
-
       conf.setMinimumSegmentInSchemaFile(
           Short.parseShort(
               properties.getProperty(
diff --git a/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/BaseStateMachine.java b/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/BaseStateMachine.java
index 873d652013..1fdaf2c7d0 100644
--- a/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/BaseStateMachine.java
+++ b/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/BaseStateMachine.java
@@ -24,7 +24,7 @@ import org.apache.iotdb.consensus.common.DataSet;
 import org.apache.iotdb.consensus.common.request.ByteBufferConsensusRequest;
 import org.apache.iotdb.consensus.common.request.IConsensusRequest;
 import org.apache.iotdb.consensus.statemachine.IStateMachine;
-import org.apache.iotdb.db.mpp.sql.planner.plan.FragmentInstance;
+import org.apache.iotdb.db.mpp.plan.planner.plan.FragmentInstance;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.slf4j.Logger;
diff --git a/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java b/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java
index 789cbeafa5..35691c213b 100644
--- a/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java
+++ b/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/DataRegionStateMachine.java
@@ -25,14 +25,14 @@ import org.apache.iotdb.consensus.common.DataSet;
 import org.apache.iotdb.consensus.common.SnapshotMeta;
 import org.apache.iotdb.db.engine.storagegroup.DataRegion;
 import org.apache.iotdb.db.exception.BatchProcessException;
-import org.apache.iotdb.db.mpp.execution.FragmentInstanceManager;
-import org.apache.iotdb.db.mpp.sql.planner.plan.FragmentInstance;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.PlanNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertMultiTabletsNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertRowNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertRowsNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertRowsOfOneDeviceNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertTabletNode;
+import org.apache.iotdb.db.mpp.execution.fragment.FragmentInstanceManager;
+import org.apache.iotdb.db.mpp.plan.planner.plan.FragmentInstance;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.PlanNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertMultiTabletsNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowsNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowsOfOneDeviceNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertTabletNode;
 import org.apache.iotdb.rpc.RpcUtils;
 
 import org.slf4j.Logger;
diff --git a/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java b/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
index c5c753bfa2..68277cce8a 100644
--- a/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
+++ b/server/src/main/java/org/apache/iotdb/db/consensus/statemachine/SchemaRegionStateMachine.java
@@ -24,9 +24,9 @@ import org.apache.iotdb.consensus.common.DataSet;
 import org.apache.iotdb.consensus.common.SnapshotMeta;
 import org.apache.iotdb.db.metadata.schemaregion.ISchemaRegion;
 import org.apache.iotdb.db.metadata.visitor.SchemaExecutionVisitor;
-import org.apache.iotdb.db.mpp.execution.FragmentInstanceManager;
-import org.apache.iotdb.db.mpp.sql.planner.plan.FragmentInstance;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.PlanNode;
+import org.apache.iotdb.db.mpp.execution.fragment.FragmentInstanceManager;
+import org.apache.iotdb.db.mpp.plan.planner.plan.FragmentInstance;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.PlanNode;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java
index 9d5db3c1f3..f28f9958c5 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngineV2.java
@@ -46,8 +46,8 @@ import org.apache.iotdb.db.exception.WriteProcessException;
 import org.apache.iotdb.db.exception.WriteProcessRejectException;
 import org.apache.iotdb.db.exception.metadata.MetadataException;
 import org.apache.iotdb.db.exception.runtime.StorageEngineFailureException;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertRowNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertTabletNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertTabletNode;
 import org.apache.iotdb.db.rescon.SystemInfo;
 import org.apache.iotdb.db.utils.ThreadUtils;
 import org.apache.iotdb.db.utils.UpgradeUtils;
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionTaskManager.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionTaskManager.java
index 2c159d8331..df314abffa 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionTaskManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/CompactionTaskManager.java
@@ -30,6 +30,7 @@ import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.engine.compaction.comparator.DefaultCompactionTaskComparatorImpl;
 import org.apache.iotdb.db.engine.compaction.constant.CompactionTaskStatus;
 import org.apache.iotdb.db.engine.compaction.task.AbstractCompactionTask;
+import org.apache.iotdb.db.engine.compaction.task.CompactionTaskSummary;
 import org.apache.iotdb.db.utils.datastructure.FixedPriorityBlockingQueue;
 
 import com.google.common.util.concurrent.RateLimiter;
@@ -69,8 +70,8 @@ public class CompactionTaskManager implements IService {
       new FixedPriorityBlockingQueue<>(1024, new DefaultCompactionTaskComparatorImpl());
   // <fullStorageGroupName,futureSet>, it is used to store all compaction tasks under each
   // virtualStorageGroup
-  private Map<String, Map<AbstractCompactionTask, Future<Void>>> storageGroupTasks =
-      new HashMap<>();
+  private Map<String, Map<AbstractCompactionTask, Future<CompactionTaskSummary>>>
+      storageGroupTasks = new HashMap<>();
 
   // The thread pool that periodically fetches and executes the compaction task from
   // candidateCompactionTaskQueue to taskExecutionPool. The default number of threads for this pool
@@ -124,7 +125,7 @@ public class CompactionTaskManager implements IService {
   }
 
   @Override
-  public synchronized void stop() {
+  public void stop() {
     if (taskExecutionPool != null) {
       taskExecutionPool.shutdownNow();
       compactionTaskSubmissionThreadPool.shutdownNow();
@@ -136,24 +137,24 @@ public class CompactionTaskManager implements IService {
   }
 
   @Override
-  public synchronized void waitAndStop(long milliseconds) {
+  public void waitAndStop(long milliseconds) {
     if (taskExecutionPool != null) {
       awaitTermination(taskExecutionPool, milliseconds);
       awaitTermination(compactionTaskSubmissionThreadPool, milliseconds);
-      logger.info("Waiting for task taskExecutionPool to shut down");
+      logger.info("Waiting for task taskExecutionPool to shut down in {} ms", milliseconds);
       waitTermination();
       storageGroupTasks.clear();
     }
   }
 
   @TestOnly
-  public synchronized void waitAllCompactionFinish() {
+  public void waitAllCompactionFinish() {
     long sleepingStartTime = 0;
     if (taskExecutionPool != null) {
       while (taskExecutionPool.getActiveCount() > 0 || taskExecutionPool.getQueue().size() > 0) {
         // wait
         try {
-          this.wait(200);
+          Thread.sleep(200);
           sleepingStartTime += 200;
           if (sleepingStartTime % 10000 == 0) {
             logger.warn(
@@ -168,16 +169,17 @@ public class CompactionTaskManager implements IService {
         }
       }
       storageGroupTasks.clear();
+      candidateCompactionTaskQueue.clear();
       logger.info("All compaction task finish");
     }
   }
 
-  private synchronized void waitTermination() {
+  private void waitTermination() {
     long startTime = System.currentTimeMillis();
     while (!taskExecutionPool.isTerminated()) {
       int timeMillis = 0;
       try {
-        this.wait(200);
+        Thread.sleep(200);
       } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
       }
@@ -192,7 +194,7 @@ public class CompactionTaskManager implements IService {
     logger.info("CompactionManager stopped");
   }
 
-  private synchronized void awaitTermination(ExecutorService service, long milliseconds) {
+  private void awaitTermination(ExecutorService service, long milliseconds) {
     try {
       service.shutdown();
       service.awaitTermination(milliseconds, TimeUnit.MILLISECONDS);
@@ -301,28 +303,28 @@ public class CompactionTaskManager implements IService {
   /**
    * This method will directly submit a task to thread pool if there is available thread.
    *
-   * @throws RejectedExecutionException
+   * @return the future of the task.
    */
-  public synchronized void submitTask(AbstractCompactionTask compactionTask)
-      throws RejectedExecutionException {
-    if (taskExecutionPool != null && !taskExecutionPool.isTerminated()) {
-      Future<Void> future = taskExecutionPool.submit(compactionTask);
+  public synchronized Future<CompactionTaskSummary> submitTask(
+      AbstractCompactionTask compactionTask) throws RejectedExecutionException {
+    if (taskExecutionPool != null && !taskExecutionPool.isShutdown()) {
+      Future<CompactionTaskSummary> future = taskExecutionPool.submit(compactionTask);
       storageGroupTasks
           .computeIfAbsent(compactionTask.getFullStorageGroupName(), x -> new HashMap<>())
           .put(compactionTask, future);
-      return;
+      return future;
     }
     logger.warn(
         "A CompactionTask failed to be submitted to CompactionTaskManager because {}",
         taskExecutionPool == null
             ? "taskExecutionPool is null"
             : "taskExecutionPool is terminated");
+    return null;
   }
 
   public synchronized Future<Void> submitSubTask(Callable<Void> subCompactionTask) {
-    if (subCompactionTaskExecutionPool != null && !subCompactionTaskExecutionPool.isTerminated()) {
-      Future<Void> future = subCompactionTaskExecutionPool.submit(subCompactionTask);
-      return future;
+    if (subCompactionTaskExecutionPool != null && !subCompactionTaskExecutionPool.isShutdown()) {
+      return subCompactionTaskExecutionPool.submit(subCompactionTask);
     }
     return null;
   }
@@ -336,7 +338,7 @@ public class CompactionTaskManager implements IService {
   public synchronized List<AbstractCompactionTask> abortCompaction(String storageGroupName) {
     List<AbstractCompactionTask> compactionTaskOfCurSG = new ArrayList<>();
     if (storageGroupTasks.containsKey(storageGroupName)) {
-      for (Map.Entry<AbstractCompactionTask, Future<Void>> taskFutureEntry :
+      for (Map.Entry<AbstractCompactionTask, Future<CompactionTaskSummary>> taskFutureEntry :
           storageGroupTasks.get(storageGroupName).entrySet()) {
         taskFutureEntry.getValue().cancel(true);
         compactionTaskOfCurSG.add(taskFutureEntry.getKey());
@@ -367,7 +369,8 @@ public class CompactionTaskManager implements IService {
 
   public synchronized List<AbstractCompactionTask> getRunningCompactionTaskList() {
     List<AbstractCompactionTask> tasks = new ArrayList<>();
-    for (Map<AbstractCompactionTask, Future<Void>> taskFutureMap : storageGroupTasks.values()) {
+    for (Map<AbstractCompactionTask, Future<CompactionTaskSummary>> taskFutureMap :
+        storageGroupTasks.values()) {
       tasks.addAll(taskFutureMap.keySet());
     }
     return tasks;
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/CrossSpaceCompactionTask.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/CrossSpaceCompactionTask.java
index 8f45039fb4..3f3568ea82 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/CrossSpaceCompactionTask.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/cross/CrossSpaceCompactionTask.java
@@ -149,7 +149,7 @@ public class CrossSpaceCompactionTask extends AbstractCompactionTask {
       }
     } catch (Throwable throwable) {
       // catch throwable instead of exception to handle OOM errors
-      LOGGER.error("Meet errors in cross space compaction, {}", throwable.getMessage());
+      LOGGER.error("Meet errors in cross space compaction.");
       CompactionExceptionHandler.handleException(
           fullStorageGroupName,
           logFile,
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/InnerSpaceCompactionTask.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/InnerSpaceCompactionTask.java
index a7b5acaaa3..f2f9092084 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/InnerSpaceCompactionTask.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/InnerSpaceCompactionTask.java
@@ -31,6 +31,7 @@ import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
 import org.apache.iotdb.db.engine.storagegroup.TsFileResourceList;
 import org.apache.iotdb.db.engine.storagegroup.TsFileResourceStatus;
 import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.exception.write.TsFileNotCompleteException;
 
 import org.apache.commons.io.FileUtils;
 import org.slf4j.Logger;
@@ -38,6 +39,7 @@ import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -99,6 +101,8 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
     targetTsFileResource =
         TsFileNameGenerator.getInnerCompactionTargetFileResource(
             selectedTsFileResourceList, sequence);
+    List<TsFileResource> targetTsFileList =
+        new ArrayList<>(Collections.singletonList(targetTsFileResource));
     LOGGER.info(
         "{} [Compaction] starting compaction task with {} files",
         fullStorageGroupName,
@@ -113,8 +117,7 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
     try {
       compactionLogger = new CompactionLogger(logFile);
       compactionLogger.logFiles(selectedTsFileResourceList, CompactionLogger.STR_SOURCE_FILES);
-      compactionLogger.logFiles(
-          Collections.singletonList(targetTsFileResource), CompactionLogger.STR_TARGET_FILES);
+      compactionLogger.logFiles(targetTsFileList, CompactionLogger.STR_TARGET_FILES);
       LOGGER.info("{} [InnerSpaceCompactionTask] Close the logger", fullStorageGroupName);
       compactionLogger.close();
       LOGGER.info(
@@ -122,11 +125,12 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
 
       // carry out the compaction
       performer.setSourceFiles(selectedTsFileResourceList);
-      performer.setTargetFiles(Collections.singletonList(targetTsFileResource));
+      // As elements in targetFiles may be removed in ReadPointCompactionPerformer, we should use a
+      // mutable list instead of Collections.singletonList()
+      performer.setTargetFiles(targetTsFileList);
       performer.perform();
 
-      CompactionUtils.moveTargetFile(
-          Collections.singletonList(targetTsFileResource), true, fullStorageGroupName);
+      CompactionUtils.moveTargetFile(targetTsFileList, true, fullStorageGroupName);
 
       LOGGER.info("{} [InnerSpaceCompactionTask] start to rename mods file", fullStorageGroupName);
       CompactionUtils.combineModsInInnerCompaction(
@@ -142,14 +146,14 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
         tsFileManager.replace(
             selectedTsFileResourceList,
             Collections.emptyList(),
-            Collections.singletonList(targetTsFileResource),
+            targetTsFileList,
             timePartition,
             true);
       } else {
         tsFileManager.replace(
             Collections.emptyList(),
             selectedTsFileResourceList,
-            Collections.singletonList(targetTsFileResource),
+            targetTsFileList,
             timePartition,
             false);
       }
@@ -166,10 +170,11 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
         isHoldingWriteLock[i] = true;
       }
 
-      if (targetTsFileResource.getTsFile().length()
-          < TSFileConfig.MAGIC_STRING.getBytes().length * 2L + Byte.BYTES) {
+      if (targetTsFileResource.getTsFile().exists()
+          && targetTsFileResource.getTsFile().length()
+              < TSFileConfig.MAGIC_STRING.getBytes().length * 2L + Byte.BYTES) {
         // the file size is smaller than magic string and version number
-        throw new RuntimeException(
+        throw new TsFileNotCompleteException(
             String.format(
                 "target file %s is smaller than magic string and version number size",
                 targetTsFileResource));
@@ -194,10 +199,6 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
         FileUtils.delete(logFile);
       }
     } catch (Throwable throwable) {
-      LOGGER.error(
-          "{} [Compaction] Throwable is caught during execution of SizeTieredCompaction, {}",
-          fullStorageGroupName,
-          throwable.getMessage());
       LOGGER.warn("{} [Compaction] Start to handle exception", fullStorageGroupName);
       if (throwable instanceof InterruptedException) {
         Thread.currentThread().interrupt();
@@ -209,7 +210,7 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
         CompactionExceptionHandler.handleException(
             fullStorageGroupName,
             logFile,
-            Collections.singletonList(targetTsFileResource),
+            targetTsFileList,
             selectedTsFileResourceList,
             Collections.emptyList(),
             tsFileManager,
@@ -220,7 +221,7 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
         CompactionExceptionHandler.handleException(
             fullStorageGroupName,
             logFile,
-            Collections.singletonList(targetTsFileResource),
+            targetTsFileList,
             Collections.emptyList(),
             selectedTsFileResourceList,
             tsFileManager,
@@ -228,6 +229,7 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
             true,
             isSequence());
       }
+      throw throwable;
     } finally {
       releaseFileLocksAndResetMergingStatus();
     }
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/utils/SingleSeriesCompactionExecutor.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/utils/SingleSeriesCompactionExecutor.java
index e7c9c63d13..182c933274 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/utils/SingleSeriesCompactionExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/inner/utils/SingleSeriesCompactionExecutor.java
@@ -79,7 +79,7 @@ public class SingleSeriesCompactionExecutor {
       LinkedList<Pair<TsFileSequenceReader, List<ChunkMetadata>>> readerAndChunkMetadataList,
       TsFileIOWriter fileWriter,
       TsFileResource targetResource) {
-    this.device = series.getDevice();
+    this.device = series.getDeviceIdString();
     this.readerAndChunkMetadataList = readerAndChunkMetadataList;
     this.fileWriter = fileWriter;
     this.schema = measurementSchema;
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/performer/impl/ReadPointCompactionPerformer.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/performer/impl/ReadPointCompactionPerformer.java
index 43a121eff7..9d7c6789f4 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/performer/impl/ReadPointCompactionPerformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/performer/impl/ReadPointCompactionPerformer.java
@@ -192,8 +192,7 @@ public class ReadPointCompactionPerformer
       AbstractCompactionWriter compactionWriter,
       QueryContext queryContext,
       QueryDataSource queryDataSource)
-      throws MetadataException, IOException, InterruptedException {
-    boolean hasStartChunkGroup = false;
+      throws IOException, InterruptedException {
     MultiTsFileDeviceIterator.MeasurementIterator measurementIterator =
         deviceIterator.iterateNotAlignedSeries(device, false);
     Set<String> allMeasurements = measurementIterator.getAllMeasurements();
@@ -204,7 +203,7 @@ public class ReadPointCompactionPerformer
     int idx = 0;
     for (String measurement : allMeasurements) {
       if (measurementsForEachSubTask[idx % subTaskNums] == null) {
-        measurementsForEachSubTask[idx % subTaskNums] = new HashSet<String>();
+        measurementsForEachSubTask[idx % subTaskNums] = new HashSet<>();
       }
       measurementsForEachSubTask[idx++ % subTaskNums].add(measurement);
     }
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/task/AbstractCompactionTask.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/task/AbstractCompactionTask.java
index 3fbf180eb2..0fbe2e7d40 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/task/AbstractCompactionTask.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/task/AbstractCompactionTask.java
@@ -32,11 +32,12 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * AbstractCompactionTask is the base class for all compaction task, it carries out the execution of
- * compaction. AbstractCompactionTask uses a template method, it execute the abstract function
- * <i>doCompaction</i> implemented by subclass, and decrease the currentTaskNum in
- * CompactionScheduler when the <i>doCompaction</i> finish.
+ * compaction. AbstractCompactionTask uses a template method, it executes the abstract function
+ * {@link AbstractCompactionTask#doCompaction()} implemented by subclass, and decrease the
+ * currentTaskNum in CompactionScheduler when the {@link AbstractCompactionTask#doCompaction()} is
+ * finished. The future returns the {@link CompactionTaskSummary} of this task execution.
  */
-public abstract class AbstractCompactionTask implements Callable<Void> {
+public abstract class AbstractCompactionTask implements Callable<CompactionTaskSummary> {
   private static final Logger LOGGER =
       LoggerFactory.getLogger(IoTDBConstant.COMPACTION_LOGGER_NAME);
   protected String fullStorageGroupName;
@@ -64,25 +65,25 @@ public abstract class AbstractCompactionTask implements Callable<Void> {
   protected abstract void doCompaction() throws Exception;
 
   @Override
-  public Void call() throws Exception {
+  public CompactionTaskSummary call() throws Exception {
     ran = true;
     long startTime = System.currentTimeMillis();
     currentTaskNum.incrementAndGet();
+    boolean isSuccess = false;
     try {
       doCompaction();
+      isSuccess = true;
     } catch (InterruptedException e) {
       LOGGER.warn("Current task is interrupted");
-      Thread.interrupted();
     } catch (Exception e) {
-      LOGGER.error(e.getMessage(), e);
+      LOGGER.error("Running compaction task failed", e);
     } finally {
       this.currentTaskNum.decrementAndGet();
       CompactionTaskManager.getInstance().removeRunningTaskFuture(this);
       timeCost = System.currentTimeMillis() - startTime;
       finished = true;
     }
-
-    return null;
+    return new CompactionTaskSummary(isSuccess);
   }
 
   public String getFullStorageGroupName() {
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/task/CompactionTaskSummary.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/task/CompactionTaskSummary.java
new file mode 100644
index 0000000000..a7380969ff
--- /dev/null
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/task/CompactionTaskSummary.java
@@ -0,0 +1,32 @@
+/*
+ * 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.db.engine.compaction.task;
+
+/** The summary of one {@link AbstractCompactionTask} execution */
+public class CompactionTaskSummary {
+  private final boolean success;
+
+  public CompactionTaskSummary(boolean success) {
+    this.success = success;
+  }
+
+  public boolean isSuccess() {
+    return success;
+  }
+}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/memtable/AbstractMemTable.java b/server/src/main/java/org/apache/iotdb/db/engine/memtable/AbstractMemTable.java
index 3cd875a882..f01a4aedbb 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/memtable/AbstractMemTable.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/memtable/AbstractMemTable.java
@@ -29,8 +29,8 @@ import org.apache.iotdb.db.metadata.idtable.entry.DeviceIDFactory;
 import org.apache.iotdb.db.metadata.idtable.entry.IDeviceID;
 import org.apache.iotdb.db.metadata.path.PartialPath;
 import org.apache.iotdb.db.metadata.utils.ResourceByPathUtils;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertRowNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertTabletNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertTabletNode;
 import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertTabletPlan;
 import org.apache.iotdb.db.service.metrics.Metric;
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/memtable/IMemTable.java b/server/src/main/java/org/apache/iotdb/db/engine/memtable/IMemTable.java
index 4dae9cbef3..639d5513c1 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/memtable/IMemTable.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/memtable/IMemTable.java
@@ -26,8 +26,8 @@ import org.apache.iotdb.db.exception.metadata.MetadataException;
 import org.apache.iotdb.db.exception.query.QueryProcessException;
 import org.apache.iotdb.db.metadata.idtable.entry.IDeviceID;
 import org.apache.iotdb.db.metadata.path.PartialPath;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertRowNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertTabletNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertTabletNode;
 import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertTabletPlan;
 import org.apache.iotdb.db.wal.buffer.WALEntryValue;
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/modification/Modification.java b/server/src/main/java/org/apache/iotdb/db/engine/modification/Modification.java
index 3b113efa3a..62fd3bf503 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/modification/Modification.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/modification/Modification.java
@@ -45,7 +45,7 @@ public abstract class Modification {
   }
 
   public String getDevice() {
-    return path.getDevice();
+    return path.getDeviceIdString();
   }
 
   public String getMeasurement() {
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/selectinto/InsertTabletPlansIterator.java b/server/src/main/java/org/apache/iotdb/db/engine/selectinto/InsertTabletPlansIterator.java
index 44a824a309..739a2ade6e 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/selectinto/InsertTabletPlansIterator.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/selectinto/InsertTabletPlansIterator.java
@@ -102,7 +102,7 @@ public class InsertTabletPlansIterator {
 
     Map<String, InsertTabletPlanGenerator> deviceToPlanGeneratorMap = new HashMap<>();
     for (int i = 0, intoPathsSize = intoPaths.size(); i < intoPathsSize; i++) {
-      String device = intoPaths.get(i).getDevice();
+      String device = intoPaths.get(i).getDeviceIdString();
       if (!deviceToPlanGeneratorMap.containsKey(device)) {
         deviceToPlanGeneratorMap.put(
             device, new InsertTabletPlanGenerator(device, tabletRowLimit, isIntoPathsAligned));
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
index 981217375b..173b91e95a 100755
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
@@ -60,11 +60,11 @@ import org.apache.iotdb.db.metadata.idtable.IDTable;
 import org.apache.iotdb.db.metadata.idtable.IDTableManager;
 import org.apache.iotdb.db.metadata.mnode.IMeasurementMNode;
 import org.apache.iotdb.db.metadata.path.PartialPath;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertMultiTabletsNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertRowNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertRowsNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertRowsOfOneDeviceNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertTabletNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertMultiTabletsNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowsNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowsOfOneDeviceNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertTabletNode;
 import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertRowsOfOneDevicePlan;
@@ -690,6 +690,9 @@ public class DataRegion {
     TsFileResource tsFileResource = recoverPerformer.getTsFileResource();
     if (!recoverPerformer.canWrite()) {
       // cannot write, just close it
+      if (tsFileSyncManager.isEnableSync()) {
+        tsFileSyncManager.collectRealTimeTsFile(tsFileResource.getTsFile());
+      }
       try {
         tsFileResource.close();
       } catch (IOException e) {
@@ -2716,7 +2719,7 @@ public class DataRegion {
   }
 
   private long getAndSetNewVersion(long timePartitionId, TsFileResource tsFileResource) {
-    long version = partitionMaxFileVersions.getOrDefault(timePartitionId, -1L) + 1;
+    long version = partitionMaxFileVersions.getOrDefault(timePartitionId, 0L) + 1;
     partitionMaxFileVersions.put(timePartitionId, version);
     tsFileResource.setVersion(version);
     return version;
@@ -3348,7 +3351,7 @@ public class DataRegion {
 
   @TestOnly
   public long getPartitionMaxFileVersions(long partitionId) {
-    return partitionMaxFileVersions.getOrDefault(partitionId, -1L);
+    return partitionMaxFileVersions.getOrDefault(partitionId, 0L);
   }
 
   public void addSettleFilesToList(
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileManager.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileManager.java
index e363b6765f..009e151d87 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileManager.java
@@ -397,7 +397,7 @@ public class TsFileManager {
         isRealTimeTsFile = tsFileProcessor.isMemtableNotNull();
       }
       File tsFile = tsFileResource.getTsFile();
-      if (!isRealTimeTsFile && !syncManager.isTsFileAlreadyBeCollected(tsFile)) {
+      if (!isRealTimeTsFile) {
         File mods = new File(tsFileResource.getModFile().getFilePath());
         long modsOffset = mods.exists() ? mods.length() : 0L;
         File hardlink = syncManager.createHardlink(tsFile, modsOffset);
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
index b7c8896b0f..5b3fd7472e 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
@@ -47,8 +47,8 @@ import org.apache.iotdb.db.metadata.idtable.entry.IDeviceID;
 import org.apache.iotdb.db.metadata.path.AlignedPath;
 import org.apache.iotdb.db.metadata.path.PartialPath;
 import org.apache.iotdb.db.metadata.utils.ResourceByPathUtils;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertRowNode;
-import org.apache.iotdb.db.mpp.sql.planner.plan.node.write.InsertTabletNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertRowNode;
+import org.apache.iotdb.db.mpp.plan.planner.plan.node.write.InsertTabletNode;
 import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertRowPlan;
 import org.apache.iotdb.db.qp.physical.crud.InsertTabletPlan;
diff --git a/server/src/main/java/org/apache/iotdb/db/exception/metadata/SeriesOverflowException.java b/server/src/main/java/org/apache/iotdb/db/exception/metadata/SeriesOverflowException.java
new file mode 100644
index 0000000000..ddf8d9e5d9
--- /dev/null
+++ b/server/src/main/java/org/apache/iotdb/db/exception/metadata/SeriesOverflowException.java
@@ -0,0 +1,33 @@
+/*
+ * 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.db.exception.metadata;
+
+import org.apache.iotdb.rpc.TSStatusCode;
+
+public class SeriesOverflowException extends MetadataException {
+
+  public SeriesOverflowException() {
+    super(
+        "There are too many timeseries in memory, "
+            + "please increase MAX_HEAP_SIZE in iotdb-env.sh/bat, restart and create timeseries again.",
+        TSStatusCode.SERIES_OVERFLOW.getStatusCode());
+  }
+}
diff --git a/server/src/main/java/org/apache/iotdb/db/exception/sql/StatementAnalyzeException.java b/server/src/main/java/org/apache/iotdb/db/exception/sql/StatementAnalyzeException.java
index 333c94e385..9759385c5d 100644
--- a/server/src/main/java/org/apache/iotdb/db/exception/sql/StatementAnalyzeException.java
+++ b/server/src/main/java/org/apache/iotdb/db/exception/sql/StatementAnalyzeException.java
@@ -19,7 +19,7 @@
 
 package org.apache.iotdb.db.exception.sql;
 
-import org.apache.iotdb.db.mpp.sql.constant.FilterConstant;
+import org.apache.iotdb.db.mpp.plan.constant.FilterConstant;
 
 public class StatementAnalyzeException extends RuntimeException {
 
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/cache/DataNodeSchemaCache.java b/server/src/main/java/org/apache/iotdb/db/metadata/cache/DataNodeSchemaCache.java
index cc130ff120..3927a4d887 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/cache/DataNodeSchemaCache.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/cache/DataNodeSchemaCache.java
@@ -26,8 +26,8 @@ import org.apache.iotdb.db.exception.metadata.IllegalPathException;
 import org.apache.iotdb.db.metadata.path.PartialPath;
 import org.apache.iotdb.db.mpp.common.schematree.PathPatternTree;
 import org.apache.iotdb.db.mpp.common.schematree.SchemaTree;
-import org.apache.iotdb.db.mpp.sql.analyze.FakeSchemaFetcherImpl;
-import org.apache.iotdb.db.mpp.sql.analyze.ISchemaFetcher;
+import org.apache.iotdb.db.mpp.plan.analyze.FakeSchemaFetcherImpl;
+import org.apache.iotdb.db.mpp.plan.analyze.ISchemaFetcher;
 import org.apache.iotdb.tsfile.common.constant.TsFileConstant;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableHashmapImpl.java b/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableHashmapImpl.java
index 8f704ce016..4600363218 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableHashmapImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTableHashmapImpl.java
@@ -114,7 +114,8 @@ public class IDTableHashmapImpl implements IDTable {
    * @throws MetadataException if the device is aligned, throw it
    */
   public synchronized void createTimeseries(CreateTimeSeriesPlan plan) throws MetadataException {
-    DeviceEntry deviceEntry = getDeviceEntryWithAlignedCheck(plan.getPath().getDevice(), false);
+    DeviceEntry deviceEntry =
+        getDeviceEntryWithAlignedCheck(plan.getPath().getDeviceIdString(), false);
     SchemaEntry schemaEntry =
         new SchemaEntry(
             plan.getDataType(),
@@ -203,7 +204,8 @@ public class IDTableHashmapImpl implements IDTable {
   public synchronized void registerTrigger(PartialPath fullPath, IMeasurementMNode measurementMNode)
       throws MetadataException {
     boolean isAligned = measurementMNode.getParent().isAligned();
-    DeviceEntry deviceEntry = getDeviceEntryWithAlignedCheck(fullPath.getDevice(), isAligned);
+    DeviceEntry deviceEntry =
+        getDeviceEntryWithAlignedCheck(fullPath.getDeviceIdString(), isAligned);
 
     deviceEntry.getSchemaEntry(fullPath.getMeasurement()).setUsingTrigger();
   }
@@ -218,7 +220,8 @@ public class IDTableHashmapImpl implements IDTable {
   public synchronized void deregisterTrigger(
       PartialPath fullPath, IMeasurementMNode measurementMNode) throws MetadataException {
     boolean isAligned = measurementMNode.getParent().isAligned();
... 103809 lines suppressed ...