You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2025/11/26 06:11:08 UTC

(iotdb) branch force_ci/object_type updated (0657671d20f -> 1b2d3ffcff0)

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

jackietien pushed a change to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git


    from 0657671d20f Avoid unnecessary ssl error log caused by jdk bug (#16709)
     new cbe57655b1e Active Load: Ignore java.io.UncheckedIOException exceptions thrown during the file scanning process. (#16705)
     new 3a8d6d52788 Delete the tsfile and related attachments When only one table and dat… (#16687)
     new 602d4650aaf Fixed the potential non-consistency caused by initialize of DataNodeTableCache & Cleared the storageGroups in compatible codes (#16693)
     new ce054e88e2f Optimize the configuration logic of dn_thrift_max_frame_size (#16724)
     new 6f47cca0efb Changed the SQL of AlterEncodingCompressor statement & banned the "root" timeSeries & handled the empty intersection path & refactored the IT (#16725)
     new 26b5ae3bb18 chore!: Bind real config address for Thrift and Raft services (#16717)
     new a3807d28426 Make ErrMsg more readable when the predicate has too many conjunctions because of too many devices #16715
     new d24cddadbd2 Pipe: Fix unhandled timeout exceptions in Thrift Client (#16727)
     new 15f39d48543 Fixed the procedure has_more_state bug & Fixed the IT for encoding & compressor (#16729)
     new 8a3dbcb7db4 Optimized the lock for encoding & compressor's invalidate cache (#16733)
     new 25d5ba55135 Pipe: support path exclusion under tree model (#16632)
     new f19824d287b Change the privilege of showVersionStatement #16736
     new ff6f7a26ccf [AINode] Package AINode via PyInstaller (#16707)
     new 4e1df942a49 Support the JDBC client to prevent SQL injection (#16734)
     new a1fe4104c9d Fix that a deletion test may fail due to inconsistency caused by leader redistribution (#16744)
     new d712ffc4d5f Fixed the NPE caused by concurrent "check for createTimeSeries" and deleteTimeSeries (#16742)
     new 92878f4ad93 Pipe: Optimized the default behavior in meta sync for retries to wait for other regions (#16740)
     new 197c4f18af9 Adjust the exception message cause by the WHERE clause, which uses a range comparison on the same field, specifically when the left value of the range is greater than the right value of the range. (#16741)
     new 401c5e9208e Pipe: Trimmed some of the pipe logs (#16747)
     new 43c0320204d Active Load: Fixes errors caused by Load copying resource files. (#16753)
     new 8fe93f2d622 Pipe: Modify the Pipe configuration item log name to be consistent with the Properties name. (#16732)
     new b396766f4f2 feat: encode load attributes in active load directories (#16722)
     new 3a6c3bbce54 [AINode] Enable AINode start as background (-d) (#16762)
     new 71976f5ba5e fix (#16702)
     new 104bcf1eb4f reduce error log when compaction service is stopped & fix bugs (#16756)
     new dfda7a0b221 [AINode] Update AINodeClient for DataNode to borrow (#16647)
     new 08c0eec5a91 [AINode] Fix bug that AINode cannot compile in Windows (#16767)
     new 2078b4f706d fix (#16773)
     new c110ab10c03 Load: Fixed the bug that mods is not deleted in load tsFile when there are exceptions & Fixed the potential NPE in air gap agent close() method (#16775)
     new 81b6d592251 [AINode] Fix bug of sundial and forecast udf (#16768)
     new 842c4a5ffc8 Fixed the bugs related to device auto-create alignment ignorance (#16780)
     new fe49c5ee080 Load: Active Load supports ModV2 (#16769)
     new 769f10374dd Load: Fixed the issue of TSFile parent directory being null and TSFile resource being updated during the Load process. (#16751)
     new e72ee9a247a Load: Fixed parameter passing error in MoveFile function (#16748)
     new 40355e34103 Refine CN consensus layer API for procedure robustness (#16303)
     new b7e1c02338f Pipe: improved the memory calculation for tablets (#16739)
     new 50dd71436ec Fixed the bug related to "Fixed the bugs related to device auto-create alignment ignorance" (#16781)
     new 9488a7ed0e6 Load: Remove the getParentFile and exists checks from Load New File (#16787)
     new ccf4346314e Optimized the error message when the column is not tag/attribute in device related SQLs (#16750)
     new e54b8a90ce3 Avoid connection reset error log printed (#16797)
     new 60e8c6352c3 Fix that settle compaction may lgnore some newly incoming deletions (#16799)
     new 45823164d0f Fix slowQueryThreshold & optimize encodeBatch (#16765)
     new e34e0fcb929 Pipe: Adjusted the waiting time of temporary unavailable exceptions (#16798)
     new a1b2287f91e [AINode] Delete poetry.lock for easier maintain different operating systems (#16793)
     new 1b2d3ffcff0 Bump ratis to apache 3.2.1 (#16801)

The 45 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/cluster-it-1c1d1a.yml            |    2 +-
 dependencies.json                                  |   14 +-
 integration-test/src/assembly/mpp-test.xml         |    2 +-
 .../it/env/cluster/config/MppCommonConfig.java     |    4 +-
 .../env/cluster/config/MppSharedCommonConfig.java  |    6 +-
 .../iotdb/it/env/cluster/node/AINodeWrapper.java   |   25 +-
 .../apache/iotdb/itbase/constant/TestConstant.java |   14 +-
 .../org/apache/iotdb/itbase/env/CommonConfig.java  |    2 +-
 .../ainode/it/AINodeConcurrentInferenceIT.java     |   62 +-
 .../confignode/it/IoTDBConfigNodeSnapshotIT.java   |   31 +-
 .../it/database/IoTDBDatabaseSetAndDeleteIT.java   |   66 +-
 .../it/load/IoTDBConfigNodeSwitchLeaderIT.java     |    2 +-
 .../partition/IoTDBAutoRegionGroupExtensionIT.java |    8 +-
 .../IoTDBCustomRegionGroupExtensionIT.java         |    2 +-
 .../it/partition/IoTDBPartitionCreationIT.java     |    4 +-
 .../it/partition/IoTDBPartitionDurableIT.java      |    4 +-
 .../it/partition/IoTDBPartitionGetterIT.java       |   41 +-
 .../confignode/it/utils/ConfigNodeTestUtils.java   |   16 +-
 .../org/apache/iotdb/db/it/IoTDBDeletionIT.java    |   21 +
 .../org/apache/iotdb/db/it/IoTDBExampleIT.java     |    4 +-
 .../org/apache/iotdb/db/it/IoTDBFlushQueryIT.java  |    5 +-
 .../org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java  |  145 ++
 .../iotdb/db/it/IoTDBLoadTsFileWithModIT.java      |   60 +-
 .../org/apache/iotdb/db/it/IoTDBRestServiceIT.java |    8 +-
 .../iotdb/db/it/IoTDBSetConfigurationIT.java       |    2 +-
 .../org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java |    2 +-
 .../db/it/IoTDBSyntaxConventionIdentifierIT.java   |    2 +-
 .../iotdb/db/it/auth/IoTDBSystemPermissionIT.java  |    3 +-
 .../it/auth/IoTDBSystemPermissionRelationalIT.java |    3 +-
 .../apache/iotdb/db/it/path/IoTDBQuotedPathIT.java |    4 +-
 .../it/schema/IoTDBAlterEncodingCompressorIT.java  |   44 +-
 .../db/it/schema/IoTDBAutoCreateSchemaIT.java      |   14 +-
 .../it/schema/IoTDBCreateAlignedTimeseriesIT.java  |   22 +
 .../db/it/schema/IoTDBCreateTimeseriesIT.java      |    8 +
 .../db/it/schema/IoTDBDeactivateTemplateIT.java    |    2 +-
 .../db/it/schema/IoTDBDeleteTimeSeriesIT.java      |    2 +-
 .../iotdb/db/it/schema/IoTDBMetadataFetchIT.java   |    2 +-
 .../org/apache/iotdb/db/it/schema/IoTDBTagIT.java  |    2 +-
 .../auto/basic/IoTDBTreePatternFormatIT.java       |  616 +++---
 .../treemodel/manual/IoTDBPipeInclusionIT.java     |   88 +-
 .../relational/it/db/it/IoTDBDeletionTableIT.java  |  380 +++-
 .../it/query/old/IoTDBSimpleQueryTableIT.java      |    2 +-
 .../it/query/recent/IoTDBMaintainAuthIT.java       |    8 +-
 .../iotdb/relational/it/schema/IoTDBDeviceIT.java  |   44 +-
 .../it/session/IoTDBSessionRelationalIT.java       |    2 +
 .../iotdb/session/it/IoTDBSessionSimpleIT.java     |   22 +-
 .../session/it/IoTDBSessionSyntaxConventionIT.java |    6 +-
 .../apache/iotdb/jdbc/IoTDBPreparedStatement.java  |   17 +-
 .../iotdb/jdbc/IoTDBPreparedStatementTest.java     |  154 +-
 .../rpc/TCompressedElasticFramedTransport.java     |    8 +-
 .../apache/iotdb/rpc/TElasticFramedTransport.java  |  104 +-
 .../java/org/apache/iotdb/rpc/TSStatusCode.java    |    2 +-
 iotdb-core/ainode/.gitignore                       |    9 +-
 iotdb-core/ainode/ainode.spec                      |  199 ++
 iotdb-core/ainode/ainode.xml                       |   17 +-
 iotdb-core/ainode/build_binary.py                  |  602 ++++++
 iotdb-core/ainode/iotdb/ainode/core/ai_node.py     |   10 +-
 iotdb-core/ainode/iotdb/ainode/core/config.py      |   28 +-
 iotdb-core/ainode/iotdb/ainode/core/constant.py    |   18 +-
 .../iotdb/ainode/core/inference/pool_controller.py |   49 +-
 .../pool_scheduler/basic_pool_scheduler.py         |    7 +-
 iotdb-core/ainode/iotdb/ainode/core/log.py         |    4 +-
 .../iotdb/ainode/core/manager/inference_manager.py |    4 +-
 .../ainode/core/model/sundial/modeling_sundial.py  |   13 +-
 .../ainode/core/model/timerxl/modeling_timer.py    |    6 +-
 iotdb-core/ainode/iotdb/ainode/core/rpc/handler.py |    2 +-
 iotdb-core/ainode/iotdb/ainode/core/rpc/service.py |    1 +
 iotdb-core/ainode/iotdb/ainode/core/script.py      |   80 +-
 iotdb-core/ainode/poetry.lock                      | 2226 --------------------
 iotdb-core/ainode/pom.xml                          |   92 +-
 iotdb-core/ainode/pyproject.toml                   |   29 +-
 .../ainode/resources/syncPythonVersion.groovy      |   33 -
 .../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4   |    2 +-
 .../antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4  |    4 +
 iotdb-core/confignode/pom.xml                      |    2 +-
 .../async/AsyncAINodeHeartbeatClientPool.java      |    7 +-
 .../request/read/model/ShowModelPlan.java          |    4 +-
 .../write/database/PreDeleteDatabasePlan.java      |   22 +-
 .../iotdb/confignode/manager/ConfigManager.java    |   54 +-
 .../apache/iotdb/confignode/manager/IManager.java  |   34 +-
 .../iotdb/confignode/manager/ModelManager.java     |   37 +-
 .../iotdb/confignode/manager/ProcedureManager.java |   27 +
 .../iotdb/confignode/manager/load/LoadManager.java |    2 +-
 .../manager/load/balancer/RegionBalancer.java      |    2 +-
 .../pipe/agent/task/PipeConfigNodeSubtask.java     |    6 +-
 .../receiver/protocol/IoTDBConfigNodeReceiver.java |   13 +-
 .../pipe/source/IoTDBConfigRegionSource.java       |    6 +-
 ...eConfigPhysicalPlanTreePatternParseVisitor.java |   46 +-
 .../manager/schema/ClusterSchemaManager.java       |   26 +-
 .../persistence/partition/PartitionInfo.java       |    2 +-
 .../procedure/CompletedProcedureRecycler.java      |   21 +-
 .../iotdb/confignode/procedure/Procedure.java      |   27 +-
 .../confignode/procedure/ProcedureExecutor.java    |   88 +-
 .../procedure/TimeoutExecutorThread.java           |   12 +-
 .../procedure/impl/model/CreateModelProcedure.java |    4 +-
 .../procedure/impl/model/DropModelProcedure.java   |    7 +-
 .../procedure/impl/node/RemoveAINodeProcedure.java |    4 +-
 .../schema/AlterEncodingCompressorProcedure.java   |   11 +-
 .../impl/schema/DeleteDatabaseProcedure.java       |   28 +-
 .../impl/schema/DeleteTimeSeriesProcedure.java     |    7 +-
 ...ageGroupState.java => DeleteDatabaseState.java} |    2 +-
 .../procedure/store/ConfigProcedureStore.java      |   26 +-
 .../procedure/store/IProcedureStore.java           |   10 +-
 .../thrift/ConfigNodeRPCServiceProcessor.java      |   69 +-
 ...figPhysicalPlanTreePatternParseVisitorTest.java |    7 +-
 iotdb-core/consensus/pom.xml                       |   14 +-
 .../iotdb/consensus/ratis/RatisConsensus.java      |    1 +
 iotdb-core/datanode/pom.xml                        |    2 +-
 .../assembly/resources/conf/logback-datanode.xml   |   15 -
 .../apache/iotdb/db/conf/DataNodeMemoryConfig.java |   10 +-
 .../java/org/apache/iotdb/db/conf/IoTDBConfig.java |   12 +-
 .../org/apache/iotdb/db/conf/IoTDBDescriptor.java  |    4 -
 .../schemaregion/SchemaExecutionVisitor.java       |   44 +-
 .../db/pipe/agent/task/PipeDataNodeTaskAgent.java  |    4 +-
 .../agent/task/connection/PipeEventCollector.java  |    4 +-
 .../agent/task/subtask/sink/PipeSinkSubtask.java   |    4 +-
 .../parser/TsFileInsertionEventParserProvider.java |    6 +-
 .../protocol/airgap/IoTDBAirGapReceiverAgent.java  |    5 +-
 .../protocol/thrift/IoTDBDataNodeReceiver.java     |   25 +-
 .../visitor/PipeStatementTSStatusVisitor.java      |   42 +-
 .../PipeStatementTreePatternParseVisitor.java      |   22 +-
 ...leStatementDataTypeConvertExecutionVisitor.java |    4 +-
 ...eeStatementDataTypeConvertExecutionVisitor.java |    4 +-
 .../resource/memory/InsertNodeMemoryEstimator.java |   55 +-
 .../pipe/resource/memory/PipeMemoryWeightUtil.java |   62 +-
 .../thrift/async/IoTDBDataRegionAsyncSink.java     |   18 +-
 .../source/dataregion/IoTDBDataRegionSource.java   |    6 +-
 .../realtime/assigner/DisruptorQueue.java          |    4 +-
 .../PipePlanTreePatternParseVisitor.java           |   41 +-
 .../db/protocol/client/AINodeClientFactory.java    |  133 ++
 .../iotdb/db/protocol/client/ConfigNodeClient.java |   51 +-
 .../db/protocol}/client/ainode/AINodeClient.java   |  168 +-
 .../client/ainode/AINodeClientManager.java         |   75 +
 .../client/ainode/AsyncAINodeServiceClient.java    |    2 +-
 .../impl/DataNodeInternalRPCServiceImpl.java       |   59 +-
 .../execution/executor/RegionWriteExecutor.java    |    4 +-
 .../operator/process/ai/InferenceOperator.java     |    4 +-
 .../InformationSchemaContentSupplierFactory.java   |   17 +-
 .../queryengine/plan/analyze/AnalyzeVisitor.java   |    2 +-
 .../queryengine/plan/analyze/PredicateUtils.java   |   16 +-
 .../analyze/cache/partition/PartitionCache.java    |    2 +-
 .../plan/analyze/load/LoadTsFileAnalyzer.java      |   14 +-
 .../load/TreeSchemaAutoCreatorAndVerifier.java     |    4 +
 .../analyze/schema/AutoCreateSchemaExecutor.java   |   51 +-
 .../execution/config/TableConfigTaskVisitor.java   |    1 -
 .../execution/config/TreeConfigTaskVisitor.java    |    3 +-
 .../config/executor/ClusterConfigTaskExecutor.java |  114 +-
 .../config/metadata/ai/ShowAIDevicesTask.java      |    2 +-
 .../config/metadata/ai/ShowLoadedModelsTask.java   |    4 +-
 .../config/metadata/ai/ShowModelsTask.java         |    4 +-
 .../db/queryengine/plan/parser/ASTVisitor.java     |   33 +-
 .../plan/node/load/LoadSingleTsFileNode.java       |    6 +-
 .../relational/analyzer/StatementAnalyzer.java     |   51 +-
 .../function/tvf/ForecastTableFunction.java        |    8 +-
 .../metadata/fetcher/TableDeviceSchemaFetcher.java |    6 +-
 .../fetcher/cache/TableDeviceSchemaCache.java      |    2 +-
 .../cache/TableDeviceSchemaCacheMetrics.java       |    9 +-
 .../security/TreeAccessCheckVisitor.java           |    4 +-
 .../scheduler/load/LoadTsFileDispatcherImpl.java   |   12 +-
 .../plan/statement/StatementVisitor.java           |    2 +-
 .../plan/statement/crud/InsertBaseStatement.java   |    2 +-
 .../plan/statement/crud/InsertTabletStatement.java |    2 +-
 .../plan/statement/crud/LoadTsFileStatement.java   |   18 +-
 .../statement/metadata/CountDatabaseStatement.java |    2 +-
 .../db/queryengine/plan/udf/UDTFForecast.java      |    9 +-
 .../rescon/MemSchemaEngineStatistics.java          |    3 +-
 .../schemaengine/schemaregion/ISchemaRegion.java   |    5 +-
 .../schemaregion/impl/SchemaRegionMemoryImpl.java  |   16 +-
 .../schemaregion/impl/SchemaRegionPBTreeImpl.java  |   16 +-
 .../mtree/impl/mem/MTreeBelowSGMemoryImpl.java     |   96 +-
 .../mtree/impl/pbtree/MTreeBelowSGCachedImpl.java  |   21 +-
 .../schemaengine/schemaregion/utils/MetaUtils.java |    6 +-
 .../req/impl/CreateAlignedTimeSeriesPlanImpl.java  |   10 +
 .../write/req/impl/CreateTimeSeriesPlanImpl.java   |   10 +
 .../db/schemaengine/table/DataNodeTableCache.java  |   17 +
 .../db/storageengine/dataregion/DataRegion.java    |  123 +-
 .../execute/task/AbstractCompactionTask.java       |    3 +-
 .../execute/task/InnerSpaceCompactionTask.java     |   14 +-
 .../execute/task/SettleCompactionTask.java         |    4 +
 .../dataregion/tsfile/TsFileResource.java          |   43 +-
 .../db/storageengine/load/LoadTsFileManager.java   |   14 +
 .../load/active/ActiveLoadDirScanner.java          |   46 +-
 .../load/active/ActiveLoadPathHelper.java          |  282 +++
 .../load/active/ActiveLoadPendingQueue.java        |   17 +-
 .../load/active/ActiveLoadTsFileLoader.java        |   42 +-
 .../load/config/LoadTsFileConfigurator.java        |   18 +
 ...leStatementDataTypeConvertExecutionVisitor.java |   10 +-
 ...eeStatementDataTypeConvertExecutionVisitor.java |   10 +-
 .../db/storageengine/load/disk/MinIOSelector.java  |   10 +-
 .../ActiveLoadUtil.java => util/LoadUtil.java}     |   88 +-
 .../db/utils/datastructure/AlignedTVList.java      |   16 +-
 .../iotdb/db/utils/datastructure/TVList.java       |    2 +-
 .../db/metadata/path/MeasurementPathTest.java      |    4 +-
 .../db/pipe/pattern/TreePatternCoverageTest.java   |  133 ++
 .../PipeStatementTreePatternParseVisitorTest.java  |  202 +-
 .../PipePlanTreePatternParseVisitorTest.java       |    7 +-
 .../compaction/utils/CompactionTestFileWriter.java |    6 +-
 .../memtable/AlignedTVListIteratorTest.java        |   57 +
 iotdb-core/node-commons/pom.xml                    |    8 +-
 .../conf/iotdb-system.properties.template          |    4 +-
 .../iotdb/commons/client/ClientPoolFactory.java    |   52 -
 .../apache/iotdb/commons/client/ThriftClient.java  |    3 +-
 .../commons/client/ainode/AINodeClientManager.java |   40 -
 .../apache/iotdb/commons/conf/CommonConfig.java    |  156 +-
 .../apache/iotdb/commons/conf/IoTDBConstant.java   |    1 -
 .../apache/iotdb/commons/path/MeasurementPath.java |   26 -
 .../org/apache/iotdb/commons/path/PartialPath.java |   26 +
 .../task/subtask/PipeAbstractSinkSubtask.java      |   13 +
 .../iotdb/commons/pipe/config/PipeConfig.java      |   61 +-
 .../iotdb/commons/pipe/config/PipeDescriptor.java  |   42 +-
 .../pipe/config/constant/PipeSourceConstant.java   |    5 +
 .../datastructure/pattern/IoTDBTreePattern.java    |   68 +-
 .../pattern/IoTDBTreePatternOperations.java        |   52 +
 .../datastructure/pattern/PrefixTreePattern.java   |   70 +-
 .../datastructure/pattern/SingleTreePattern.java   |   59 -
 .../pipe/datastructure/pattern/TreePattern.java    |  369 +++-
 .../pattern/UnionIoTDBTreePattern.java             |  115 +-
 .../datastructure/pattern/UnionTreePattern.java    |   17 +-
 .../pattern/WithExclusionIoTDBTreePattern.java     |  213 ++
 .../pattern/WithExclusionTreePattern.java          |  119 ++
 .../pipe/receiver/PipeReceiverStatusHandler.java   |  152 +-
 .../pipe/source/IoTDBNonDataRegionSource.java      |   14 +-
 .../schema/table/NonCommittableTsTable.java}       |   36 +-
 .../apache/iotdb/commons/schema/table/TsTable.java |   24 +-
 .../service/AbstractThriftServiceThread.java       |   15 +-
 .../org/apache/iotdb/commons/utils/FileUtils.java  |   92 +-
 .../org/apache/iotdb/commons/utils/RetryUtils.java |   59 +-
 .../commons/pipe/task/PipeSleepIntervalTest.java   |   83 +
 .../apache/iotdb/commons/utils/FileUtilsTest.java  |   79 +
 .../src/main/thrift/confignode.thrift              |   83 +-
 .../src/main/thrift/datanode.thrift                |    1 +
 pom.xml                                            |   16 +-
 scripts/conf/ainode-env.sh                         |  138 --
 scripts/conf/windows/ainode-env.bat                |  129 --
 scripts/sbin/start-ainode.sh                       |   56 +-
 scripts/sbin/windows/start-ainode.bat              |   62 +-
 236 files changed, 6294 insertions(+), 5080 deletions(-)
 create mode 100644 iotdb-core/ainode/ainode.spec
 create mode 100644 iotdb-core/ainode/build_binary.py
 delete mode 100644 iotdb-core/ainode/poetry.lock
 rename iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/state/schema/{DeleteStorageGroupState.java => DeleteDatabaseState.java} (96%)
 create mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/AINodeClientFactory.java
 rename iotdb-core/{node-commons/src/main/java/org/apache/iotdb/commons => datanode/src/main/java/org/apache/iotdb/db/protocol}/client/ainode/AINodeClient.java (74%)
 create mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ainode/AINodeClientManager.java
 rename iotdb-core/{node-commons/src/main/java/org/apache/iotdb/commons => datanode/src/main/java/org/apache/iotdb/db/protocol}/client/ainode/AsyncAINodeServiceClient.java (98%)
 create mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPathHelper.java
 rename iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/{active/ActiveLoadUtil.java => util/LoadUtil.java} (61%)
 create mode 100644 iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/TreePatternCoverageTest.java
 delete mode 100644 iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClientManager.java
 create mode 100644 iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePatternOperations.java
 delete mode 100644 iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/SingleTreePattern.java
 create mode 100644 iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/WithExclusionIoTDBTreePattern.java
 create mode 100644 iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/WithExclusionTreePattern.java
 copy iotdb-core/{datanode/src/main/java/org/apache/iotdb/db/pipe/processor/twostage/state/CountState.java => node-commons/src/main/java/org/apache/iotdb/commons/schema/table/NonCommittableTsTable.java} (60%)
 create mode 100644 iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/pipe/task/PipeSleepIntervalTest.java
 create mode 100644 iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/utils/FileUtilsTest.java
 delete mode 100644 scripts/conf/ainode-env.sh
 delete mode 100644 scripts/conf/windows/ainode-env.bat


(iotdb) 43/45: Pipe: Adjusted the waiting time of temporary unavailable exceptions (#16798)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit e34e0fcb929b1885aab0abdf315a7f52a10ae60a
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Tue Nov 25 18:40:18 2025 +0800

    Pipe: Adjusted the waiting time of temporary unavailable exceptions (#16798)
    
    * fff
    
    * fix
    
    * fix
    
    * fix
    
    * fix
    
    * f
    
    (cherry picked from commit 4525d0758673ddb6ae78f0bd2d7c365ec5ba2c8c)
---
 .../pipe/agent/task/PipeConfigNodeSubtask.java     |  6 +-
 .../agent/task/subtask/sink/PipeSinkSubtask.java   |  4 +-
 .../apache/iotdb/commons/conf/CommonConfig.java    | 29 ++++++++
 .../task/subtask/PipeAbstractSinkSubtask.java      | 13 ++++
 .../iotdb/commons/pipe/config/PipeConfig.java      | 10 +++
 .../iotdb/commons/pipe/config/PipeDescriptor.java  | 11 +++
 .../commons/pipe/task/PipeSleepIntervalTest.java   | 83 ++++++++++++++++++++++
 7 files changed, 154 insertions(+), 2 deletions(-)

diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/agent/task/PipeConfigNodeSubtask.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/agent/task/PipeConfigNodeSubtask.java
index 2403e353b56..e922c23321a 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/agent/task/PipeConfigNodeSubtask.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/agent/task/PipeConfigNodeSubtask.java
@@ -19,11 +19,13 @@
 
 package org.apache.iotdb.confignode.manager.pipe.agent.task;
 
+import org.apache.iotdb.commons.exception.pipe.PipeNonReportException;
 import org.apache.iotdb.commons.exception.pipe.PipeRuntimeException;
 import org.apache.iotdb.commons.pipe.agent.plugin.builtin.BuiltinPipePlugin;
 import org.apache.iotdb.commons.pipe.agent.task.meta.PipeTaskMeta;
 import org.apache.iotdb.commons.pipe.agent.task.progress.PipeEventCommitManager;
 import org.apache.iotdb.commons.pipe.agent.task.subtask.PipeAbstractSinkSubtask;
+import org.apache.iotdb.commons.pipe.config.PipeConfig;
 import org.apache.iotdb.commons.pipe.config.constant.PipeProcessorConstant;
 import org.apache.iotdb.commons.pipe.config.plugin.configuraion.PipeTaskRuntimeConfiguration;
 import org.apache.iotdb.commons.pipe.config.plugin.env.PipeTaskProcessorRuntimeEnvironment;
@@ -188,7 +190,9 @@ public class PipeConfigNodeSubtask extends PipeAbstractSinkSubtask {
         PipeConfigRegionSinkMetrics.getInstance().markConfigEvent(taskID);
       }
       decreaseReferenceCountAndReleaseLastEvent(event, true);
-
+      sleepInterval = PipeConfig.getInstance().getPipeSinkSubtaskSleepIntervalInitMs();
+    } catch (final PipeNonReportException e) {
+      sleep4NonReportException();
     } catch (final PipeException e) {
       setLastExceptionEvent(event);
       if (!isClosed.get()) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/subtask/sink/PipeSinkSubtask.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/subtask/sink/PipeSinkSubtask.java
index 308ddfb90d2..8a86db3ded5 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/subtask/sink/PipeSinkSubtask.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/subtask/sink/PipeSinkSubtask.java
@@ -23,6 +23,7 @@ import org.apache.iotdb.commons.exception.pipe.PipeNonReportException;
 import org.apache.iotdb.commons.exception.pipe.PipeRuntimeException;
 import org.apache.iotdb.commons.pipe.agent.task.connection.UnboundedBlockingPendingQueue;
 import org.apache.iotdb.commons.pipe.agent.task.subtask.PipeAbstractSinkSubtask;
+import org.apache.iotdb.commons.pipe.config.PipeConfig;
 import org.apache.iotdb.commons.pipe.event.EnrichedEvent;
 import org.apache.iotdb.commons.pipe.sink.protocol.IoTDBSink;
 import org.apache.iotdb.db.pipe.agent.PipeDataNodeAgent;
@@ -132,8 +133,9 @@ public class PipeSinkSubtask extends PipeAbstractSinkSubtask {
       }
 
       decreaseReferenceCountAndReleaseLastEvent(event, true);
+      sleepInterval = PipeConfig.getInstance().getPipeSinkSubtaskSleepIntervalInitMs();
     } catch (final PipeNonReportException e) {
-      // Ignore, go directly next round
+      sleep4NonReportException();
     } catch (final PipeException e) {
       if (!isClosed.get()) {
         setLastExceptionEvent(event);
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index d83e96eb100..cd0645adf4c 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -254,6 +254,9 @@ public class CommonConfig {
   private long pipeSubtaskExecutorBasicCheckPointIntervalByTimeDuration = 10 * 1000L;
   private long pipeSubtaskExecutorPendingQueueMaxBlockingTimeMs = 50;
 
+  private volatile long pipeSinkSubtaskSleepIntervalInitMs = 250L;
+  private volatile long pipeSinkSubtaskSleepIntervalMaxMs = 1000L;
+
   private long pipeSubtaskExecutorCronHeartbeatEventIntervalSeconds = 20;
 
   private long pipeMaxWaitFinishTime = 10 * 1000;
@@ -1415,6 +1418,32 @@ public class CommonConfig {
         "pipeRetryLocallyForParallelOrUserConflict is set to {}.", pipeSubtaskExecutorMaxThreadNum);
   }
 
+  public long getPipeSinkSubtaskSleepIntervalInitMs() {
+    return pipeSinkSubtaskSleepIntervalInitMs;
+  }
+
+  public void setPipeSinkSubtaskSleepIntervalInitMs(long pipeSinkSubtaskSleepIntervalInitMs) {
+    if (this.pipeSinkSubtaskSleepIntervalInitMs == pipeSinkSubtaskSleepIntervalInitMs) {
+      return;
+    }
+    this.pipeSinkSubtaskSleepIntervalInitMs = pipeSinkSubtaskSleepIntervalInitMs;
+    logger.info(
+        "pipeSinkSubtaskSleepIntervalInitMs is set to {}.", pipeSinkSubtaskSleepIntervalInitMs);
+  }
+
+  public long getPipeSinkSubtaskSleepIntervalMaxMs() {
+    return pipeSinkSubtaskSleepIntervalMaxMs;
+  }
+
+  public void setPipeSinkSubtaskSleepIntervalMaxMs(long pipeSinkSubtaskSleepIntervalMaxMs) {
+    if (this.pipeSinkSubtaskSleepIntervalMaxMs == pipeSinkSubtaskSleepIntervalMaxMs) {
+      return;
+    }
+    this.pipeSinkSubtaskSleepIntervalMaxMs = pipeSinkSubtaskSleepIntervalMaxMs;
+    logger.info(
+        "pipeSinkSubtaskSleepIntervalMaxMs is set to {}.", pipeSinkSubtaskSleepIntervalMaxMs);
+  }
+
   public long getPipeSubtaskExecutorPendingQueueMaxBlockingTimeMs() {
     return pipeSubtaskExecutorPendingQueueMaxBlockingTimeMs;
   }
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/subtask/PipeAbstractSinkSubtask.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/subtask/PipeAbstractSinkSubtask.java
index 66d43e0743c..09083d45bca 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/subtask/PipeAbstractSinkSubtask.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/subtask/PipeAbstractSinkSubtask.java
@@ -53,6 +53,8 @@ public abstract class PipeAbstractSinkSubtask extends PipeReportableSubtask {
   @SuppressWarnings("java:S3077")
   protected volatile Event lastExceptionEvent;
 
+  protected long sleepInterval = PipeConfig.getInstance().getPipeSinkSubtaskSleepIntervalInitMs();
+
   protected PipeAbstractSinkSubtask(
       final String taskID, final long creationTime, final PipeConnector outputPipeSink) {
     super(taskID, creationTime);
@@ -248,4 +250,15 @@ public abstract class PipeAbstractSinkSubtask extends PipeReportableSubtask {
       lastExceptionEvent = null;
     }
   }
+
+  public void sleep4NonReportException() {
+    if (sleepInterval < PipeConfig.getInstance().getPipeSinkSubtaskSleepIntervalMaxMs()) {
+      sleepInterval <<= 1;
+    }
+    try {
+      Thread.sleep(sleepInterval);
+    } catch (final InterruptedException e) {
+      Thread.currentThread().interrupt();
+    }
+  }
 }
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java
index ce09fb1f291..1ed1e39911f 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java
@@ -143,6 +143,14 @@ public class PipeConfig {
     return COMMON_CONFIG.getPipeMaxWaitFinishTime();
   }
 
+  public long getPipeSinkSubtaskSleepIntervalInitMs() {
+    return COMMON_CONFIG.getPipeSinkSubtaskSleepIntervalInitMs();
+  }
+
+  public long getPipeSinkSubtaskSleepIntervalMaxMs() {
+    return COMMON_CONFIG.getPipeSinkSubtaskSleepIntervalMaxMs();
+  }
+
   /////////////////////////////// Source ///////////////////////////////
 
   public int getPipeSourceAssignerDisruptorRingBufferSize() {
@@ -484,6 +492,8 @@ public class PipeConfig {
         "PipeSubtaskExecutorCronHeartbeatEventIntervalSeconds: {}",
         getPipeSubtaskExecutorCronHeartbeatEventIntervalSeconds());
     LOGGER.info("PipeMaxWaitFinishTime: {}", getPipeMaxWaitFinishTime());
+    LOGGER.info("PipeSinkSubtaskSleepIntervalInitMs: {}", getPipeSinkSubtaskSleepIntervalInitMs());
+    LOGGER.info("PipeSinkSubtaskSleepIntervalMaxMs: {}", getPipeSinkSubtaskSleepIntervalMaxMs());
 
     LOGGER.info(
         "PipeSourceAssignerDisruptorRingBufferSize: {}",
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java
index 928ff5f25a5..cbe4dd25e83 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java
@@ -296,6 +296,17 @@ public class PipeDescriptor {
                 "pipe_retry_locally_for_user_conflict",
                 String.valueOf(config.isPipeRetryLocallyForParallelOrUserConflict()))));
 
+    config.setPipeSinkSubtaskSleepIntervalInitMs(
+        Long.parseLong(
+            properties.getProperty(
+                "pipe_sink_subtask_sleep_interval_init_ms",
+                String.valueOf(config.getPipeSinkSubtaskSleepIntervalInitMs()))));
+    config.setPipeSinkSubtaskSleepIntervalMaxMs(
+        Long.parseLong(
+            properties.getProperty(
+                "pipe_sink_subtask_sleep_interval_max_ms",
+                String.valueOf(config.getPipeSinkSubtaskSleepIntervalMaxMs()))));
+
     config.setPipeSourceAssignerDisruptorRingBufferSize(
         Integer.parseInt(
             Optional.ofNullable(
diff --git a/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/pipe/task/PipeSleepIntervalTest.java b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/pipe/task/PipeSleepIntervalTest.java
new file mode 100644
index 00000000000..07ae50e992e
--- /dev/null
+++ b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/pipe/task/PipeSleepIntervalTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.pipe.task;
+
+import org.apache.iotdb.commons.conf.CommonConfig;
+import org.apache.iotdb.commons.conf.CommonDescriptor;
+import org.apache.iotdb.commons.exception.pipe.PipeRuntimeException;
+import org.apache.iotdb.commons.pipe.agent.task.subtask.PipeAbstractSinkSubtask;
+import org.apache.iotdb.commons.pipe.config.PipeConfig;
+import org.apache.iotdb.commons.pipe.event.EnrichedEvent;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class PipeSleepIntervalTest {
+  private long oldPipeSinkSubtaskSleepIntervalInitMs;
+  private long oldPipeSinkSubtaskSleepIntervalMaxMs;
+
+  @Before
+  public void setUp() throws Exception {
+    final CommonConfig config = CommonDescriptor.getInstance().getConfig();
+    oldPipeSinkSubtaskSleepIntervalInitMs = config.getPipeSinkSubtaskSleepIntervalInitMs();
+    oldPipeSinkSubtaskSleepIntervalMaxMs = config.getPipeSinkSubtaskSleepIntervalMaxMs();
+    config.setPipeSinkSubtaskSleepIntervalInitMs(25L);
+    config.setPipeSinkSubtaskSleepIntervalMaxMs(50L);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    final CommonConfig config = CommonDescriptor.getInstance().getConfig();
+    config.setPipeSinkSubtaskSleepIntervalInitMs(oldPipeSinkSubtaskSleepIntervalInitMs);
+    config.setPipeSinkSubtaskSleepIntervalMaxMs(oldPipeSinkSubtaskSleepIntervalMaxMs);
+  }
+
+  @Test
+  public void test() {
+    try (final PipeAbstractSinkSubtask subtask =
+        new PipeAbstractSinkSubtask(null, 0, null) {
+          @Override
+          protected String getRootCause(Throwable throwable) {
+            return null;
+          }
+
+          @Override
+          protected void report(EnrichedEvent event, PipeRuntimeException exception) {}
+
+          @Override
+          protected boolean executeOnce() {
+            return false;
+          }
+        }) {
+      long startTime = System.currentTimeMillis();
+      subtask.sleep4NonReportException();
+      Assert.assertTrue(
+          System.currentTimeMillis() - startTime
+              >= PipeConfig.getInstance().getPipeSinkSubtaskSleepIntervalInitMs());
+      startTime = System.currentTimeMillis() - startTime;
+      subtask.sleep4NonReportException();
+      Assert.assertTrue(
+          System.currentTimeMillis() - startTime
+              >= PipeConfig.getInstance().getPipeSinkSubtaskSleepIntervalInitMs());
+    }
+  }
+}


(iotdb) 06/45: chore!: Bind real config address for Thrift and Raft services (#16717)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 26b5ae3bb188be2ea8b18820aaf0b7e0de14c620
Author: CritasWang <cr...@outlook.com>
AuthorDate: Tue Nov 11 10:44:50 2025 +0800

    chore!: Bind real config address for Thrift and Raft services (#16717)
    
    * chore: Bind real internal address for Thrift and Raft services
    
    * keep ExternalRpcAddress use config value
    
    * Update iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/ExternalRPCService.java
    
    Co-authored-by: Haonan <hh...@outlook.com>
    
    ---------
    
    Co-authored-by: Haonan <hh...@outlook.com>
    (cherry picked from commit 8dbf2003cfde4c2f68fa5fd4e3110c5e7aa334b5)
---
 .../org/apache/iotdb/consensus/ratis/RatisConsensus.java  |  1 +
 .../commons/service/AbstractThriftServiceThread.java      | 15 +++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
index 045fa779174..265192858bf 100644
--- a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
+++ b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
@@ -157,6 +157,7 @@ class RatisConsensus implements IConsensus {
     this.storageDir = new File(config.getStorageDir());
 
     RaftServerConfigKeys.setStorageDir(properties, Collections.singletonList(storageDir));
+    GrpcConfigKeys.Server.setHost(properties, config.getThisNodeEndPoint().getIp());
     GrpcConfigKeys.Server.setPort(properties, config.getThisNodeEndPoint().getPort());
 
     this.parameters = Utils.initRatisConfig(properties, config.getRatisConfig());
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java
index 39b11ba677a..1bcf15dbc23 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/service/AbstractThriftServiceThread.java
@@ -320,14 +320,21 @@ public abstract class AbstractThriftServiceThread extends Thread {
 
   @SuppressWarnings("java:S2259")
   private TServerTransport openTransport(String bindAddress, int port) throws TTransportException {
-    // bind any address
-    return new TServerSocket(new InetSocketAddress(port));
+    if (bindAddress == null) {
+      // bind any address
+      return new TServerSocket(new InetSocketAddress(port));
+    }
+    return new TServerSocket(new InetSocketAddress(bindAddress, port));
   }
 
   private TServerTransport openNonblockingTransport(
       String bindAddress, int port, int connectionTimeoutInMS) throws TTransportException {
-    // bind any address
-    return new TNonblockingServerSocket(new InetSocketAddress(port), connectionTimeoutInMS);
+    if (bindAddress == null) {
+      // bind any address
+      return new TNonblockingServerSocket(new InetSocketAddress(port), connectionTimeoutInMS);
+    }
+    return new TNonblockingServerSocket(
+        new InetSocketAddress(bindAddress, port), connectionTimeoutInMS);
   }
 
   public void setThreadStopLatch(CountDownLatch threadStopLatch) {


(iotdb) 17/45: Pipe: Optimized the default behavior in meta sync for retries to wait for other regions (#16740)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 92878f4ad9387339ed2c510646cae2da05e6dc7f
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Wed Nov 12 21:46:37 2025 +0800

    Pipe: Optimized the default behavior in meta sync for retries to wait for other regions (#16740)
    
    * partial
    
    * cfg
    
    * core
    
    * fix
    
    * fix
    
    (cherry picked from commit 6e8748e02561df3bc90aaab650ea245e95e4645a)
---
 .../java/org/apache/iotdb/rpc/TSStatusCode.java    |  1 +
 .../db/pipe/agent/task/PipeDataNodeTaskAgent.java  |  4 +-
 .../visitor/PipeStatementTSStatusVisitor.java      | 37 +++++++++++--
 .../realtime/assigner/DisruptorQueue.java          |  4 +-
 .../schemaengine/schemaregion/utils/MetaUtils.java |  6 +--
 .../apache/iotdb/commons/conf/CommonConfig.java    | 60 ++++++++++++++--------
 .../iotdb/commons/pipe/config/PipeConfig.java      | 33 +++++++-----
 .../iotdb/commons/pipe/config/PipeDescriptor.java  | 15 +++---
 .../pipe/receiver/PipeReceiverStatusHandler.java   | 18 ++++---
 9 files changed, 119 insertions(+), 59 deletions(-)

diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java
index 84534adfadb..4fd90ca4b94 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java
@@ -295,6 +295,7 @@ public enum TSStatusCode {
   PIPE_TRANSFER_SLICE_OUT_OF_ORDER(1812),
   PIPE_PUSH_META_TIMEOUT(1813),
   PIPE_PUSH_META_NOT_ENOUGH_MEMORY(1814),
+  PIPE_RECEIVER_PARALLEL_OR_USER_CONFLICT_EXCEPTION(1815),
 
   // Subscription
   SUBSCRIPTION_VERSION_ERROR(1900),
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/PipeDataNodeTaskAgent.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/PipeDataNodeTaskAgent.java
index 87e744985f8..438dfa3f233 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/PipeDataNodeTaskAgent.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/PipeDataNodeTaskAgent.java
@@ -892,8 +892,8 @@ public class PipeDataNodeTaskAgent extends PipeTaskAgent {
               .getLeft()) {
         return 0;
       }
-      return PipeConfig.getInstance().getPipeExtractorAssignerDisruptorRingBufferSize()
-          * PipeConfig.getInstance().getPipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes()
+      return PipeConfig.getInstance().getPipeSourceAssignerDisruptorRingBufferSize()
+          * PipeConfig.getInstance().getPipeSourceAssignerDisruptorRingBufferEntrySizeInBytes()
           * Math.min(StorageEngine.getInstance().getDataRegionNumber(), 10);
     } catch (final IllegalPathException e) {
       return 0;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTSStatusVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTSStatusVisitor.java
index 882485a6c72..31eecc7b3a9 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTSStatusVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTSStatusVisitor.java
@@ -106,11 +106,22 @@ public class PipeStatementTSStatusVisitor extends StatementVisitor<TSStatus, TSS
     } else if (context.getCode() == TSStatusCode.OUT_OF_TTL.getStatusCode()) {
       return new TSStatus(TSStatusCode.PIPE_RECEIVER_IDEMPOTENT_CONFLICT_EXCEPTION.getStatusCode())
           .setMessage(context.getMessage());
-    } else if (context.getCode() == TSStatusCode.METADATA_ERROR.getStatusCode()
-        && (context.getMessage().contains(DataTypeMismatchException.REGISTERED_TYPE_STRING)
-            && config.isEnablePartialInsert())) {
-      return new TSStatus(TSStatusCode.PIPE_RECEIVER_IDEMPOTENT_CONFLICT_EXCEPTION.getStatusCode())
+    } else if (context.getCode() == TSStatusCode.DATABASE_NOT_EXIST.getStatusCode()) {
+      return new TSStatus(
+              TSStatusCode.PIPE_RECEIVER_PARALLEL_OR_USER_CONFLICT_EXCEPTION.getStatusCode())
           .setMessage(context.getMessage());
+    } else if (context.getCode() == TSStatusCode.METADATA_ERROR.getStatusCode()) {
+      if (context.getMessage().contains(DataTypeMismatchException.REGISTERED_TYPE_STRING)
+          && config.isEnablePartialInsert()) {
+        return new TSStatus(
+                TSStatusCode.PIPE_RECEIVER_IDEMPOTENT_CONFLICT_EXCEPTION.getStatusCode())
+            .setMessage(context.getMessage());
+      }
+      if (context.getMessage().contains("does not exist")) {
+        return new TSStatus(
+                TSStatusCode.PIPE_RECEIVER_PARALLEL_OR_USER_CONFLICT_EXCEPTION.getStatusCode())
+            .setMessage(context.getMessage());
+      }
     }
     return visitStatement(insertBaseStatement, context);
   }
@@ -226,14 +237,24 @@ public class PipeStatementTSStatusVisitor extends StatementVisitor<TSStatus, TSS
   @Override
   public TSStatus visitBatchActivateTemplate(
       final BatchActivateTemplateStatement batchActivateTemplateStatement, final TSStatus context) {
+    boolean userConflict = false;
     if (context.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
       for (final TSStatus status : context.getSubStatus()) {
         if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()
             && status.getCode() != TSStatusCode.TEMPLATE_IS_IN_USE.getStatusCode()) {
           return visitStatement(batchActivateTemplateStatement, context);
         }
+        if (context.getCode() == TSStatusCode.METADATA_ERROR.getStatusCode()
+            && context.isSetMessage()
+            && context.getMessage().contains("has not been set any template")) {
+          userConflict = true;
+        }
       }
-      return new TSStatus(TSStatusCode.PIPE_RECEIVER_IDEMPOTENT_CONFLICT_EXCEPTION.getStatusCode())
+      return (userConflict
+              ? new TSStatus(
+                  TSStatusCode.PIPE_RECEIVER_PARALLEL_OR_USER_CONFLICT_EXCEPTION.getStatusCode())
+              : new TSStatus(
+                  TSStatusCode.PIPE_RECEIVER_IDEMPOTENT_CONFLICT_EXCEPTION.getStatusCode()))
           .setMessage(context.getMessage());
     }
     return visitGeneralActivateTemplate(batchActivateTemplateStatement, context);
@@ -245,6 +266,12 @@ public class PipeStatementTSStatusVisitor extends StatementVisitor<TSStatus, TSS
       return new TSStatus(TSStatusCode.PIPE_RECEIVER_IDEMPOTENT_CONFLICT_EXCEPTION.getStatusCode())
           .setMessage(context.getMessage());
     }
+    if (context.getCode() == TSStatusCode.METADATA_ERROR.getStatusCode()
+        && context.isSetMessage()
+        && context.getMessage().contains("has not been set any template")) {
+      return new TSStatus(TSStatusCode.PIPE_RECEIVER_USER_CONFLICT_EXCEPTION.getStatusCode())
+          .setMessage(context.getMessage());
+    }
     return visitStatement(activateTemplateStatement, context);
   }
 }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/realtime/assigner/DisruptorQueue.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/realtime/assigner/DisruptorQueue.java
index cb4aba1e15a..fc30f14be5b 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/realtime/assigner/DisruptorQueue.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/realtime/assigner/DisruptorQueue.java
@@ -49,9 +49,9 @@ public class DisruptorQueue {
       final EventHandler<PipeRealtimeEvent> eventHandler,
       final Consumer<PipeRealtimeEvent> onAssignedHook) {
     final PipeConfig config = PipeConfig.getInstance();
-    final int ringBufferSize = config.getPipeExtractorAssignerDisruptorRingBufferSize();
+    final int ringBufferSize = config.getPipeSourceAssignerDisruptorRingBufferSize();
     final long ringBufferEntrySizeInBytes =
-        config.getPipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes();
+        config.getPipeSourceAssignerDisruptorRingBufferEntrySizeInBytes();
 
     allocatedMemoryBlock =
         PipeDataNodeResourceManager.memory()
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/MetaUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/MetaUtils.java
index fae3a21fd68..11b41b238a3 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/MetaUtils.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/utils/MetaUtils.java
@@ -70,9 +70,9 @@ public class MetaUtils {
       throw new IllegalPathException(
           path.getFullPath(), "it does not start with " + IoTDBConstant.PATH_ROOT);
     }
-    String[] storageGroupNodes = new String[level + 1];
-    System.arraycopy(nodeNames, 0, storageGroupNodes, 0, level + 1);
-    return new PartialPath(storageGroupNodes);
+    String[] databaseNodes = new String[level + 1];
+    System.arraycopy(nodeNames, 0, databaseNodes, 0, level + 1);
+    return new PartialPath(databaseNodes);
   }
 
   /**
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index 43a637d5c2c..9102a117eca 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -214,6 +214,8 @@ public class CommonConfig {
   private int pipeSubtaskExecutorMaxThreadNum =
       Math.max(5, Runtime.getRuntime().availableProcessors() / 2);
 
+  private boolean pipeRetryLocallyForParallelOrUserConflict = true;
+
   private int pipeDataStructureTabletRowSize = 2048;
   private int pipeDataStructureTabletSizeInBytes = 2097152;
   private double pipeDataStructureTabletMemoryBlockAllocationRejectThreshold = 0.3;
@@ -256,8 +258,8 @@ public class CommonConfig {
 
   private long pipeMaxWaitFinishTime = 10 * 1000;
 
-  private int pipeExtractorAssignerDisruptorRingBufferSize = 128;
-  private long pipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes = 72 * KB;
+  private int pipeSourceAssignerDisruptorRingBufferSize = 128;
+  private long pipeSourceAssignerDisruptorRingBufferEntrySizeInBytes = 72 * KB;
   private long pipeSourceMatcherCacheSize = 1024;
 
   private int pipeConnectorHandshakeTimeoutMs = 10 * 1000; // 10 seconds
@@ -996,38 +998,37 @@ public class CommonConfig {
         "pipeTotalFloatingMemoryProportion is set to {}.", pipeTotalFloatingMemoryProportion);
   }
 
-  public int getPipeExtractorAssignerDisruptorRingBufferSize() {
-    return pipeExtractorAssignerDisruptorRingBufferSize;
+  public int getPipeSourceAssignerDisruptorRingBufferSize() {
+    return pipeSourceAssignerDisruptorRingBufferSize;
   }
 
-  public void setPipeExtractorAssignerDisruptorRingBufferSize(
-      int pipeExtractorAssignerDisruptorRingBufferSize) {
-    if (this.pipeExtractorAssignerDisruptorRingBufferSize
-        == pipeExtractorAssignerDisruptorRingBufferSize) {
+  public void setPipeSourceAssignerDisruptorRingBufferSize(
+      int pipeSourceAssignerDisruptorRingBufferSize) {
+    if (this.pipeSourceAssignerDisruptorRingBufferSize
+        == pipeSourceAssignerDisruptorRingBufferSize) {
       return;
     }
-    this.pipeExtractorAssignerDisruptorRingBufferSize =
-        pipeExtractorAssignerDisruptorRingBufferSize;
+    this.pipeSourceAssignerDisruptorRingBufferSize = pipeSourceAssignerDisruptorRingBufferSize;
     logger.info(
-        "pipeExtractorAssignerDisruptorRingBufferSize is set to {}.",
-        pipeExtractorAssignerDisruptorRingBufferSize);
+        "pipeSourceAssignerDisruptorRingBufferSize is set to {}.",
+        pipeSourceAssignerDisruptorRingBufferSize);
   }
 
-  public long getPipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes() {
-    return pipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes;
+  public long getPipeSourceAssignerDisruptorRingBufferEntrySizeInBytes() {
+    return pipeSourceAssignerDisruptorRingBufferEntrySizeInBytes;
   }
 
-  public void setPipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes(
-      long pipeExtractorAssignerDisruptorRingBufferEntrySize) {
-    if (pipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes
-        == pipeExtractorAssignerDisruptorRingBufferEntrySize) {
+  public void setPipeSourceAssignerDisruptorRingBufferEntrySizeInBytes(
+      long pipeSourceAssignerDisruptorRingBufferEntrySize) {
+    if (pipeSourceAssignerDisruptorRingBufferEntrySizeInBytes
+        == pipeSourceAssignerDisruptorRingBufferEntrySize) {
       return;
     }
-    this.pipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes =
-        pipeExtractorAssignerDisruptorRingBufferEntrySize;
+    this.pipeSourceAssignerDisruptorRingBufferEntrySizeInBytes =
+        pipeSourceAssignerDisruptorRingBufferEntrySize;
     logger.info(
-        "pipeExtractorAssignerDisruptorRingBufferEntrySize is set to {}.",
-        pipeExtractorAssignerDisruptorRingBufferEntrySize);
+        "pipeSourceAssignerDisruptorRingBufferEntrySize is set to {}.",
+        pipeSourceAssignerDisruptorRingBufferEntrySize);
   }
 
   public long getPipeSourceMatcherCacheSize() {
@@ -1400,6 +1401,21 @@ public class CommonConfig {
     logger.info("pipeSubtaskExecutorMaxThreadNum is set to {}.", pipeSubtaskExecutorMaxThreadNum);
   }
 
+  public boolean isPipeRetryLocallyForParallelOrUserConflict() {
+    return pipeRetryLocallyForParallelOrUserConflict;
+  }
+
+  public void setPipeRetryLocallyForParallelOrUserConflict(
+      boolean pipeRetryLocallyForParallelOrUserConflict) {
+    if (this.pipeRetryLocallyForParallelOrUserConflict
+        == pipeRetryLocallyForParallelOrUserConflict) {
+      return;
+    }
+    this.pipeRetryLocallyForParallelOrUserConflict = pipeRetryLocallyForParallelOrUserConflict;
+    logger.info(
+        "pipeRetryLocallyForParallelOrUserConflict is set to {}.", pipeSubtaskExecutorMaxThreadNum);
+  }
+
   public long getPipeSubtaskExecutorPendingQueueMaxBlockingTimeMs() {
     return pipeSubtaskExecutorPendingQueueMaxBlockingTimeMs;
   }
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java
index 4e840d51c55..637628149b6 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java
@@ -143,14 +143,14 @@ public class PipeConfig {
     return COMMON_CONFIG.getPipeMaxWaitFinishTime();
   }
 
-  /////////////////////////////// Extractor ///////////////////////////////
+  /////////////////////////////// Source ///////////////////////////////
 
-  public int getPipeExtractorAssignerDisruptorRingBufferSize() {
-    return COMMON_CONFIG.getPipeExtractorAssignerDisruptorRingBufferSize();
+  public int getPipeSourceAssignerDisruptorRingBufferSize() {
+    return COMMON_CONFIG.getPipeSourceAssignerDisruptorRingBufferSize();
   }
 
-  public long getPipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes() {
-    return COMMON_CONFIG.getPipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes();
+  public long getPipeSourceAssignerDisruptorRingBufferEntrySizeInBytes() {
+    return COMMON_CONFIG.getPipeSourceAssignerDisruptorRingBufferEntrySizeInBytes();
   }
 
   public long getPipeSourceMatcherCacheSize() {
@@ -337,8 +337,8 @@ public class PipeConfig {
     return COMMON_CONFIG.getPipePeriodicalLogMinIntervalSeconds();
   }
 
-  public long getPipeLoggerCacheMaxSizeInBytes() {
-    return COMMON_CONFIG.getPipeLoggerCacheMaxSizeInBytes();
+  public boolean isPipeRetryLocallyForParallelOrUserConflict() {
+    return COMMON_CONFIG.isPipeRetryLocallyForParallelOrUserConflict();
   }
 
   /////////////////////////////// Logger ///////////////////////////////
@@ -359,6 +359,10 @@ public class PipeConfig {
     return COMMON_CONFIG.getPipeTsFilePinMaxLogIntervalRounds();
   }
 
+  public long getPipeLoggerCacheMaxSizeInBytes() {
+    return COMMON_CONFIG.getPipeLoggerCacheMaxSizeInBytes();
+  }
+
   /////////////////////////////// Memory ///////////////////////////////
 
   public boolean getPipeMemoryManagementEnabled() {
@@ -482,12 +486,12 @@ public class PipeConfig {
     LOGGER.info("PipeMaxWaitFinishTime: {}", getPipeMaxWaitFinishTime());
 
     LOGGER.info(
-        "PipeExtractorAssignerDisruptorRingBufferSize: {}",
-        getPipeExtractorAssignerDisruptorRingBufferSize());
+        "PipeSourceAssignerDisruptorRingBufferSize: {}",
+        getPipeSourceAssignerDisruptorRingBufferSize());
     LOGGER.info(
-        "PipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes: {}",
-        getPipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes());
-    LOGGER.info("PipeExtractorMatcherCacheSize: {}", getPipeSourceMatcherCacheSize());
+        "PipeSourceAssignerDisruptorRingBufferEntrySizeInBytes: {}",
+        getPipeSourceAssignerDisruptorRingBufferEntrySizeInBytes());
+    LOGGER.info("PipeSourceMatcherCacheSize: {}", getPipeSourceMatcherCacheSize());
 
     LOGGER.info("PipeConnectorHandshakeTimeoutMs: {}", getPipeConnectorHandshakeTimeoutMs());
     LOGGER.info("PipeConnectorTransferTimeoutMs: {}", getPipeConnectorTransferTimeoutMs());
@@ -592,12 +596,15 @@ public class PipeConfig {
     LOGGER.info("PipeReceiverLoadConversionEnabled: {}", isPipeReceiverLoadConversionEnabled());
     LOGGER.info(
         "PipePeriodicalLogMinIntervalSeconds: {}", getPipePeriodicalLogMinIntervalSeconds());
-    LOGGER.info("PipeLoggerCacheMaxSizeInBytes: {}", getPipeLoggerCacheMaxSizeInBytes());
+    LOGGER.info(
+        "PipeRetryLocallyForParallelOrUserConflict: {}",
+        isPipeRetryLocallyForParallelOrUserConflict());
 
     LOGGER.info("PipeMetaReportMaxLogNumPerRound: {}", getPipeMetaReportMaxLogNumPerRound());
     LOGGER.info("PipeMetaReportMaxLogIntervalRounds: {}", getPipeMetaReportMaxLogIntervalRounds());
     LOGGER.info("PipeTsFilePinMaxLogNumPerRound: {}", getPipeTsFilePinMaxLogNumPerRound());
     LOGGER.info("PipeTsFilePinMaxLogIntervalRounds: {}", getPipeTsFilePinMaxLogIntervalRounds());
+    LOGGER.info("PipeLoggerCacheMaxSizeInBytes: {}", getPipeLoggerCacheMaxSizeInBytes());
 
     LOGGER.info("PipeMemoryManagementEnabled: {}", getPipeMemoryManagementEnabled());
     LOGGER.info("PipeMemoryAllocateMaxRetries: {}", getPipeMemoryAllocateMaxRetries());
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java
index 760a7b5e51f..77aae8a3252 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java
@@ -290,17 +290,21 @@ public class PipeDescriptor {
             properties.getProperty(
                 "pipe_subtask_executor_pending_queue_max_blocking_time_ms",
                 String.valueOf(config.getPipeSubtaskExecutorPendingQueueMaxBlockingTimeMs()))));
+    config.setPipeRetryLocallyForParallelOrUserConflict(
+        Boolean.parseBoolean(
+            properties.getProperty(
+                "pipe_retry_locally_for_user_conflict",
+                String.valueOf(config.isPipeRetryLocallyForParallelOrUserConflict()))));
 
-    config.setPipeExtractorAssignerDisruptorRingBufferSize(
+    config.setPipeSourceAssignerDisruptorRingBufferSize(
         Integer.parseInt(
             Optional.ofNullable(
                     properties.getProperty("pipe_source_assigner_disruptor_ring_buffer_size"))
                 .orElse(
                     properties.getProperty(
                         "pipe_extractor_assigner_disruptor_ring_buffer_size",
-                        String.valueOf(
-                            config.getPipeExtractorAssignerDisruptorRingBufferSize())))));
-    config.setPipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes( // 1MB
+                        String.valueOf(config.getPipeSourceAssignerDisruptorRingBufferSize())))));
+    config.setPipeSourceAssignerDisruptorRingBufferEntrySizeInBytes( // 1MB
         Integer.parseInt(
             Optional.ofNullable(
                     properties.getProperty(
@@ -309,8 +313,7 @@ public class PipeDescriptor {
                     properties.getProperty(
                         "pipe_extractor_assigner_disruptor_ring_buffer_entry_size_in_bytes",
                         String.valueOf(
-                            config
-                                .getPipeExtractorAssignerDisruptorRingBufferEntrySizeInBytes())))));
+                            config.getPipeSourceAssignerDisruptorRingBufferEntrySizeInBytes())))));
 
     config.setPipeSourceMatcherCacheSize(
         Integer.parseInt(
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/PipeReceiverStatusHandler.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/PipeReceiverStatusHandler.java
index 3bb9e14d181..350746d7b8e 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/PipeReceiverStatusHandler.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/PipeReceiverStatusHandler.java
@@ -24,6 +24,7 @@ import org.apache.iotdb.commons.exception.pipe.PipeConsensusRetryWithIncreasingI
 import org.apache.iotdb.commons.exception.pipe.PipeNonReportException;
 import org.apache.iotdb.commons.exception.pipe.PipeRuntimeSinkRetryTimesConfigurableException;
 import org.apache.iotdb.commons.pipe.agent.task.subtask.PipeSubtask;
+import org.apache.iotdb.commons.pipe.config.PipeConfig;
 import org.apache.iotdb.commons.pipe.resource.log.PipeLogger;
 import org.apache.iotdb.commons.utils.RetryUtils;
 import org.apache.iotdb.pipe.api.event.Event;
@@ -131,6 +132,7 @@ public class PipeReceiverStatusHandler {
         }
 
       case 1810: // PIPE_RECEIVER_USER_CONFLICT_EXCEPTION
+      case 1815: // PIPE_RECEIVER_PARALLEL_OR_USER_CONFLICT_EXCEPTION
         if (!isRetryAllowedWhenConflictOccurs) {
           LOGGER.warn(
               "User conflict exception: will be ignored because retry is not allowed. event: {}. status: {}",
@@ -165,12 +167,16 @@ public class PipeReceiverStatusHandler {
                       + " seconds",
               status);
           exceptionEventHasBeenRetried.set(true);
-          throw new PipeRuntimeSinkRetryTimesConfigurableException(
-              exceptionMessage,
-              (int)
-                  Math.max(
-                      PipeSubtask.MAX_RETRY_TIMES,
-                      Math.min(CONFLICT_RETRY_MAX_TIMES, retryMaxMillisWhenConflictOccurs * 1.1)));
+          throw status.getCode() == 1815
+                  && PipeConfig.getInstance().isPipeRetryLocallyForParallelOrUserConflict()
+              ? new PipeNonReportException(exceptionMessage)
+              : new PipeRuntimeSinkRetryTimesConfigurableException(
+                  exceptionMessage,
+                  (int)
+                      Math.max(
+                          PipeSubtask.MAX_RETRY_TIMES,
+                          Math.min(
+                              CONFLICT_RETRY_MAX_TIMES, retryMaxMillisWhenConflictOccurs * 1.1)));
         }
 
       case 803: // NO_PERMISSION


(iotdb) 10/45: Optimized the lock for encoding & compressor's invalidate cache (#16733)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 8a3dbcb7db47a98561ddb8620933587be5a20ccc
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Tue Nov 11 19:26:28 2025 +0800

    Optimized the lock for encoding & compressor's invalidate cache (#16733)
    
    * fix
    
    * jr
    
    (cherry picked from commit a6e8493bfc0a910f54d4e9ad7abbb37cfd94bc56)
---
 .../impl/schema/AlterEncodingCompressorProcedure.java         |  2 +-
 .../procedure/impl/schema/DeleteTimeSeriesProcedure.java      |  7 ++++---
 .../protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java  | 11 ++++++++---
 .../thrift-datanode/src/main/thrift/datanode.thrift           |  1 +
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/AlterEncodingCompressorProcedure.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/AlterEncodingCompressorProcedure.java
index f92cc5d2dd8..6f6d4b162d4 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/AlterEncodingCompressorProcedure.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/AlterEncodingCompressorProcedure.java
@@ -132,7 +132,7 @@ public class AlterEncodingCompressorProcedure
           break;
         case CLEAR_CACHE:
           LOGGER.info("Invalidate cache of timeSeries {}", requestMessage);
-          invalidateCache(env, patternTreeBytes, requestMessage, this::setFailure);
+          invalidateCache(env, patternTreeBytes, requestMessage, this::setFailure, false);
           collectPayload4Pipe(env);
           return Flow.NO_MORE_STATE;
         default:
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/DeleteTimeSeriesProcedure.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/DeleteTimeSeriesProcedure.java
index 594b6b035bb..c49f80948fc 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/DeleteTimeSeriesProcedure.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/DeleteTimeSeriesProcedure.java
@@ -122,7 +122,7 @@ public class DeleteTimeSeriesProcedure
           }
         case CLEAN_DATANODE_SCHEMA_CACHE:
           LOGGER.info("Invalidate cache of timeSeries {}", requestMessage);
-          invalidateCache(env, patternTreeBytes, requestMessage, this::setFailure);
+          invalidateCache(env, patternTreeBytes, requestMessage, this::setFailure, true);
           setNextState(DeleteTimeSeriesState.DELETE_DATA);
           break;
         case DELETE_DATA:
@@ -202,13 +202,14 @@ public class DeleteTimeSeriesProcedure
       final ConfigNodeProcedureEnv env,
       final ByteBuffer patternTreeBytes,
       final String requestMessage,
-      final Consumer<ProcedureException> setFailure) {
+      final Consumer<ProcedureException> setFailure,
+      final boolean needLock) {
     final Map<Integer, TDataNodeLocation> dataNodeLocationMap =
         env.getConfigManager().getNodeManager().getRegisteredDataNodeLocations();
     final DataNodeAsyncRequestContext<TInvalidateMatchedSchemaCacheReq, TSStatus> clientHandler =
         new DataNodeAsyncRequestContext<>(
             CnToDnAsyncRequestType.INVALIDATE_MATCHED_SCHEMA_CACHE,
-            new TInvalidateMatchedSchemaCacheReq(patternTreeBytes),
+            new TInvalidateMatchedSchemaCacheReq(patternTreeBytes).setNeedLock(needLock),
             dataNodeLocationMap);
     CnToDnInternalServiceAsyncRequestManager.getInstance().sendAsyncRequestWithRetry(clientHandler);
     final Map<Integer, TSStatus> statusMap = clientHandler.getResponseMap();
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java
index 90d7f20fb25..dcc62fcd3c8 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java
@@ -708,7 +708,10 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
   @Override
   public TSStatus invalidateMatchedSchemaCache(final TInvalidateMatchedSchemaCacheReq req) {
     final TreeDeviceSchemaCacheManager cache = TreeDeviceSchemaCacheManager.getInstance();
-    DataNodeSchemaLockManager.getInstance().takeWriteLock(SchemaLockType.VALIDATE_VS_DELETION_TREE);
+    if (req.needLock || !req.isSetNeedLock()) {
+      DataNodeSchemaLockManager.getInstance()
+          .takeWriteLock(SchemaLockType.VALIDATE_VS_DELETION_TREE);
+    }
     try {
       cache.takeWriteLock();
       try {
@@ -717,8 +720,10 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
         cache.releaseWriteLock();
       }
     } finally {
-      DataNodeSchemaLockManager.getInstance()
-          .releaseWriteLock(SchemaLockType.VALIDATE_VS_DELETION_TREE);
+      if (req.needLock || !req.isSetNeedLock()) {
+        DataNodeSchemaLockManager.getInstance()
+            .releaseWriteLock(SchemaLockType.VALIDATE_VS_DELETION_TREE);
+      }
     }
     return RpcUtils.SUCCESS_STATUS;
   }
diff --git a/iotdb-protocol/thrift-datanode/src/main/thrift/datanode.thrift b/iotdb-protocol/thrift-datanode/src/main/thrift/datanode.thrift
index 9416633a2c4..caaf44c16a7 100644
--- a/iotdb-protocol/thrift-datanode/src/main/thrift/datanode.thrift
+++ b/iotdb-protocol/thrift-datanode/src/main/thrift/datanode.thrift
@@ -440,6 +440,7 @@ struct TRollbackSchemaBlackListReq {
 
 struct TInvalidateMatchedSchemaCacheReq {
   1: required binary pathPatternTree
+  2: optional bool needLock
 }
 
 struct TFetchSchemaBlackListReq {


(iotdb) 18/45: Adjust the exception message cause by the WHERE clause, which uses a range comparison on the same field, specifically when the left value of the range is greater than the right value of the range. (#16741)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 197c4f18af9c4eac2472a6f728412d9bfe47ee3d
Author: libo <ze...@163.com>
AuthorDate: Thu Nov 13 11:17:23 2025 +0800

    Adjust the exception message cause by the WHERE clause, which uses a range comparison on the same field, specifically when the left value of the range is greater than the right value of the range. (#16741)
    
    (cherry picked from commit f608a2d2e6a2ddf8b80ae0e36dbc3424a7ca6127)
---
 .../org/apache/iotdb/db/it/IoTDBDeletionIT.java     | 21 +++++++++++++++++++++
 .../db/queryengine/plan/parser/ASTVisitor.java      | 12 +++++++++---
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java
index 576b9c75f21..17ceb9b6962 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java
@@ -19,10 +19,12 @@
 
 package org.apache.iotdb.db.it;
 
+import org.apache.iotdb.db.queryengine.plan.parser.ASTVisitor;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
+import org.apache.iotdb.jdbc.IoTDBSQLException;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.junit.AfterClass;
@@ -467,6 +469,25 @@ public class IoTDBDeletionIT {
     }
   }
 
+  @Test
+  public void testDeleteByRangeComparison() throws SQLException {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE DATABASE root.test");
+      statement.execute("CREATE ALIGNED TIMESERIES root.test.g_0.d2(s_0 int32)");
+      statement.execute("INSERT INTO root.test.g_0.d_2(time,s_0) VALUES(1, 1)");
+
+      try {
+        statement.execute("DELETE FROM root.test.g_0.d_2.s_0 WHERE time > 4 AND time < 0");
+      } catch (IoTDBSQLException e) {
+        Assert.assertEquals(
+            e.getErrorCode() + ": " + ASTVisitor.DELETE_RANGE_COMPARISON_ERROR_MSG, e.getMessage());
+      }
+
+      statement.execute("DROP DATABASE root.test");
+    }
+  }
+
   private static void prepareSeries() {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
index 123f7dcae52..be30b4e1b37 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
@@ -344,6 +344,9 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
   private static final String LIMIT_CONFIGURATION_ENABLED_ERROR_MSG =
       "Limit configuration is not enabled, please enable it first.";
 
+  public static final String DELETE_RANGE_COMPARISON_ERROR_MSG =
+      "For delete statement, where clause use a range comparison on the same field, the left value of the range cannot be greater than the right value of the range, it must be written like this : time > 5 and time < 10";
+
   private static final String NODE_NAME_IN_INTO_PATH_MATCHER = "([a-zA-Z0-9_${}\\u2E80-\\u9FFF]+)";
   private static final Pattern NODE_NAME_IN_INTO_PATH_PATTERN =
       Pattern.compile(NODE_NAME_IN_INTO_PATH_MATCHER);
@@ -2993,9 +2996,12 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
           parseDeleteTimeRange(((LogicAndExpression) predicate).getLeftExpression());
       TimeRange rightTimeRange =
           parseDeleteTimeRange(((LogicAndExpression) predicate).getRightExpression());
-      return new TimeRange(
-          Math.max(leftTimeRange.getMin(), rightTimeRange.getMin()),
-          Math.min(leftTimeRange.getMax(), rightTimeRange.getMax()));
+      long min = Math.max(leftTimeRange.getMin(), rightTimeRange.getMin());
+      long max = Math.min(leftTimeRange.getMax(), rightTimeRange.getMax());
+      if (min > max) {
+        throw new SemanticException(DELETE_RANGE_COMPARISON_ERROR_MSG);
+      }
+      return new TimeRange(min, max);
     } else if (predicate instanceof CompareBinaryExpression) {
       if (((CompareBinaryExpression) predicate).getLeftExpression() instanceof TimestampOperand) {
         return parseTimeRangeForDeleteTimeRange(


(iotdb) 23/45: [AINode] Enable AINode start as background (-d) (#16762)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 3a6c3bbce547d5319f6146c9d0a9adee01c9c39a
Author: Yongzao <yo...@apache.org>
AuthorDate: Sat Nov 15 16:56:32 2025 +0800

    [AINode] Enable AINode start as background (-d) (#16762)
    
    (cherry picked from commit 1ebb9515767eee492a908cfad38a478f1ec7bba0)
---
 iotdb-core/ainode/iotdb/ainode/core/ai_node.py     | 10 +++++++---
 .../iotdb/ainode/core/inference/pool_controller.py |  2 +-
 .../iotdb/ainode/core/manager/inference_manager.py |  4 ++--
 iotdb-core/ainode/iotdb/ainode/core/rpc/handler.py |  2 +-
 iotdb-core/ainode/iotdb/ainode/core/rpc/service.py |  1 +
 scripts/sbin/start-ainode.sh                       | 17 +++++++++++++----
 scripts/sbin/windows/start-ainode.bat              | 22 +++++++++++++++++-----
 7 files changed, 42 insertions(+), 16 deletions(-)

diff --git a/iotdb-core/ainode/iotdb/ainode/core/ai_node.py b/iotdb-core/ainode/iotdb/ainode/core/ai_node.py
index 587ae4930de..d8f619e1b8d 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/ai_node.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/ai_node.py
@@ -163,7 +163,11 @@ class AINode:
             self._rpc_handler.stop()
             if self._rpc_service:
                 self._rpc_service.stop()
-                self._rpc_service.join(1)
-                if self._rpc_service.is_alive():
-                    logger.warning("RPC service thread failed to stop in time.")
+                for retry in range(30):
+                    self._rpc_service.join(2)
+                    if not self._rpc_service.is_alive():
+                        logger.warning(
+                            "RPC service thread failed to stop in time, retrying..."
+                        )
+                        break
             logger.info("IoTDB-AINode has successfully stopped.")
diff --git a/iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py b/iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py
index 00bb3b5568b..54580402ec2 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py
@@ -504,7 +504,7 @@ class PoolController:
             return pool_group.get_load(pool_id)
         return -1
 
-    def shutdown(self):
+    def stop(self):
         self._stop_event.set()
 
         # shutdown pool controller
diff --git a/iotdb-core/ainode/iotdb/ainode/core/manager/inference_manager.py b/iotdb-core/ainode/iotdb/ainode/core/manager/inference_manager.py
index 841159d9b4c..a67d576b0ec 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/manager/inference_manager.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/manager/inference_manager.py
@@ -366,9 +366,9 @@ class InferenceManager:
             single_output=False,
         )
 
-    def shutdown(self):
+    def stop(self):
         self._stop_event.set()
-        self._pool_controller.shutdown()
+        self._pool_controller.stop()
         while not self._result_queue.empty():
             self._result_queue.get_nowait()
         self._result_queue.close()
diff --git a/iotdb-core/ainode/iotdb/ainode/core/rpc/handler.py b/iotdb-core/ainode/iotdb/ainode/core/rpc/handler.py
index 04ac139e7d4..f01e1594f06 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/rpc/handler.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/rpc/handler.py
@@ -69,7 +69,7 @@ class AINodeRPCServiceHandler(IAINodeRPCService.Iface):
 
     def stop(self) -> None:
         logger.info("Stopping the RPC service handler of IoTDB-AINode...")
-        self._inference_manager.shutdown()
+        self._inference_manager.stop()
 
     def stopAINode(self) -> TSStatus:
         self._ainode.stop()
diff --git a/iotdb-core/ainode/iotdb/ainode/core/rpc/service.py b/iotdb-core/ainode/iotdb/ainode/core/rpc/service.py
index c556ffd4ba0..fc93a0cce7d 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/rpc/service.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/rpc/service.py
@@ -125,3 +125,4 @@ class AINodeRPCService(threading.Thread):
             logger.info("Stopping the RPC service of IoTDB-AINode...")
             self._stop_event.set()
             self.__pool_server.stop()
+            self._handler.stop()
diff --git a/scripts/sbin/start-ainode.sh b/scripts/sbin/start-ainode.sh
index 671de54ba1a..454a0389c38 100644
--- a/scripts/sbin/start-ainode.sh
+++ b/scripts/sbin/start-ainode.sh
@@ -27,10 +27,14 @@ export IOTDB_AINODE_HOME
 echo "IOTDB_AINODE_HOME: $IOTDB_AINODE_HOME"
 
 # fetch parameters with names
-while getopts "i:rn" opt; do
+daemon_mode=false
+while getopts "i:rnd" opt; do
   case $opt in
     n)
     ;;
+    d)
+      daemon_mode=true
+    ;;
     \?) echo "Invalid option -$OPTARG" >&2
     exit 1
     ;;
@@ -41,6 +45,11 @@ ain_ainode_executable="$IOTDB_AINODE_HOME/lib/ainode"
 
 echo Script got ainode executable: "$ain_ainode_executable"
 
-echo Starting AINode...
-
-$ain_ainode_executable start
+if [ "$daemon_mode" = true ]; then
+  echo Starting AINode in daemon mode...
+  nohup $ain_ainode_executable start > /dev/null 2>&1 &
+  echo AINode started in background
+else
+  echo Starting AINode...
+  $ain_ainode_executable start
+fi
diff --git a/scripts/sbin/windows/start-ainode.bat b/scripts/sbin/windows/start-ainode.bat
index 1d9a4306baf..09ce914f226 100644
--- a/scripts/sbin/windows/start-ainode.bat
+++ b/scripts/sbin/windows/start-ainode.bat
@@ -30,8 +30,20 @@ set ain_ainode_executable=%IOTDB_AINODE_HOME%\lib\ainode
 
 echo Script got ainode executable: %ain_ainode_executable%
 
-echo Starting AINode...
-
-%$ain_ainode_executable% start
-
-pause
\ No newline at end of file
+set daemon_mode=false
+:parse_args
+if "%~1"=="" goto end_parse
+if /i "%~1"=="-d" set daemon_mode=true
+shift
+goto parse_args
+:end_parse
+
+if "%daemon_mode%"=="true" (
+  echo Starting AINode in daemon mode...
+  start /B "" %ain_ainode_executable% start
+  echo AINode started in background
+) else (
+  echo Starting AINode...
+  %ain_ainode_executable% start
+  pause
+)
\ No newline at end of file


(iotdb) 27/45: [AINode] Fix bug that AINode cannot compile in Windows (#16767)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 08c0eec5a91eff3a3f3dbff0cbbe39a1f08c7c75
Author: Yongzao <yo...@apache.org>
AuthorDate: Tue Nov 18 00:15:32 2025 +0800

    [AINode] Fix bug that AINode cannot compile in Windows (#16767)
    
    (cherry picked from commit cd443ba9996abe1366b389e3d10f9ecb72cd8d12)
---
 iotdb-core/ainode/build_binary.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/iotdb-core/ainode/build_binary.py b/iotdb-core/ainode/build_binary.py
index 1b5f99da214..ff99fda0933 100644
--- a/iotdb-core/ainode/build_binary.py
+++ b/iotdb-core/ainode/build_binary.py
@@ -324,7 +324,7 @@ def install_dependencies(venv_python, venv_dir, script_dir):
                         shutil.rmtree(poetry_venv_path, ignore_errors=True)
                 poetry_venv_path.parent.mkdir(parents=True, exist_ok=True)
                 poetry_venv_path.symlink_to(venv_dir)
-                print(f"✓ Symlink created successfully")
+                print(f"Symlink created successfully")
             except Exception as e:
                 print(f"WARNING: Failed to create symlink: {e}")
                 print("Will try to use poetry install directly with VIRTUAL_ENV set")
@@ -386,9 +386,7 @@ def install_dependencies(venv_python, venv_dir, script_dir):
             print("The symlink approach may not have worked. Please check the symlink.")
             sys.exit(1)
         else:
-            print(
-                f"✓ Poetry is correctly using virtual environment: {poetry_venv_path}"
-            )
+            print(f"Poetry is correctly using virtual environment: {poetry_venv_path}")
     else:
         print("Warning: Could not verify poetry virtual environment path")
         print(
@@ -465,12 +463,12 @@ def install_dependencies(venv_python, venv_dir, script_dir):
         )
         if test_result.returncode == 0:
             version = test_result.stdout.strip()
-            print(f"  ✓ {package} {version} installed")
+            print(f"{package} {version} installed")
         else:
             error_msg = (
                 test_result.stderr.strip() if test_result.stderr else "Unknown error"
             )
-            print(f"  ✗ {package} NOT found in virtual environment: {error_msg}")
+            print(f"{package} NOT found in virtual environment: {error_msg}")
             missing_packages.append(package)
 
     if missing_packages:


(iotdb) 35/45: Refine CN consensus layer API for procedure robustness (#16303)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 40355e34103a8166a61a8625ab9ce2c09366c437
Author: Peng Junzhi <78...@users.noreply.github.com>
AuthorDate: Thu Nov 20 05:37:40 2025 -0600

    Refine CN consensus layer API for procedure robustness (#16303)
    
    * refine cn consensus layer API for procedure
    
    * refine and fix the whole logic
    
    * fix comment
    
    * fix comment
    
    ---------
    
    Co-authored-by: 彭俊植 <ju...@pingcap.com>
    (cherry picked from commit 0e209e73c21137be44cebe3926c7f1fed62a0422)
---
 .../procedure/CompletedProcedureRecycler.java      | 21 +++++-
 .../iotdb/confignode/procedure/Procedure.java      | 27 +++++--
 .../confignode/procedure/ProcedureExecutor.java    | 88 +++++++++++++++++-----
 .../procedure/TimeoutExecutorThread.java           | 12 ++-
 .../procedure/store/ConfigProcedureStore.java      | 26 +++++--
 .../procedure/store/IProcedureStore.java           | 10 +--
 .../org/apache/iotdb/commons/utils/RetryUtils.java | 59 ++++++++++++++-
 7 files changed, 203 insertions(+), 40 deletions(-)

diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/CompletedProcedureRecycler.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/CompletedProcedureRecycler.java
index cea15a1bfb6..179563cc3b3 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/CompletedProcedureRecycler.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/CompletedProcedureRecycler.java
@@ -70,15 +70,30 @@ public class CompletedProcedureRecycler<Env> extends InternalProcedure<Env> {
         // Failed procedures aren't persisted in WAL.
         batchIds[batchCount++] = entry.getKey();
         if (batchCount == batchIds.length) {
-          store.delete(batchIds, 0, batchCount);
-          batchCount = 0;
+          try {
+            store.delete(batchIds, 0, batchCount);
+          } catch (Exception e) {
+            LOG.error("Error deleting completed procedures {}.", proc, e);
+            // Do not remove from the completed map. Even this procedure may be restored
+            // unexpectedly in another new CN leader, we do not need to do anything else since
+            // procedures are idempotent.
+            continue;
+          } finally {
+            batchCount = 0;
+          }
         }
         it.remove();
         LOG.trace("Evict completed {}", proc);
       }
     }
     if (batchCount > 0) {
-      store.delete(batchIds, 0, batchCount);
+      try {
+        store.delete(batchIds, 0, batchCount);
+      } catch (Exception e) {
+        // Even this procedure may be restored unexpectedly in another new CN leader, we do not need
+        // to do anything else since procedures are idempotent.
+        LOG.error("Error deleting completed procedures {}.", batchIds, e);
+      }
     }
   }
 }
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/Procedure.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/Procedure.java
index 91af03d3971..89e6e37e431 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/Procedure.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/Procedure.java
@@ -24,6 +24,7 @@ import org.apache.iotdb.confignode.procedure.exception.ProcedureException;
 import org.apache.iotdb.confignode.procedure.state.ProcedureLockState;
 import org.apache.iotdb.confignode.procedure.state.ProcedureState;
 import org.apache.iotdb.confignode.procedure.store.IProcedureStore;
+import org.apache.iotdb.consensus.exception.ConsensusException;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -196,7 +197,7 @@ public abstract class Procedure<Env> implements Comparable<Procedure<Env>> {
       byteBuffer.get(resultArr);
     }
     //  has lock
-    if (byteBuffer.get() == 1) {
+    if (byteBuffer.get() == 1 && this.state != ProcedureState.ROLLEDBACK) {
       this.lockedWhenLoading();
     }
   }
@@ -300,8 +301,15 @@ public abstract class Procedure<Env> implements Comparable<Procedure<Env>> {
     }
     ProcedureLockState state = acquireLock(env);
     if (state == ProcedureLockState.LOCK_ACQUIRED) {
-      locked = true;
-      store.update(this);
+      try {
+        locked = true;
+        store.update(this);
+      } catch (Exception e) {
+        // Do not need to do anything else. New leader which restore this procedure from a wrong
+        // state will reexecute it and converge to the correct state since procedures are
+        // idempotent.
+        LOG.warn("pid={} Failed to persist lock state to store.", this.procId, e);
+      }
     }
     return state;
   }
@@ -312,12 +320,19 @@ public abstract class Procedure<Env> implements Comparable<Procedure<Env>> {
    * @param env environment
    * @param store ProcedureStore
    */
-  public final void doReleaseLock(Env env, IProcedureStore store) {
+  public final void doReleaseLock(Env env, IProcedureStore store) throws Exception {
     locked = false;
-    if (getState() != ProcedureState.ROLLEDBACK) {
+    if (getState() == ProcedureState.ROLLEDBACK) {
+      LOG.info("Force write unlock state to raft for pid={}", this.procId);
+    }
+    try {
       store.update(this);
+      // do not release lock when consensus layer is not working
+      releaseLock(env);
+    } catch (ConsensusException e) {
+      LOG.error("pid={} Failed to persist unlock state to store.", this.procId, e);
+      throw e;
     }
-    releaseLock(env);
   }
 
   public final void restoreLock(Env env) {
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/ProcedureExecutor.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/ProcedureExecutor.java
index 0d8368583b4..efd37778efa 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/ProcedureExecutor.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/ProcedureExecutor.java
@@ -20,6 +20,7 @@
 package org.apache.iotdb.confignode.procedure;
 
 import org.apache.iotdb.commons.concurrent.ThreadName;
+import org.apache.iotdb.commons.utils.RetryUtils;
 import org.apache.iotdb.commons.utils.TestOnly;
 import org.apache.iotdb.confignode.procedure.env.ConfigNodeProcedureEnv;
 import org.apache.iotdb.confignode.procedure.exception.ProcedureException;
@@ -221,7 +222,8 @@ public class ProcedureExecutor<Env> {
 
   private void releaseLock(Procedure<Env> procedure, boolean force) {
     if (force || !procedure.holdLock(this.environment) || procedure.isFinished()) {
-      procedure.doReleaseLock(this.environment, store);
+      RetryUtils.executeWithEndlessBackoffRetry(
+          () -> procedure.doReleaseLock(this.environment, store), "procedure release lock");
     }
   }
 
@@ -477,7 +479,11 @@ public class ProcedureExecutor<Env> {
     }
     if (parent != null && parent.tryRunnable()) {
       // If success, means all its children have completed, move parent to front of the queue.
-      store.update(parent);
+      // Must endless retry here, since this step is not idempotent and can not be re-execute
+      // correctly in new CN leader.
+      RetryUtils.executeWithEndlessBackoffRetry(
+          () -> store.update(parent), "count down children procedure");
+      // do not add this procedure when exception occurred
       scheduler.addFront(parent);
       LOG.info(
           "Finished subprocedure pid={}, resume processing ppid={}",
@@ -506,21 +512,44 @@ public class ProcedureExecutor<Env> {
       if (LOG.isDebugEnabled()) {
         LOG.debug("Stored {}, children {}", proc, Arrays.toString(subprocs));
       }
-      store.update(subprocs);
+      try {
+        store.update(subprocs);
+      } catch (Exception e) {
+        // Do nothing since this step is idempotent. New CN leader can converge to the correct
+        // state when restore this procedure.
+        LOG.warn("Failed to update subprocs on execution", e);
+      }
     } else {
       LOG.debug("Store update {}", proc);
       if (proc.isFinished() && !proc.hasParent()) {
         final long[] childProcIds = rootProcStack.getSubprocedureIds();
         if (childProcIds != null) {
-          store.delete(childProcIds);
-          for (long childProcId : childProcIds) {
-            procedures.remove(childProcId);
+          try {
+            store.delete(childProcIds);
+            // do not remove these procedures when exception occurred
+            for (long childProcId : childProcIds) {
+              procedures.remove(childProcId);
+            }
+          } catch (Exception e) {
+            // Do nothing since this step is idempotent. New CN leader can converge to the correct
+            // state when restore this procedure.
+            LOG.warn("Failed to delete subprocedures on execution", e);
           }
         } else {
-          store.update(proc);
+          try {
+            store.update(proc);
+          } catch (Exception e) {
+            LOG.warn("Failed to update procedure on execution", e);
+          }
         }
       } else {
-        store.update(proc);
+        try {
+          store.update(proc);
+        } catch (Exception e) {
+          // Do nothing since this step is idempotent. New CN leader can converge to the correct
+          // state when restore this procedure.
+          LOG.warn("Failed to update procedure on execution", e);
+        }
       }
     }
   }
@@ -577,7 +606,9 @@ public class ProcedureExecutor<Env> {
     if (exception == null) {
       exception = procedureStack.getException();
       rootProcedure.setFailure(exception);
-      store.update(rootProcedure);
+      // Endless retry since this step is not idempotent.
+      RetryUtils.executeWithEndlessBackoffRetry(
+          () -> store.update(rootProcedure), "root procedure rollback");
     }
     List<Procedure<Env>> subprocStack = procedureStack.getSubproceduresStack();
     int stackTail = subprocStack.size();
@@ -653,18 +684,37 @@ public class ProcedureExecutor<Env> {
       procedure.updateMetricsOnFinish(getEnvironment(), procedure.elapsedTime(), false);
 
       if (procedure.hasParent()) {
-        store.delete(procedure.getProcId());
-        procedures.remove(procedure.getProcId());
+        try {
+          store.delete(procedure.getProcId());
+          // do not remove this procedure when exception occurred
+          procedures.remove(procedure.getProcId());
+        } catch (Exception e) {
+          // Do nothing since this step is idempotent. New CN leader can converge to the correct
+          // state when restore this procedure.
+          LOG.warn("Failed to delete procedure on rollback", e);
+        }
       } else {
         final long[] childProcIds = rollbackStack.get(procedure.getProcId()).getSubprocedureIds();
-        if (childProcIds != null) {
-          store.delete(childProcIds);
-        } else {
-          store.update(procedure);
+        try {
+          if (childProcIds != null) {
+            store.delete(childProcIds);
+          } else {
+            store.update(procedure);
+          }
+        } catch (Exception e) {
+          // Do nothing since this step is idempotent. New CN leader can converge to the correct
+          // state when restore this procedure.
+          LOG.warn("Failed to delete procedure on rollback", e);
         }
       }
     } else {
-      store.update(procedure);
+      try {
+        store.update(procedure);
+      } catch (Exception e) {
+        // Do nothing since this step is idempotent. New CN leader can converge to the correct
+        // state when restore this procedure.
+        LOG.warn("Failed to update procedure on rollback", e);
+      }
     }
   }
 
@@ -916,7 +966,11 @@ public class ProcedureExecutor<Env> {
     procedure.setProcId(store.getNextProcId());
     procedure.setProcRunnable();
     // Commit the transaction
-    store.update(procedure);
+    try {
+      store.update(procedure);
+    } catch (Exception e) {
+      LOG.error("Failed to update store procedure {}", procedure, e);
+    }
     LOG.debug("{} is stored.", procedure);
     // Add the procedure to the executor
     return pushProcedure(procedure);
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/TimeoutExecutorThread.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/TimeoutExecutorThread.java
index 5aaf9a623f5..1614148abd3 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/TimeoutExecutorThread.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/TimeoutExecutorThread.java
@@ -19,12 +19,16 @@
 
 package org.apache.iotdb.confignode.procedure;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.util.concurrent.DelayQueue;
 import java.util.concurrent.Delayed;
 import java.util.concurrent.TimeUnit;
 
 public class TimeoutExecutorThread<Env> extends StoppableThread {
 
+  private static final Logger LOGGER = LoggerFactory.getLogger(TimeoutExecutorThread.class);
   private static final int DELAY_QUEUE_TIMEOUT = 20;
   private final ProcedureExecutor<Env> executor;
   private final DelayQueue<ProcedureDelayContainer<Env>> queue = new DelayQueue<>();
@@ -71,7 +75,13 @@ public class TimeoutExecutorThread<Env> extends StoppableThread {
           long rootProcId = executor.getRootProcedureId(procedure);
           RootProcedureStack<Env> rollbackStack = executor.getRollbackStack(rootProcId);
           rollbackStack.abort();
-          executor.getStore().update(procedure);
+          try {
+            executor.getStore().update(procedure);
+          } catch (Exception e) {
+            // Do nothing since new CN leader can converge to the correct state when restore this
+            // procedure.
+            LOGGER.warn("Failed to update procedure {}", procedure, e);
+          }
           executor.getScheduler().addFront(procedure);
         }
       }
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ConfigProcedureStore.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ConfigProcedureStore.java
index 393c1e93740..603a9a8a627 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ConfigProcedureStore.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ConfigProcedureStore.java
@@ -89,43 +89,55 @@ public class ConfigProcedureStore implements IProcedureStore<ConfigNodeProcedure
   }
 
   @Override
-  public void update(Procedure<ConfigNodeProcedureEnv> procedure) {
+  public void update(Procedure<ConfigNodeProcedureEnv> procedure) throws Exception {
     Objects.requireNonNull(ProcedureFactory.getProcedureType(procedure), "Procedure type is null");
     final UpdateProcedurePlan updateProcedurePlan = new UpdateProcedurePlan(procedure);
     try {
       configManager.getConsensusManager().write(updateProcedurePlan);
     } catch (ConsensusException e) {
-      LOG.warn("Failed in the write API executing the consensus layer due to: ", e);
+      LOG.warn(
+          "pid={} Failed in the write update API executing the consensus layer due to: ",
+          procedure.getProcId(),
+          e);
+      // In consensus layer API, do nothing but just throw an exception to let upper caller handle
+      // it.
+      throw e;
     }
   }
 
   @Override
-  public void update(Procedure[] subprocs) {
+  public void update(Procedure[] subprocs) throws Exception {
     for (Procedure subproc : subprocs) {
       update(subproc);
     }
   }
 
   @Override
-  public void delete(long procId) {
+  public void delete(long procId) throws Exception {
     DeleteProcedurePlan deleteProcedurePlan = new DeleteProcedurePlan();
     deleteProcedurePlan.setProcId(procId);
     try {
       configManager.getConsensusManager().write(deleteProcedurePlan);
     } catch (ConsensusException e) {
-      LOG.warn("Failed in the write API executing the consensus layer due to: ", e);
+      LOG.warn(
+          "pid={} Failed in the write delete API executing the consensus layer due to: ",
+          procId,
+          e);
+      // In consensus layer API, do nothing but just throw an exception to let upper caller handle
+      // it.
+      throw e;
     }
   }
 
   @Override
-  public void delete(long[] childProcIds) {
+  public void delete(long[] childProcIds) throws Exception {
     for (long childProcId : childProcIds) {
       delete(childProcId);
     }
   }
 
   @Override
-  public void delete(long[] batchIds, int startIndex, int batchCount) {
+  public void delete(long[] batchIds, int startIndex, int batchCount) throws Exception {
     for (int i = startIndex; i < batchCount; i++) {
       delete(batchIds[i]);
     }
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/IProcedureStore.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/IProcedureStore.java
index 8e8e715fd84..3dba6d29288 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/IProcedureStore.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/IProcedureStore.java
@@ -38,15 +38,15 @@ public interface IProcedureStore<Env> {
 
   long getNextProcId();
 
-  void update(Procedure<Env> procedure);
+  void update(Procedure<Env> procedure) throws Exception;
 
-  void update(Procedure<Env>[] subprocs);
+  void update(Procedure<Env>[] subprocs) throws Exception;
 
-  void delete(long procId);
+  void delete(long procId) throws Exception;
 
-  void delete(long[] childProcIds);
+  void delete(long[] childProcIds) throws Exception;
 
-  void delete(long[] batchIds, int startIndex, int batchCount);
+  void delete(long[] batchIds, int startIndex, int batchCount) throws Exception;
 
   void cleanup();
 
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/RetryUtils.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/RetryUtils.java
index cff60601edb..9b297cae053 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/RetryUtils.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/RetryUtils.java
@@ -22,10 +22,15 @@ package org.apache.iotdb.commons.utils;
 import org.apache.iotdb.commons.exception.pipe.PipeConsensusRetryWithIncreasingIntervalException;
 import org.apache.iotdb.rpc.TSStatusCode;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.net.ConnectException;
 
 public class RetryUtils {
 
+  private static final Logger LOGGER = LoggerFactory.getLogger(RetryUtils.class);
+
   public interface CallableWithException<T, E extends Exception> {
     T call() throws E;
   }
@@ -46,7 +51,7 @@ public class RetryUtils {
     return statusCode == TSStatusCode.PIPE_CONSENSUS_DEPRECATED_REQUEST.getStatusCode();
   }
 
-  public static final int MAX_RETRIES = 3;
+  public static final int MAX_RETRIES = 5;
 
   public static <T, E extends Exception> T retryOnException(
       final CallableWithException<T, E> callable) throws E {
@@ -63,6 +68,58 @@ public class RetryUtils {
     }
   }
 
+  private static final long INITIAL_BACKOFF_MS = 100;
+  private static final long MAX_BACKOFF_MS = 60000;
+
+  @FunctionalInterface
+  public interface OperationWithException {
+    void run() throws Exception;
+  }
+
+  /**
+   * Exponential backoff retry helper method.
+   *
+   * @param operation The operation to execute.
+   * @param operationName A description of the operation (for logging).
+   */
+  public static void executeWithEndlessBackoffRetry(
+      OperationWithException operation, String operationName) {
+    long currentBackoff = INITIAL_BACKOFF_MS;
+    int attempt = 0;
+
+    // Endless retry
+    while (true) {
+      attempt++;
+      try {
+        operation.run();
+        if (attempt > 1) {
+          LOGGER.info("Operation '{}' succeeded after {} attempts", operationName, attempt);
+        }
+        return;
+      } catch (Exception e) {
+        LOGGER.warn(
+            "Operation '{}' failed (attempt {}). Retrying in {}ms...",
+            operationName,
+            attempt,
+            currentBackoff,
+            e);
+        try {
+          Thread.sleep(currentBackoff);
+        } catch (InterruptedException ie) {
+          LOGGER.warn(
+              "Retry wait for operation '{}' was interrupted, stopping retries.",
+              operationName,
+              ie);
+          Thread.currentThread().interrupt();
+          return;
+        }
+
+        // Double the backoff, but cap it at the max to prevent overflow
+        currentBackoff = Math.min(currentBackoff * 2, MAX_BACKOFF_MS);
+      }
+    }
+  }
+
   private RetryUtils() {
     // utility class
   }


(iotdb) 36/45: Pipe: improved the memory calculation for tablets (#16739)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit b7e1c02338f5cae13ac8f49e0fc33a5453120cba
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Fri Nov 21 09:18:06 2025 +0800

    Pipe: improved the memory calculation for tablets (#16739)
    
    * fix
    
    * fix
    
    * opti
    
    * fix
    
    * fix
    
    * fix function name
    
    * fix
    
    * fix
    
    * fix ut
    
    ---------
    
    Co-authored-by: Tian Jiang <jt...@163.com>
    (cherry picked from commit 0ebdb878e57bc1754bbbcf8c59790919e6d256b4)
---
 .../it/session/IoTDBSessionRelationalIT.java       |  2 +
 .../resource/memory/InsertNodeMemoryEstimator.java | 55 +++----------------
 .../pipe/resource/memory/PipeMemoryWeightUtil.java | 62 ++--------------------
 .../plan/statement/crud/InsertBaseStatement.java   |  2 +-
 .../plan/statement/crud/InsertTabletStatement.java |  2 +-
 .../iotdb/db/utils/datastructure/TVList.java       |  2 +-
 pom.xml                                            |  2 +-
 7 files changed, 16 insertions(+), 111 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/session/IoTDBSessionRelationalIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/session/IoTDBSessionRelationalIT.java
index bba5681b58b..5a26ca510a0 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/session/IoTDBSessionRelationalIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/session/IoTDBSessionRelationalIT.java
@@ -1812,6 +1812,7 @@ public class IoTDBSessionRelationalIT {
     dataTypes.remove(TSDataType.OBJECT);
     dataTypes.remove(TSDataType.VECTOR);
     dataTypes.remove(TSDataType.UNKNOWN);
+    dataTypes.remove(TSDataType.OBJECT);
 
     try {
       for (TSDataType from : dataTypes) {
@@ -1903,6 +1904,7 @@ public class IoTDBSessionRelationalIT {
     dataTypes.remove(TSDataType.OBJECT);
     dataTypes.remove(TSDataType.VECTOR);
     dataTypes.remove(TSDataType.UNKNOWN);
+    dataTypes.remove(TSDataType.OBJECT);
 
     for (TSDataType from : dataTypes) {
       for (TSDataType to : dataTypes) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java
index 60076c6139e..7f1d7357b02 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/InsertNodeMemoryEstimator.java
@@ -189,7 +189,7 @@ public class InsertNodeMemoryEstimator {
     // MeasurementSchemas
     size += sizeOfMeasurementSchemas(node.getMeasurementSchemas());
     // Measurement
-    size += sizeOfStringArray(node.getMeasurements());
+    size += RamUsageEstimator.sizeOf(node.getMeasurements());
     // dataTypes
     size += RamUsageEstimator.shallowSizeOf(node.getDataTypes());
     // columnCategories
@@ -231,7 +231,7 @@ public class InsertNodeMemoryEstimator {
     long size = INSERT_TABLET_NODE_SIZE;
     size += calculateFullInsertNodeSize(node);
     size += RamUsageEstimator.sizeOf(node.getTimes());
-    size += sizeOfBitMapArray(node.getBitMaps());
+    size += RamUsageEstimator.sizeOf(node.getBitMaps());
     size += sizeOfColumns(node.getColumns(), node.getMeasurementSchemas());
     final List<Integer> range = node.getRange();
     if (range != null) {
@@ -247,7 +247,7 @@ public class InsertNodeMemoryEstimator {
 
     size += RamUsageEstimator.sizeOf(node.getTimes());
 
-    size += sizeOfBitMapArray(node.getBitMaps());
+    size += RamUsageEstimator.sizeOf(node.getBitMaps());
 
     size += sizeOfColumns(node.getColumns(), node.getMeasurementSchemas());
 
@@ -390,7 +390,7 @@ public class InsertNodeMemoryEstimator {
 
     size += RamUsageEstimator.sizeOf(node.getTimes());
 
-    size += sizeOfBitMapArray(node.getBitMaps());
+    size += RamUsageEstimator.sizeOf(node.getBitMaps());
 
     size += sizeOfColumns(node.getColumns(), node.getMeasurementSchemas());
 
@@ -413,7 +413,7 @@ public class InsertNodeMemoryEstimator {
     if (nodes != null) {
       // Since fullPath may be lazy loaded, lazy loading will not be triggered here, so it is
       // assumed that the memory size of fullPath is the same as that of nodes.
-      size += sizeOfStringArray(nodes) * 2;
+      size += RamUsageEstimator.sizeOf(nodes) * 2;
       size += TsFileConstant.PATH_SEPARATOR.length() * (nodes.length - 1) + NUM_BYTES_OBJECT_HEADER;
     }
     return size;
@@ -555,34 +555,6 @@ public class InsertNodeMemoryEstimator {
     return Objects.nonNull(binary) ? binary.ramBytesUsed() : 0L;
   }
 
-  public static long sizeOfStringArray(final String[] values) {
-    return Objects.nonNull(values) ? RamUsageEstimator.sizeOf(values) : 0L;
-  }
-
-  public static long sizeOfBitMapArray(BitMap[] bitMaps) {
-    if (bitMaps == null) {
-      return 0L;
-    }
-    long size =
-        RamUsageEstimator.alignObjectSize(
-            NUM_BYTES_ARRAY_HEADER + NUM_BYTES_OBJECT_REF * bitMaps.length);
-    for (BitMap bitMap : bitMaps) {
-      size += sizeOfBitMap(bitMap);
-    }
-    return size;
-  }
-
-  private static long sizeOfBitMap(final BitMap bitMaps) {
-    if (bitMaps == null) {
-      return 0L;
-    }
-    long size = BIT_MAP_SIZE;
-
-    size +=
-        RamUsageEstimator.alignObjectSize(NUM_BYTES_ARRAY_HEADER + bitMaps.getByteArray().length);
-    return size;
-  }
-
   public static long sizeOfColumns(
       final Object[] columns, final MeasurementSchema[] measurementSchemas) {
     // Directly calculate if measurementSchemas are absent
@@ -632,7 +604,7 @@ public class InsertNodeMemoryEstimator {
         case BLOB:
         case OBJECT:
           {
-            size += getBinarySize((Binary[]) columns[i]);
+            size += RamUsageEstimator.sizeOf((Binary[]) columns[i]);
             break;
           }
       }
@@ -642,23 +614,10 @@ public class InsertNodeMemoryEstimator {
 
   private static long getNumBytesUnknownObject(final Object obj) {
     return obj instanceof Binary[]
-        ? getBinarySize((Binary[]) obj)
+        ? RamUsageEstimator.sizeOf((Binary[]) obj)
         : RamUsageEstimator.sizeOfObject(obj);
   }
 
-  private static long getBinarySize(final Binary[] binaries) {
-    if (binaries == null) {
-      return 0L;
-    }
-
-    long size = 0L;
-    for (Binary binary : binaries) {
-      size += InsertNodeMemoryEstimator.sizeOfBinary(binary);
-    }
-
-    return size + RamUsageEstimator.shallowSizeOf(binaries);
-  }
-
   public static long sizeOfValues(
       final Object[] values, final MeasurementSchema[] measurementSchemas) {
     // Directly calculate if measurementSchemas are absent
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/PipeMemoryWeightUtil.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/PipeMemoryWeightUtil.java
index 30b68e41741..0ba204fcbd2 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/PipeMemoryWeightUtil.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/memory/PipeMemoryWeightUtil.java
@@ -35,7 +35,6 @@ import org.apache.tsfile.read.common.Chunk;
 import org.apache.tsfile.read.common.Field;
 import org.apache.tsfile.read.common.RowRecord;
 import org.apache.tsfile.utils.Binary;
-import org.apache.tsfile.utils.BitMap;
 import org.apache.tsfile.utils.Pair;
 import org.apache.tsfile.utils.TsPrimitiveType;
 import org.apache.tsfile.write.record.Tablet;
@@ -44,6 +43,7 @@ import org.apache.tsfile.write.schema.MeasurementSchema;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 import static org.apache.tsfile.utils.RamUsageEstimator.NUM_BYTES_ARRAY_HEADER;
 import static org.apache.tsfile.utils.RamUsageEstimator.NUM_BYTES_OBJECT_REF;
@@ -203,64 +203,8 @@ public class PipeMemoryWeightUtil {
     }
   }
 
-  public static long calculateTabletSizeInBytes(Tablet tablet) {
-    long totalSizeInBytes = 0;
-
-    if (tablet == null) {
-      return totalSizeInBytes;
-    }
-
-    long[] timestamps = tablet.getTimestamps();
-    Object[] tabletValues = tablet.getValues();
-
-    // timestamps
-    if (timestamps != null) {
-      totalSizeInBytes += timestamps.length * 8L;
-    }
-
-    // values
-    final List<IMeasurementSchema> timeseries = tablet.getSchemas();
-    if (timeseries != null) {
-      for (int column = 0; column < timeseries.size(); column++) {
-        final IMeasurementSchema measurementSchema = timeseries.get(column);
-        if (measurementSchema == null) {
-          continue;
-        }
-
-        final TSDataType tsDataType = measurementSchema.getType();
-        if (tsDataType == null) {
-          continue;
-        }
-
-        if (tsDataType.isBinary()) {
-          if (tabletValues == null || tabletValues.length <= column) {
-            continue;
-          }
-          final Binary[] values = ((Binary[]) tabletValues[column]);
-          if (values == null) {
-            continue;
-          }
-          for (Binary value : values) {
-            totalSizeInBytes += value == null ? 8 : value.ramBytesUsed();
-          }
-        } else {
-          totalSizeInBytes += (long) tablet.getMaxRowNumber() * tsDataType.getDataTypeSize();
-        }
-      }
-    }
-
-    // bitMaps
-    BitMap[] bitMaps = tablet.getBitMaps();
-    if (bitMaps != null) {
-      for (int i = 0; i < bitMaps.length; i++) {
-        totalSizeInBytes += bitMaps[i] == null ? 0 : bitMaps[i].getSize();
-      }
-    }
-
-    // estimate other dataStructures size
-    totalSizeInBytes += 100;
-
-    return totalSizeInBytes;
+  public static long calculateTabletSizeInBytes(final Tablet tablet) {
+    return Objects.nonNull(tablet) ? tablet.ramBytesUsed() : 0L;
   }
 
   public static long calculateTableSchemaBytesUsed(TableSchema tableSchema) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertBaseStatement.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertBaseStatement.java
index 177c05bde19..f115bde9d2d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertBaseStatement.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertBaseStatement.java
@@ -686,7 +686,7 @@ public abstract class InsertBaseStatement extends Statement implements Accountab
     ramBytesUsed =
         InsertNodeMemoryEstimator.sizeOfPartialPath(devicePath)
             + InsertNodeMemoryEstimator.sizeOfMeasurementSchemas(measurementSchemas)
-            + InsertNodeMemoryEstimator.sizeOfStringArray(measurements)
+            + RamUsageEstimator.sizeOf(measurements)
             + RamUsageEstimator.shallowSizeOf(dataTypes)
             + RamUsageEstimator.shallowSizeOf(columnCategories)
             // We assume that the integers are all cached by JVM
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertTabletStatement.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertTabletStatement.java
index efb4746b9b3..d3257d98d41 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertTabletStatement.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertTabletStatement.java
@@ -615,7 +615,7 @@ public class InsertTabletStatement extends InsertBaseStatement implements ISchem
   protected long calculateBytesUsed() {
     return INSTANCE_SIZE
         + RamUsageEstimator.sizeOf(times)
-        + InsertNodeMemoryEstimator.sizeOfBitMapArray(nullBitMaps)
+        + RamUsageEstimator.sizeOf(nullBitMaps)
         + InsertNodeMemoryEstimator.sizeOfColumns(columns, measurementSchemas)
         + (Objects.nonNull(deviceIDs)
             ? Arrays.stream(deviceIDs)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java
index e20575be362..a1f2842d34a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java
@@ -973,7 +973,7 @@ public abstract class TVList implements WALEntryValue {
       TSDataType dataType = getDataType();
       int maxRowCountOfCurrentBatch =
           Math.min(
-              paginationController.hasLimit()
+              paginationController.hasSetLimit()
                   ? (int) paginationController.getCurLimit()
                   : Integer.MAX_VALUE,
               Math.min(maxNumberOfPointsInPage, rows - index));
diff --git a/pom.xml b/pom.xml
index b997a87580c..71e0f017c5d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -173,7 +173,7 @@
         <thrift.version>0.14.1</thrift.version>
         <xz.version>1.9</xz.version>
         <zstd-jni.version>1.5.6-3</zstd-jni.version>
-        <tsfile.version>2.2.0-251030-SNAPSHOT</tsfile.version>
+        <tsfile.version>2.2.0-251113-SNAPSHOT</tsfile.version>
     </properties>
     <!--
     if we claim dependencies in dependencyManagement, then we do not claim


(iotdb) 37/45: Fixed the bug related to "Fixed the bugs related to device auto-create alignment ignorance" (#16781)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 50dd71436ec44fe2b03cedb25e074906d402f493
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Fri Nov 21 14:45:14 2025 +0800

    Fixed the bug related to "Fixed the bugs related to device auto-create alignment ignorance" (#16781)
    
    * gsa
    
    * ff
    
    * ff
    
    (cherry picked from commit c76c5fe3d5a43d5a4a3f5e82b1f42b2699d240fe)
---
 .../org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java  | 102 +++++++++++++++++++++
 .../metadata/AlignedTimeSeriesException.java       |  35 -------
 .../load/TreeSchemaAutoCreatorAndVerifier.java     |   4 +
 .../analyze/schema/AutoCreateSchemaExecutor.java   |   9 +-
 4 files changed, 113 insertions(+), 37 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
index c54adb34711..928c7875b19 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
@@ -263,6 +263,108 @@ public class IoTDBLoadTsFileIT {
     }
   }
 
+  @Test
+  // Shall succeed with tablet conversion
+  public void testLoadWithAlignmentMismatch() throws Exception {
+    registerSchema();
+
+    final long writtenPoint1;
+    // device 0, sg 0
+    try (final TsFileGenerator generator =
+        new TsFileGenerator(new File(tmpDir, "1-0-0-0.tsfile"))) {
+      // Wrong, with 04-07 non-exist
+      generator.registerAlignedTimeseries(
+          SchemaConfig.DEVICE_0,
+          Arrays.asList(
+              SchemaConfig.MEASUREMENT_00,
+              SchemaConfig.MEASUREMENT_01,
+              SchemaConfig.MEASUREMENT_02,
+              SchemaConfig.MEASUREMENT_03,
+              SchemaConfig.MEASUREMENT_04,
+              SchemaConfig.MEASUREMENT_05,
+              SchemaConfig.MEASUREMENT_06,
+              SchemaConfig.MEASUREMENT_07));
+      generator.generateData(SchemaConfig.DEVICE_0, 100000, PARTITION_INTERVAL / 10_000, false);
+      writtenPoint1 = generator.getTotalNumber();
+    }
+
+    final long writtenPoint2;
+    // device 2, device 3, device4, sg 1
+    try (final TsFileGenerator generator =
+        new TsFileGenerator(new File(tmpDir, "2-0-0-0.tsfile"))) {
+      // right
+      generator.registerTimeseries(
+          SchemaConfig.DEVICE_2, Collections.singletonList(SchemaConfig.MEASUREMENT_20));
+      // right
+      generator.registerTimeseries(
+          SchemaConfig.DEVICE_3, Collections.singletonList(SchemaConfig.MEASUREMENT_30));
+      // Wrong, with 06 non-exist
+      generator.registerTimeseries(
+          SchemaConfig.DEVICE_4,
+          Arrays.asList(SchemaConfig.MEASUREMENT_40, SchemaConfig.MEASUREMENT_06));
+      generator.generateData(SchemaConfig.DEVICE_2, 10000, PARTITION_INTERVAL / 10_000, false);
+      generator.generateData(SchemaConfig.DEVICE_3, 10000, PARTITION_INTERVAL / 10_000, false);
+      generator.generateData(SchemaConfig.DEVICE_4, 10000, PARTITION_INTERVAL / 10_000, true);
+      for (int i = 0; i < 1000; i++) {
+        generator.generateData(SchemaConfig.DEVICE_4, 1, PARTITION_INTERVAL - 10, true);
+      }
+      writtenPoint2 = generator.getTotalNumber();
+    }
+
+    try (final Connection connection = EnvFactory.getEnv().getConnection();
+        final Statement statement = connection.createStatement()) {
+
+      try {
+        statement.execute(
+            String.format(
+                "load \"%s\" with ('database-level'='2', 'convert-on-type-mismatch'='false')",
+                tmpDir.getAbsolutePath() + File.separator + "1-0-0-0.tsfile"));
+        Assert.fail();
+      } catch (final Exception e) {
+        Assert.assertTrue(
+            e.getMessage()
+                .contains(
+                    "TimeSeries under this device is not aligned, please use createTimeSeries or change device. (Path: root.sg.test_0.d_0)."));
+      }
+
+      try {
+        statement.execute(
+            String.format(
+                "load \"%s\" with ('database-level'='2', 'convert-on-type-mismatch'='false')",
+                tmpDir.getAbsolutePath() + File.separator + "2-0-0-0.tsfile"));
+        Assert.fail();
+      } catch (final Exception e) {
+        Assert.assertTrue(
+            e.getMessage()
+                .contains(
+                    "TimeSeries under this device is aligned, please use createAlignedTimeSeries or change device. (Path: root.sg.test_1.a_4)."));
+      }
+
+      statement.execute(String.format("load \"%s\" sglevel=2", tmpDir.getAbsolutePath()));
+
+      try (final ResultSet resultSet =
+          statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
+        if (resultSet.next()) {
+          long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+          Assert.assertEquals(writtenPoint1, sg1Count);
+          long sg2Count = resultSet.getLong("count(root.sg.test_1.*.*)");
+          Assert.assertEquals(writtenPoint2, sg2Count);
+        } else {
+          Assert.fail("This ResultSet is empty.");
+        }
+      }
+    }
+
+    // Try to delete after loading. Expect no deadlock
+    try (final Connection connection = EnvFactory.getEnv().getConnection();
+        final Statement statement = connection.createStatement()) {
+      statement.execute(
+          String.format(
+              "delete timeseries %s.%s",
+              SchemaConfig.DEVICE_0, SchemaConfig.MEASUREMENT_00.getMeasurementName()));
+    }
+  }
+
   @Test
   public void testLoadAcrossMultipleTimePartitions() throws Exception {
     registerSchema();
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/exception/metadata/AlignedTimeSeriesException.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/exception/metadata/AlignedTimeSeriesException.java
deleted file mode 100644
index f159376dfae..00000000000
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/exception/metadata/AlignedTimeSeriesException.java
+++ /dev/null
@@ -1,35 +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.exception.metadata;
-
-import org.apache.iotdb.commons.exception.MetadataException;
-import org.apache.iotdb.rpc.TSStatusCode;
-
-public class AlignedTimeSeriesException extends MetadataException {
-
-  public AlignedTimeSeriesException(final boolean aligned, final String path) {
-    super(
-        String.format(
-            "TimeSeries under this device is%s aligned, please use createTimeSeries or change device. (Path: %s)",
-            aligned ? "" : " not", path),
-        TSStatusCode.ALIGNED_TIMESERIES_ERROR.getStatusCode(),
-        true);
-  }
-}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/TreeSchemaAutoCreatorAndVerifier.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/TreeSchemaAutoCreatorAndVerifier.java
index f0412c36bb8..c174bd7942b 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/TreeSchemaAutoCreatorAndVerifier.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/TreeSchemaAutoCreatorAndVerifier.java
@@ -235,6 +235,10 @@ public class TreeSchemaAutoCreatorAndVerifier {
         handleException(e, loadTsFileAnalyzer.getStatementString());
       }
     } catch (Exception e) {
+      if (e.getCause() instanceof LoadAnalyzeTypeMismatchException
+          && loadTsFileAnalyzer.isConvertOnTypeMismatch()) {
+        throw (LoadAnalyzeTypeMismatchException) e.getCause();
+      }
       handleException(e, loadTsFileAnalyzer.getStatementString());
     }
   }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/AutoCreateSchemaExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/AutoCreateSchemaExecutor.java
index a6a3301aea0..61d58310d7a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/AutoCreateSchemaExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/AutoCreateSchemaExecutor.java
@@ -29,7 +29,7 @@ import org.apache.iotdb.commons.service.metric.PerformanceOverviewMetrics;
 import org.apache.iotdb.db.auth.AuthorityChecker;
 import org.apache.iotdb.db.conf.IoTDBConfig;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.db.exception.metadata.AlignedTimeSeriesException;
+import org.apache.iotdb.db.exception.load.LoadAnalyzeTypeMismatchException;
 import org.apache.iotdb.db.exception.sql.SemanticException;
 import org.apache.iotdb.db.protocol.session.SessionManager;
 import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
@@ -534,7 +534,12 @@ class AutoCreateSchemaExecutor {
         } else {
           // Load does not tolerate the device alignment mismatch
           throw new SemanticException(
-              new AlignedTimeSeriesException(!pair.getLeft(), devicePath.getFullPath()));
+              new LoadAnalyzeTypeMismatchException(
+                  String.format(
+                      "TimeSeries under this device is%s aligned, please use create%sTimeSeries or change device. (Path: %s)",
+                      !pair.getLeft() ? "" : " not",
+                      !pair.getLeft() ? "Aligned" : "",
+                      devicePath.getFullPath())));
         }
       } else {
         failedCreationSet.add(subStatus);


(iotdb) 14/45: Support the JDBC client to prevent SQL injection (#16734)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 4e1df942a492317af3a28fb473c99f6e732ccfc9
Author: Le Yang <56...@qq.com>
AuthorDate: Wed Nov 12 20:16:33 2025 +0800

    Support the JDBC client to prevent SQL injection (#16734)
    
    (cherry picked from commit 96e8681dd51afdce5027a60d01f5ed555bab8ac7)
---
 .../apache/iotdb/jdbc/IoTDBPreparedStatement.java  |  17 ++-
 .../iotdb/jdbc/IoTDBPreparedStatementTest.java     | 154 ++++++++++++++++++++-
 2 files changed, 156 insertions(+), 15 deletions(-)

diff --git a/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java b/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java
index bb6a7641ab5..c92b6549bf9 100644
--- a/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java
+++ b/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java
@@ -909,19 +909,18 @@ public class IoTDBPreparedStatement extends IoTDBStatement implements PreparedSt
 
   @Override
   public void setString(int parameterIndex, String x) {
-    // if the sql is an insert statement and the value is not a string literal, add single quotes
-    // The table model only supports single quotes, the tree model sql both single and double quotes
-    if ("table".equalsIgnoreCase(getSqlDialect())
-        || ((sql.trim().toUpperCase().startsWith("INSERT")
-            && !((x.startsWith("'") && x.endsWith("'"))
-                || ((x.startsWith("\"") && x.endsWith("\""))
-                    && "tree".equals(getSqlDialect())))))) {
-      this.parameters.put(parameterIndex, "'" + x + "'");
+    if (x == null) {
+      this.parameters.put(parameterIndex, null);
     } else {
-      this.parameters.put(parameterIndex, x);
+      this.parameters.put(parameterIndex, "'" + escapeSingleQuotes(x) + "'");
     }
   }
 
+  private String escapeSingleQuotes(String value) {
+    // Escape single quotes with double single quotes
+    return value.replace("'", "''");
+  }
+
   @Override
   public void setTime(int parameterIndex, Time x) throws SQLException {
     try {
diff --git a/iotdb-client/jdbc/src/test/java/org/apache/iotdb/jdbc/IoTDBPreparedStatementTest.java b/iotdb-client/jdbc/src/test/java/org/apache/iotdb/jdbc/IoTDBPreparedStatementTest.java
index 1a523d9459f..2ae65dfed2a 100644
--- a/iotdb-client/jdbc/src/test/java/org/apache/iotdb/jdbc/IoTDBPreparedStatementTest.java
+++ b/iotdb-client/jdbc/src/test/java/org/apache/iotdb/jdbc/IoTDBPreparedStatementTest.java
@@ -200,7 +200,7 @@ public class IoTDBPreparedStatementTest {
         ArgumentCaptor.forClass(TSExecuteStatementReq.class);
     verify(client).executeStatementV2(argument.capture());
     assertEquals(
-        "SELECT status, temperature FROM root.ln.wf01.wt01 WHERE temperature < 'abcde' and time > 2017-11-1 0:13:00",
+        "SELECT status, temperature FROM root.ln.wf01.wt01 WHERE temperature < '''abcde''' and time > 2017-11-1 0:13:00",
         argument.getValue().getStatement());
   }
 
@@ -217,7 +217,7 @@ public class IoTDBPreparedStatementTest {
         ArgumentCaptor.forClass(TSExecuteStatementReq.class);
     verify(client).executeStatementV2(argument.capture());
     assertEquals(
-        "SELECT status, temperature FROM root.ln.wf01.wt01 WHERE temperature < \"abcde\" and time > 2017-11-1 0:13:00",
+        "SELECT status, temperature FROM root.ln.wf01.wt01 WHERE temperature < '\"abcde\"' and time > 2017-11-1 0:13:00",
         argument.getValue().getStatement());
   }
 
@@ -233,7 +233,7 @@ public class IoTDBPreparedStatementTest {
         ArgumentCaptor.forClass(TSExecuteStatementReq.class);
     verify(client).executeStatementV2(argument.capture());
     assertEquals(
-        "SELECT status, temperature FROM root.ln.wf01.wt01", argument.getValue().getStatement());
+        "SELECT status, 'temperature' FROM root.ln.wf01.wt01", argument.getValue().getStatement());
   }
 
   @SuppressWarnings("resource")
@@ -325,7 +325,7 @@ public class IoTDBPreparedStatementTest {
         ArgumentCaptor.forClass(TSExecuteStatementReq.class);
     verify(client).executeStatementV2(argument.capture());
     assertEquals(
-        "INSERT INTO root.ln.wf01.wt01(time,a,b,c,d,e,f) VALUES(12324,false,123,123234345,123.423,-1323.0,'abc')",
+        "INSERT INTO root.ln.wf01.wt01(time,a,b,c,d,e,f) VALUES(12324,false,123,123234345,123.423,-1323.0,'''abc''')",
         argument.getValue().getStatement());
   }
 
@@ -351,7 +351,7 @@ public class IoTDBPreparedStatementTest {
         ArgumentCaptor.forClass(TSExecuteStatementReq.class);
     verify(client).executeStatementV2(argument.capture());
     assertEquals(
-        "INSERT INTO root.ln.wf01.wt01(time,a,b,c,d,e,f,g,h) VALUES(2017-11-01T00:13:00,false,123,123234345,123.423,-1323.0,\"abc\",'abc','abc')",
+        "INSERT INTO root.ln.wf01.wt01(time,a,b,c,d,e,f,g,h) VALUES(2017-11-01T00:13:00,false,123,123234345,123.423,-1323.0,'\"abc\"','abc','''abc''')",
         argument.getValue().getStatement());
   }
 
@@ -374,7 +374,7 @@ public class IoTDBPreparedStatementTest {
         ArgumentCaptor.forClass(TSExecuteStatementReq.class);
     verify(client).executeStatementV2(argument.capture());
     assertEquals(
-        "INSERT INTO root.ln.wf01.wt02(time,a,b,c,d,e,f) VALUES(2020-01-01T10:10:10,false,123,123234345,123.423,-1323.0,\"abc\")",
+        "INSERT INTO root.ln.wf01.wt02(time,a,b,c,d,e,f) VALUES(2020-01-01T10:10:10,false,123,123234345,123.423,-1323.0,'\"abc\"')",
         argument.getValue().getStatement());
   }
 
@@ -400,4 +400,146 @@ public class IoTDBPreparedStatementTest {
         "INSERT INTO root.ln.wf01.wt02(time,a,b,c,d,e,f) VALUES(2020-01-01T10:10:10,false,123,123234345,123.423,-1323.0,'abc')",
         argument.getValue().getStatement());
   }
+
+  // ========== Table Model SQL Injection Prevention Tests ==========
+
+  @SuppressWarnings("resource")
+  @Test
+  public void testTableModelLoginInjectionWithComment() throws Exception {
+    // Login interface SQL injection attack 1: Using -- comments to bypass password checks
+    when(connection.getSqlDialect()).thenReturn("table");
+    String sql = "SELECT * FROM users WHERE username = ? AND password = ?";
+    IoTDBPreparedStatement ps =
+        new IoTDBPreparedStatement(connection, client, sessionId, sql, zoneId);
+    ps.setString(1, "admin' --");
+    ps.setString(2, "password");
+    ps.execute();
+
+    ArgumentCaptor<TSExecuteStatementReq> argument =
+        ArgumentCaptor.forClass(TSExecuteStatementReq.class);
+    verify(client).executeStatementV2(argument.capture());
+    assertEquals(
+        "SELECT * FROM users WHERE username = 'admin'' --' AND password = 'password'",
+        argument.getValue().getStatement());
+  }
+
+  @SuppressWarnings("resource")
+  @Test
+  public void testTableModelLoginInjectionWithORCondition() throws Exception {
+    // Login interface SQL injection attack 2: Bypassing authentication by using 'OR '1'='1
+    when(connection.getSqlDialect()).thenReturn("table");
+    String sql = "SELECT * FROM users WHERE username = ? AND password = ?";
+    IoTDBPreparedStatement ps =
+        new IoTDBPreparedStatement(connection, client, sessionId, sql, zoneId);
+    ps.setString(1, "admin");
+    ps.setString(2, "' OR '1'='1");
+    ps.execute();
+
+    ArgumentCaptor<TSExecuteStatementReq> argument =
+        ArgumentCaptor.forClass(TSExecuteStatementReq.class);
+    verify(client).executeStatementV2(argument.capture());
+    assertEquals(
+        "SELECT * FROM users WHERE username = 'admin' AND password = ''' OR ''1''=''1'",
+        argument.getValue().getStatement());
+  }
+
+  @SuppressWarnings("resource")
+  @Test
+  public void testTableModelQueryWithMultipleInjectionVectors() throws Exception {
+    when(connection.getSqlDialect()).thenReturn("table");
+    String sql = "SELECT * FROM users WHERE email = ?";
+    IoTDBPreparedStatement ps =
+        new IoTDBPreparedStatement(connection, client, sessionId, sql, zoneId);
+    ps.setString(1, "'; DROP TABLE users;");
+    ps.execute();
+
+    ArgumentCaptor<TSExecuteStatementReq> argument =
+        ArgumentCaptor.forClass(TSExecuteStatementReq.class);
+    verify(client).executeStatementV2(argument.capture());
+    assertEquals(
+        "SELECT * FROM users WHERE email = '''; DROP TABLE users;'",
+        argument.getValue().getStatement());
+  }
+
+  @SuppressWarnings("resource")
+  @Test
+  public void testTableModelString1() throws Exception {
+    when(connection.getSqlDialect()).thenReturn("table");
+    String sql = "SELECT * FROM users WHERE password = ?";
+    IoTDBPreparedStatement ps =
+        new IoTDBPreparedStatement(connection, client, sessionId, sql, zoneId);
+    ps.setString(1, "a'b");
+    ps.execute();
+
+    ArgumentCaptor<TSExecuteStatementReq> argument =
+        ArgumentCaptor.forClass(TSExecuteStatementReq.class);
+    verify(client).executeStatementV2(argument.capture());
+    assertEquals("SELECT * FROM users WHERE password = 'a''b'", argument.getValue().getStatement());
+  }
+
+  @SuppressWarnings("resource")
+  @Test
+  public void testTableModelString2() throws Exception {
+    when(connection.getSqlDialect()).thenReturn("table");
+    String sql = "SELECT * FROM users WHERE password = ?";
+    IoTDBPreparedStatement ps =
+        new IoTDBPreparedStatement(connection, client, sessionId, sql, zoneId);
+    ps.setString(1, "a\'b");
+    ps.execute();
+
+    ArgumentCaptor<TSExecuteStatementReq> argument =
+        ArgumentCaptor.forClass(TSExecuteStatementReq.class);
+    verify(client).executeStatementV2(argument.capture());
+    assertEquals("SELECT * FROM users WHERE password = 'a''b'", argument.getValue().getStatement());
+  }
+
+  @SuppressWarnings("resource")
+  @Test
+  public void testTableModelString3() throws Exception {
+    when(connection.getSqlDialect()).thenReturn("table");
+    String sql = "SELECT * FROM users WHERE password = ?";
+    IoTDBPreparedStatement ps =
+        new IoTDBPreparedStatement(connection, client, sessionId, sql, zoneId);
+    ps.setString(1, "a\\'b");
+    ps.execute();
+
+    ArgumentCaptor<TSExecuteStatementReq> argument =
+        ArgumentCaptor.forClass(TSExecuteStatementReq.class);
+    verify(client).executeStatementV2(argument.capture());
+    assertEquals(
+        "SELECT * FROM users WHERE password = 'a\\''b'", argument.getValue().getStatement());
+  }
+
+  @SuppressWarnings("resource")
+  @Test
+  public void testTableModelString4() throws Exception {
+    when(connection.getSqlDialect()).thenReturn("table");
+    String sql = "SELECT * FROM users WHERE password = ?";
+    IoTDBPreparedStatement ps =
+        new IoTDBPreparedStatement(connection, client, sessionId, sql, zoneId);
+    ps.setString(1, "a\\\'b");
+    ps.execute();
+
+    ArgumentCaptor<TSExecuteStatementReq> argument =
+        ArgumentCaptor.forClass(TSExecuteStatementReq.class);
+    verify(client).executeStatementV2(argument.capture());
+    assertEquals(
+        "SELECT * FROM users WHERE password = 'a\\''b'", argument.getValue().getStatement());
+  }
+
+  @SuppressWarnings("resource")
+  @Test
+  public void testTableModelStringWithNull() throws Exception {
+    when(connection.getSqlDialect()).thenReturn("table");
+    String sql = "SELECT * FROM users WHERE email = ?";
+    IoTDBPreparedStatement ps =
+        new IoTDBPreparedStatement(connection, client, sessionId, sql, zoneId);
+    ps.setString(1, null);
+    ps.execute();
+
+    ArgumentCaptor<TSExecuteStatementReq> argument =
+        ArgumentCaptor.forClass(TSExecuteStatementReq.class);
+    verify(client).executeStatementV2(argument.capture());
+    assertEquals("SELECT * FROM users WHERE email = null", argument.getValue().getStatement());
+  }
 }


(iotdb) 03/45: Fixed the potential non-consistency caused by initialize of DataNodeTableCache & Cleared the storageGroups in compatible codes (#16693)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 602d4650aaf0f9a26f41f2898fb51f420fbb344e
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Mon Nov 10 17:27:18 2025 +0800

    Fixed the potential non-consistency caused by initialize of DataNodeTableCache & Cleared the storageGroups in compatible codes (#16693)
    
    * fix
    
    * refactor
    
    * may-complete
    
    * fix
    
    * refactor
    
    * fix
    
    * Update IoTDBFlushQueryIT.java
    
    * bug-fix
    
    * fix
    
    (cherry picked from commit 639de5255ce51c4c104160faafad3fa26ad60e82)
---
 .../it/env/cluster/config/MppCommonConfig.java     |  4 +-
 .../env/cluster/config/MppSharedCommonConfig.java  |  6 +-
 .../apache/iotdb/itbase/constant/TestConstant.java | 14 ++--
 .../org/apache/iotdb/itbase/env/CommonConfig.java  |  2 +-
 .../confignode/it/IoTDBConfigNodeSnapshotIT.java   | 31 ++++-----
 .../it/database/IoTDBDatabaseSetAndDeleteIT.java   | 66 +++++++++---------
 .../it/load/IoTDBConfigNodeSwitchLeaderIT.java     |  2 +-
 .../partition/IoTDBAutoRegionGroupExtensionIT.java |  8 +--
 .../IoTDBCustomRegionGroupExtensionIT.java         |  2 +-
 .../it/partition/IoTDBPartitionCreationIT.java     |  4 +-
 .../it/partition/IoTDBPartitionDurableIT.java      |  4 +-
 .../it/partition/IoTDBPartitionGetterIT.java       | 41 ++++++------
 .../confignode/it/utils/ConfigNodeTestUtils.java   | 16 ++---
 .../org/apache/iotdb/db/it/IoTDBExampleIT.java     |  4 +-
 .../org/apache/iotdb/db/it/IoTDBFlushQueryIT.java  |  5 +-
 .../org/apache/iotdb/db/it/IoTDBRestServiceIT.java |  8 +--
 .../iotdb/db/it/IoTDBSetConfigurationIT.java       |  2 +-
 .../org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java |  2 +-
 .../db/it/IoTDBSyntaxConventionIdentifierIT.java   |  2 +-
 .../apache/iotdb/db/it/path/IoTDBQuotedPathIT.java |  4 +-
 .../db/it/schema/IoTDBAutoCreateSchemaIT.java      | 14 ++--
 .../db/it/schema/IoTDBDeactivateTemplateIT.java    |  2 +-
 .../db/it/schema/IoTDBDeleteTimeSeriesIT.java      |  2 +-
 .../iotdb/db/it/schema/IoTDBMetadataFetchIT.java   |  2 +-
 .../org/apache/iotdb/db/it/schema/IoTDBTagIT.java  |  2 +-
 .../it/query/old/IoTDBSimpleQueryTableIT.java      |  2 +-
 .../iotdb/session/it/IoTDBSessionSimpleIT.java     | 22 +++---
 .../session/it/IoTDBSessionSyntaxConventionIT.java |  6 +-
 .../write/database/PreDeleteDatabasePlan.java      | 22 +++---
 .../iotdb/confignode/manager/ConfigManager.java    | 28 +++-----
 .../apache/iotdb/confignode/manager/IManager.java  | 16 ++---
 .../iotdb/confignode/manager/ProcedureManager.java | 27 ++++++++
 .../iotdb/confignode/manager/load/LoadManager.java |  2 +-
 .../manager/load/balancer/RegionBalancer.java      |  2 +-
 .../manager/schema/ClusterSchemaManager.java       | 26 +++++++-
 .../persistence/partition/PartitionInfo.java       |  2 +-
 .../impl/schema/DeleteDatabaseProcedure.java       | 28 ++++----
 ...ageGroupState.java => DeleteDatabaseState.java} |  2 +-
 .../impl/DataNodeInternalRPCServiceImpl.java       | 48 +++++++------
 .../queryengine/plan/analyze/AnalyzeVisitor.java   |  2 +-
 .../execution/config/TreeConfigTaskVisitor.java    |  3 +-
 .../db/queryengine/plan/parser/ASTVisitor.java     | 18 ++---
 .../metadata/fetcher/TableDeviceSchemaFetcher.java |  6 +-
 .../security/TreeAccessCheckVisitor.java           |  2 +-
 .../plan/statement/StatementVisitor.java           |  2 +-
 .../statement/metadata/CountDatabaseStatement.java |  2 +-
 .../mtree/impl/mem/MTreeBelowSGMemoryImpl.java     | 78 ++++++++++------------
 .../db/schemaengine/table/DataNodeTableCache.java  | 17 +++++
 .../schema/table/NonCommittableTsTable.java}       | 31 ++++-----
 .../apache/iotdb/commons/schema/table/TsTable.java | 24 ++++---
 50 files changed, 357 insertions(+), 310 deletions(-)

diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java
index 1df43c16206..6cb7e008242 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java
@@ -580,8 +580,8 @@ public class MppCommonConfig extends MppBaseConfig implements CommonConfig {
   }
 
   @Override
-  public CommonConfig setDefaultStorageGroupLevel(int defaultStorageGroupLevel) {
-    setProperty("default_database_level", String.valueOf(defaultStorageGroupLevel));
+  public CommonConfig setDefaultDatabaseLevel(int defaultDatabaseLevel) {
+    setProperty("default_database_level", String.valueOf(defaultDatabaseLevel));
     return this;
   }
 
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java
index 504b1ae60e2..1b4801f5692 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java
@@ -602,9 +602,9 @@ public class MppSharedCommonConfig implements CommonConfig {
   }
 
   @Override
-  public CommonConfig setDefaultStorageGroupLevel(int defaultStorageGroupLevel) {
-    dnConfig.setDefaultStorageGroupLevel(defaultStorageGroupLevel);
-    cnConfig.setDefaultStorageGroupLevel(defaultStorageGroupLevel);
+  public CommonConfig setDefaultDatabaseLevel(int defaultDatabaseLevel) {
+    dnConfig.setDefaultDatabaseLevel(defaultDatabaseLevel);
+    cnConfig.setDefaultDatabaseLevel(defaultDatabaseLevel);
     return this;
   }
 
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/constant/TestConstant.java b/integration-test/src/main/java/org/apache/iotdb/itbase/constant/TestConstant.java
index 8a9d11516c5..03b09bc819b 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/constant/TestConstant.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/constant/TestConstant.java
@@ -168,13 +168,12 @@ public class TestConstant {
   }
 
   public static String getTestTsFilePath(
-      String logicalStorageGroupName,
-      long VirtualStorageGroupId,
+      String logicalDatabaseName,
+      long VirtualDatabaseId,
       long TimePartitionId,
       long tsFileVersion) {
     String filePath =
-        String.format(
-            TEST_TSFILE_PATH, logicalStorageGroupName, VirtualStorageGroupId, TimePartitionId);
+        String.format(TEST_TSFILE_PATH, logicalDatabaseName, VirtualDatabaseId, TimePartitionId);
     String fileName =
         System.currentTimeMillis()
             + FilePathUtils.FILE_NAME_SEPARATOR
@@ -184,11 +183,8 @@ public class TestConstant {
   }
 
   public static String getTestTsFileDir(
-      String logicalStorageGroupName, long VirtualStorageGroupId, long TimePartitionId) {
+      String logicalDatabaseName, long VirtualDatabaseId, long TimePartitionId) {
     return String.format(
-        TestConstant.TEST_TSFILE_PATH,
-        logicalStorageGroupName,
-        VirtualStorageGroupId,
-        TimePartitionId);
+        TestConstant.TEST_TSFILE_PATH, logicalDatabaseName, VirtualDatabaseId, TimePartitionId);
   }
 }
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java
index 9767e1c089e..f27bdc8d66d 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java
@@ -186,7 +186,7 @@ public interface CommonConfig {
 
   CommonConfig setSubscriptionEnabled(boolean subscriptionEnabled);
 
-  default CommonConfig setDefaultStorageGroupLevel(int defaultStorageGroupLevel) {
+  default CommonConfig setDefaultDatabaseLevel(int defaultDatabaseLevel) {
     return this;
   }
 
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java
index d906cd43bda..a5c757d8dd3 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java
@@ -106,7 +106,7 @@ public class IoTDBConfigNodeSnapshotIT {
   @Test
   public void testPartitionInfoSnapshot() throws Exception {
     final String sg = "root.sg";
-    final int storageGroupNum = 10;
+    final int databaseNum = 10;
     final int seriesPartitionSlotsNum = 10;
     final int timePartitionSlotsNum = 10;
 
@@ -118,10 +118,10 @@ public class IoTDBConfigNodeSnapshotIT {
 
       Set<TCQEntry> expectedCQEntries = createCQs(client);
 
-      for (int i = 0; i < storageGroupNum; i++) {
-        String storageGroup = sg + i;
-        TDatabaseSchema storageGroupSchema = new TDatabaseSchema(storageGroup);
-        TSStatus status = client.setDatabase(storageGroupSchema);
+      for (int i = 0; i < databaseNum; i++) {
+        String database = sg + i;
+        TDatabaseSchema databaseSchema = new TDatabaseSchema(database);
+        TSStatus status = client.setDatabase(databaseSchema);
         assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
 
         for (int j = 0; j < seriesPartitionSlotsNum; j++) {
@@ -129,7 +129,7 @@ public class IoTDBConfigNodeSnapshotIT {
 
           // Create SchemaPartition
           ByteBuffer patternTree =
-              generatePatternTreeBuffer(new String[] {storageGroup + ".d" + j + ".s"});
+              generatePatternTreeBuffer(new String[] {database + ".d" + j + ".s"});
           TSchemaPartitionReq schemaPartitionReq = new TSchemaPartitionReq(patternTree);
           TSchemaPartitionTableResp schemaPartitionTableResp =
               client.getOrCreateSchemaPartitionTable(schemaPartitionReq);
@@ -139,10 +139,8 @@ public class IoTDBConfigNodeSnapshotIT {
               schemaPartitionTableResp.getStatus().getCode());
           Assert.assertNotNull(schemaPartitionTableResp.getSchemaPartitionTable());
           assertEquals(1, schemaPartitionTableResp.getSchemaPartitionTableSize());
-          Assert.assertNotNull(
-              schemaPartitionTableResp.getSchemaPartitionTable().get(storageGroup));
-          assertEquals(
-              1, schemaPartitionTableResp.getSchemaPartitionTable().get(storageGroup).size());
+          Assert.assertNotNull(schemaPartitionTableResp.getSchemaPartitionTable().get(database));
+          assertEquals(1, schemaPartitionTableResp.getSchemaPartitionTable().get(database).size());
 
           for (int k = 0; k < timePartitionSlotsNum; k++) {
             TTimePartitionSlot timePartitionSlot =
@@ -151,9 +149,9 @@ public class IoTDBConfigNodeSnapshotIT {
             // Create DataPartition
             Map<String, Map<TSeriesPartitionSlot, TTimeSlotList>> partitionSlotsMap =
                 new HashMap<>();
-            partitionSlotsMap.put(storageGroup, new HashMap<>());
+            partitionSlotsMap.put(database, new HashMap<>());
             partitionSlotsMap
-                .get(storageGroup)
+                .get(database)
                 .put(
                     seriesPartitionSlot,
                     new TTimeSlotList()
@@ -167,19 +165,18 @@ public class IoTDBConfigNodeSnapshotIT {
                 dataPartitionTableResp.getStatus().getCode());
             Assert.assertNotNull(dataPartitionTableResp.getDataPartitionTable());
             assertEquals(1, dataPartitionTableResp.getDataPartitionTableSize());
-            Assert.assertNotNull(dataPartitionTableResp.getDataPartitionTable().get(storageGroup));
-            assertEquals(
-                1, dataPartitionTableResp.getDataPartitionTable().get(storageGroup).size());
+            Assert.assertNotNull(dataPartitionTableResp.getDataPartitionTable().get(database));
+            assertEquals(1, dataPartitionTableResp.getDataPartitionTable().get(database).size());
             Assert.assertNotNull(
                 dataPartitionTableResp
                     .getDataPartitionTable()
-                    .get(storageGroup)
+                    .get(database)
                     .get(seriesPartitionSlot));
             assertEquals(
                 1,
                 dataPartitionTableResp
                     .getDataPartitionTable()
-                    .get(storageGroup)
+                    .get(database)
                     .get(seriesPartitionSlot)
                     .size());
           }
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/database/IoTDBDatabaseSetAndDeleteIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/database/IoTDBDatabaseSetAndDeleteIT.java
index e08339823d6..959f37d594d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/database/IoTDBDatabaseSetAndDeleteIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/database/IoTDBDatabaseSetAndDeleteIT.java
@@ -74,17 +74,17 @@ public class IoTDBDatabaseSetAndDeleteIT {
     try (SyncConfigNodeIServiceClient client =
         (SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
       // set Database0 by default values
-      TDatabaseSchema storageGroupSchema0 = new TDatabaseSchema(sg0);
-      status = client.setDatabase(storageGroupSchema0);
+      TDatabaseSchema databaseSchema0 = new TDatabaseSchema(sg0);
+      status = client.setDatabase(databaseSchema0);
       Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
 
       // set Database1 by specific values
-      TDatabaseSchema storageGroupSchema1 =
+      TDatabaseSchema databaseSchema1 =
           new TDatabaseSchema(sg1)
               .setSchemaReplicationFactor(5)
               .setDataReplicationFactor(5)
               .setTimePartitionInterval(2048L);
-      status = client.setDatabase(storageGroupSchema1);
+      status = client.setDatabase(databaseSchema1);
       Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
 
       // test count all Databases
@@ -111,21 +111,21 @@ public class IoTDBDatabaseSetAndDeleteIT {
           TSStatusCode.SUCCESS_STATUS.getStatusCode(), getResp.getStatus().getCode());
       Map<String, TDatabaseSchema> schemaMap = getResp.getDatabaseSchemaMap();
       Assert.assertEquals(2, schemaMap.size());
-      TDatabaseSchema storageGroupSchema = schemaMap.get(sg0);
-      Assert.assertNotNull(storageGroupSchema);
-      Assert.assertEquals(sg0, storageGroupSchema.getName());
-      Assert.assertEquals(1, storageGroupSchema.getSchemaReplicationFactor());
-      Assert.assertEquals(1, storageGroupSchema.getDataReplicationFactor());
-      Assert.assertEquals(604800000, storageGroupSchema.getTimePartitionInterval());
-      storageGroupSchema = schemaMap.get(sg1);
-      Assert.assertNotNull(storageGroupSchema);
-      Assert.assertEquals(sg1, storageGroupSchema.getName());
-      Assert.assertEquals(5, storageGroupSchema.getSchemaReplicationFactor());
-      Assert.assertEquals(5, storageGroupSchema.getDataReplicationFactor());
-      Assert.assertEquals(2048L, storageGroupSchema.getTimePartitionInterval());
+      TDatabaseSchema databaseSchema = schemaMap.get(sg0);
+      Assert.assertNotNull(databaseSchema);
+      Assert.assertEquals(sg0, databaseSchema.getName());
+      Assert.assertEquals(1, databaseSchema.getSchemaReplicationFactor());
+      Assert.assertEquals(1, databaseSchema.getDataReplicationFactor());
+      Assert.assertEquals(604800000, databaseSchema.getTimePartitionInterval());
+      databaseSchema = schemaMap.get(sg1);
+      Assert.assertNotNull(databaseSchema);
+      Assert.assertEquals(sg1, databaseSchema.getName());
+      Assert.assertEquals(5, databaseSchema.getSchemaReplicationFactor());
+      Assert.assertEquals(5, databaseSchema.getDataReplicationFactor());
+      Assert.assertEquals(2048L, databaseSchema.getTimePartitionInterval());
 
       // test fail by re-register
-      status = client.setDatabase(storageGroupSchema0);
+      status = client.setDatabase(databaseSchema0);
       Assert.assertEquals(TSStatusCode.DATABASE_ALREADY_EXISTS.getStatusCode(), status.getCode());
 
       // test Database setter interfaces
@@ -149,35 +149,35 @@ public class IoTDBDatabaseSetAndDeleteIT {
           TSStatusCode.SUCCESS_STATUS.getStatusCode(), getResp.getStatus().getCode());
       schemaMap = getResp.getDatabaseSchemaMap();
       Assert.assertEquals(1, schemaMap.size());
-      storageGroupSchema = schemaMap.get(sg1);
-      Assert.assertNotNull(storageGroupSchema);
-      Assert.assertEquals(sg1, storageGroupSchema.getName());
-      Assert.assertEquals(1, storageGroupSchema.getSchemaReplicationFactor());
-      Assert.assertEquals(1, storageGroupSchema.getDataReplicationFactor());
-      Assert.assertEquals(604800, storageGroupSchema.getTimePartitionInterval());
+      databaseSchema = schemaMap.get(sg1);
+      Assert.assertNotNull(databaseSchema);
+      Assert.assertEquals(sg1, databaseSchema.getName());
+      Assert.assertEquals(1, databaseSchema.getSchemaReplicationFactor());
+      Assert.assertEquals(1, databaseSchema.getDataReplicationFactor());
+      Assert.assertEquals(604800, databaseSchema.getTimePartitionInterval());
     }
   }
 
   @Test
-  public void testDeleteStorageGroup() throws Exception {
+  public void testDeleteDatabase() throws Exception {
     TSStatus status;
     final String sg0 = "root.sg0";
     final String sg1 = "root.sg1";
 
     try (SyncConfigNodeIServiceClient client =
         (SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
-      TDatabaseSchema storageGroupSchema0 = new TDatabaseSchema(sg0);
-      // set StorageGroup0 by default values
-      status = client.setDatabase(storageGroupSchema0);
+      TDatabaseSchema databaseSchema0 = new TDatabaseSchema(sg0);
+      // set Database0 by default values
+      status = client.setDatabase(databaseSchema0);
       Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
-      // set StorageGroup1 by specific values
-      TDatabaseSchema storageGroupSchema1 = new TDatabaseSchema(sg1);
-      status = client.setDatabase(storageGroupSchema1);
+      // set Database1 by specific values
+      TDatabaseSchema databaseSchema1 = new TDatabaseSchema(sg1);
+      status = client.setDatabase(databaseSchema1);
       Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
-      TDeleteDatabasesReq deleteStorageGroupsReq = new TDeleteDatabasesReq();
+      TDeleteDatabasesReq deleteDatabasesReq = new TDeleteDatabasesReq();
       List<String> sgs = Arrays.asList(sg0, sg1);
-      deleteStorageGroupsReq.setPrefixPathList(sgs);
-      TSStatus deleteSgStatus = client.deleteDatabases(deleteStorageGroupsReq);
+      deleteDatabasesReq.setPrefixPathList(sgs);
+      TSStatus deleteSgStatus = client.deleteDatabases(deleteDatabasesReq);
       TDatabaseSchemaResp root =
           client.getMatchedDatabaseSchemas(
               new TGetDatabaseReq(Arrays.asList("root", "sg*"), ALL_MATCH_SCOPE_BINARY));
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBConfigNodeSwitchLeaderIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBConfigNodeSwitchLeaderIT.java
index a49d1501af5..2246ce4314a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBConfigNodeSwitchLeaderIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBConfigNodeSwitchLeaderIT.java
@@ -101,7 +101,7 @@ public class IoTDBConfigNodeSwitchLeaderIT {
 
     try (SyncConfigNodeIServiceClient client =
         (SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
-      // Set StorageGroups
+      // Set Databases
       status = client.setDatabase((new TDatabaseSchema(sg0)));
       Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
       status = client.setDatabase((new TDatabaseSchema(sg1)));
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java
index a82b992a4df..33481d9faae 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java
@@ -100,9 +100,9 @@ public class IoTDBAutoRegionGroupExtensionIT {
     try (SyncConfigNodeIServiceClient client =
         (SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
 
-      setStorageGroupAndCheckRegionGroupDistribution(client);
+      setDatabaseAndCheckRegionGroupDistribution(client);
 
-      // Delete all StorageGroups
+      // Delete all Databases
       for (int i = 0; i < TEST_DATABASE_NUM; i++) {
         String curSg = DATABASE + i;
         client.deleteDatabase(new TDeleteDatabaseReq(curSg));
@@ -126,11 +126,11 @@ public class IoTDBAutoRegionGroupExtensionIT {
       Assert.assertTrue(isAllRegionGroupDeleted);
 
       // Re-test for safety
-      setStorageGroupAndCheckRegionGroupDistribution(client);
+      setDatabaseAndCheckRegionGroupDistribution(client);
     }
   }
 
-  private void setStorageGroupAndCheckRegionGroupDistribution(SyncConfigNodeIServiceClient client)
+  private void setDatabaseAndCheckRegionGroupDistribution(SyncConfigNodeIServiceClient client)
       throws TException, IllegalPathException, IOException {
 
     for (int i = 0; i < TEST_DATABASE_NUM; i++) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBCustomRegionGroupExtensionIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBCustomRegionGroupExtensionIT.java
index 820e6835c59..64b35875a20 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBCustomRegionGroupExtensionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBCustomRegionGroupExtensionIT.java
@@ -98,7 +98,7 @@ public class IoTDBCustomRegionGroupExtensionIT {
       for (int i = 0; i < testSgNum; i++) {
         String curSg = sg + i;
 
-        /* Set StorageGroup */
+        /* Set Database */
         TSStatus status = client.setDatabase(new TDatabaseSchema(curSg));
         Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
 
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionCreationIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionCreationIT.java
index 5043b4a8426..954f54e01bd 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionCreationIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionCreationIT.java
@@ -96,10 +96,10 @@ public class IoTDBPartitionCreationIT {
     // Init 1C3D environment
     EnvFactory.getEnv().initClusterEnvironment(1, 3);
 
-    setStorageGroup();
+    setDatabase();
   }
 
-  private void setStorageGroup() throws Exception {
+  private void setDatabase() throws Exception {
     try (SyncConfigNodeIServiceClient client =
         (SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
       TSStatus status = client.setDatabase(new TDatabaseSchema(sg));
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java
index ceedc355295..8d6e4a5f831 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java
@@ -104,10 +104,10 @@ public class IoTDBPartitionDurableIT {
     // Init 1C3D environment
     EnvFactory.getEnv().initClusterEnvironment(1, 3);
 
-    setStorageGroup();
+    setDatabase();
   }
 
-  private void setStorageGroup() throws Exception {
+  private void setDatabase() throws Exception {
     try (SyncConfigNodeIServiceClient client =
         (SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
       TSStatus status = client.setDatabase(new TDatabaseSchema(sg));
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java
index 6ca5d884b07..f110d4a8d28 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java
@@ -84,7 +84,7 @@ public class IoTDBPartitionGetterIT {
   private static final int testDataRegionGroupPerDatabase = 5;
 
   private static final String sg = "root.sg";
-  private static final int storageGroupNum = 2;
+  private static final int databaseNum = 2;
   private static final int testSeriesPartitionSlotNum = 1000;
   private static final int seriesPartitionBatchSize = 10;
   private static final int testTimePartitionSlotsNum = 10;
@@ -116,8 +116,8 @@ public class IoTDBPartitionGetterIT {
   private static void prepareData() throws Exception {
     try (SyncConfigNodeIServiceClient client =
         (SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
-      /* Set StorageGroups */
-      for (int i = 0; i < storageGroupNum; i++) {
+      /* Set Databases */
+      for (int i = 0; i < databaseNum; i++) {
         TSStatus status = client.setDatabase(new TDatabaseSchema(sg + i));
         Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
       }
@@ -149,13 +149,13 @@ public class IoTDBPartitionGetterIT {
       }
 
       /* Create DataPartitions */
-      for (int i = 0; i < storageGroupNum; i++) {
-        String storageGroup = sg + i;
+      for (int i = 0; i < databaseNum; i++) {
+        String database = sg + i;
         for (int j = 0; j < testSeriesPartitionSlotNum; j += seriesPartitionBatchSize) {
           for (long k = 0; k < testTimePartitionSlotsNum; k += timePartitionBatchSize) {
             Map<String, Map<TSeriesPartitionSlot, TTimeSlotList>> partitionSlotsMap =
                 ConfigNodeTestUtils.constructPartitionSlotsMap(
-                    storageGroup,
+                    database,
                     j,
                     j + seriesPartitionBatchSize,
                     k,
@@ -187,7 +187,7 @@ public class IoTDBPartitionGetterIT {
                 dataPartitionTableResp.getStatus().getCode());
             Assert.assertNotNull(dataPartitionTableResp.getDataPartitionTable());
             ConfigNodeTestUtils.checkDataPartitionTable(
-                storageGroup,
+                database,
                 j,
                 j + seriesPartitionBatchSize,
                 k,
@@ -229,7 +229,7 @@ public class IoTDBPartitionGetterIT {
           schemaPartitionTableResp.getStatus().getCode());
       Assert.assertEquals(0, schemaPartitionTableResp.getSchemaPartitionTableSize());
 
-      // Test getSchemaPartition, when a device path doesn't match any StorageGroup and including
+      // Test getSchemaPartition, when a device path doesn't match any Database and including
       // "**", ConfigNode will return all the SchemaPartitions
       buffer = generatePatternTreeBuffer(new String[] {allPaths});
       schemaPartitionReq.setPathPatternTree(buffer);
@@ -244,8 +244,8 @@ public class IoTDBPartitionGetterIT {
         Assert.assertEquals(2, schemaPartitionTable.get(sg + i).size());
       }
 
-      // Test getSchemaPartition, when a device path matches with a StorageGroup and end with "*",
-      // ConfigNode will return all the SchemaPartitions in this StorageGroup
+      // Test getSchemaPartition, when a device path matches with a Database and end with "*",
+      // ConfigNode will return all the SchemaPartitions in this Database
       buffer = generatePatternTreeBuffer(new String[] {allSg0, d11});
       schemaPartitionReq.setPathPatternTree(buffer);
       schemaPartitionTableResp = client.getSchemaPartitionTable(schemaPartitionReq);
@@ -295,17 +295,16 @@ public class IoTDBPartitionGetterIT {
       }
       int leastDataRegionGroupNum =
           (int)
-              Math.ceil(
-                  (double) totalCpuCoreNum / (double) (storageGroupNum * testReplicationFactor));
+              Math.ceil((double) totalCpuCoreNum / (double) (databaseNum * testReplicationFactor));
       leastDataRegionGroupNum = Math.min(leastDataRegionGroupNum, testDataRegionGroupPerDatabase);
 
-      for (int i = 0; i < storageGroupNum; i++) {
-        String storageGroup = sg + i;
+      for (int i = 0; i < databaseNum; i++) {
+        String database = sg + i;
         for (int j = 0; j < testSeriesPartitionSlotNum; j += seriesPartitionBatchSize) {
           for (long k = 0; k < testTimePartitionSlotsNum; k += timePartitionBatchSize) {
             partitionSlotsMap =
                 ConfigNodeTestUtils.constructPartitionSlotsMap(
-                    storageGroup,
+                    database,
                     j,
                     j + seriesPartitionBatchSize,
                     k,
@@ -320,7 +319,7 @@ public class IoTDBPartitionGetterIT {
                 dataPartitionTableResp.getStatus().getCode());
             Assert.assertNotNull(dataPartitionTableResp.getDataPartitionTable());
             ConfigNodeTestUtils.checkDataPartitionTable(
-                storageGroup,
+                database,
                 j,
                 j + seriesPartitionBatchSize,
                 k,
@@ -334,10 +333,10 @@ public class IoTDBPartitionGetterIT {
         // And this number should be greater than or equal to leastDataRegionGroupNum
         TGetDatabaseReq req =
             new TGetDatabaseReq(
-                Arrays.asList(storageGroup.split("\\.")), SchemaConstant.ALL_MATCH_SCOPE_BINARY);
-        TShowDatabaseResp showStorageGroupResp = client.showDatabase(req);
+                Arrays.asList(database.split("\\.")), SchemaConstant.ALL_MATCH_SCOPE_BINARY);
+        TShowDatabaseResp showDatabaseResp = client.showDatabase(req);
         Assert.assertTrue(
-            showStorageGroupResp.getDatabaseInfoMap().get(storageGroup).getDataRegionNum()
+            showDatabaseResp.getDatabaseInfoMap().get(database).getDataRegionNum()
                 >= leastDataRegionGroupNum);
       }
     }
@@ -394,7 +393,7 @@ public class IoTDBPartitionGetterIT {
           TSStatusCode.SUCCESS_STATUS.getStatusCode(), getRegionIdResp.status.getCode());
 
       // Get all RegionIds within database
-      for (int i = 0; i < storageGroupNum; i++) {
+      for (int i = 0; i < databaseNum; i++) {
         String curSg = sg + i;
         getRegionIdReq = new TGetRegionIdReq(TConsensusGroupType.DataRegion);
         getRegionIdReq.setDatabase(curSg);
@@ -536,7 +535,7 @@ public class IoTDBPartitionGetterIT {
       Assert.assertEquals(
           TSStatusCode.SUCCESS_STATUS.getStatusCode(), nodeManagementResp.getStatus().getCode());
       // +1 for AUDIT database
-      Assert.assertEquals(storageGroupNum + 1, nodeManagementResp.getMatchedNodeSize());
+      Assert.assertEquals(databaseNum + 1, nodeManagementResp.getMatchedNodeSize());
       Assert.assertNotNull(nodeManagementResp.getSchemaRegionMap());
       Assert.assertEquals(0, nodeManagementResp.getSchemaRegionMapSize());
     }
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/utils/ConfigNodeTestUtils.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/utils/ConfigNodeTestUtils.java
index dfc37e52526..0697a6c674d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/utils/ConfigNodeTestUtils.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/utils/ConfigNodeTestUtils.java
@@ -120,24 +120,24 @@ public class ConfigNodeTestUtils {
   }
 
   public static Map<String, Map<TSeriesPartitionSlot, TTimeSlotList>> constructPartitionSlotsMap(
-      String storageGroup,
+      String database,
       int seriesSlotStart,
       int seriesSlotEnd,
       long timeSlotStart,
       long timeSlotEnd,
       long timePartitionInterval) {
     Map<String, Map<TSeriesPartitionSlot, TTimeSlotList>> result = new HashMap<>();
-    result.put(storageGroup, new HashMap<>());
+    result.put(database, new HashMap<>());
 
     for (int i = seriesSlotStart; i < seriesSlotEnd; i++) {
       TSeriesPartitionSlot seriesPartitionSlot = new TSeriesPartitionSlot(i);
       result
-          .get(storageGroup)
+          .get(database)
           .put(seriesPartitionSlot, new TTimeSlotList().setTimePartitionSlots(new ArrayList<>()));
       for (long j = timeSlotStart; j < timeSlotEnd; j++) {
         TTimePartitionSlot timePartitionSlot = new TTimePartitionSlot(j * timePartitionInterval);
         result
-            .get(storageGroup)
+            .get(database)
             .get(seriesPartitionSlot)
             .getTimePartitionSlots()
             .add(timePartitionSlot);
@@ -148,7 +148,7 @@ public class ConfigNodeTestUtils {
   }
 
   public static void checkDataPartitionTable(
-      String storageGroup,
+      String database,
       int seriesSlotStart,
       int seriesSlotEnd,
       long timeSlotStart,
@@ -157,12 +157,12 @@ public class ConfigNodeTestUtils {
       Map<String, Map<TSeriesPartitionSlot, Map<TTimePartitionSlot, List<TConsensusGroupId>>>>
           dataPartitionTable) {
 
-    // Check the existence of StorageGroup
-    Assert.assertTrue(dataPartitionTable.containsKey(storageGroup));
+    // Check the existence of Database
+    Assert.assertTrue(dataPartitionTable.containsKey(database));
 
     // Check the number of SeriesPartitionSlot
     Map<TSeriesPartitionSlot, Map<TTimePartitionSlot, List<TConsensusGroupId>>>
-        seriesPartitionTable = dataPartitionTable.get(storageGroup);
+        seriesPartitionTable = dataPartitionTable.get(database);
     Assert.assertEquals(seriesSlotEnd - seriesSlotStart, seriesPartitionTable.size());
 
     for (int i = seriesSlotStart; i < seriesSlotEnd; i++) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
index 91bf6462033..d51a058ec51 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
@@ -58,8 +58,8 @@ public class IoTDBExampleIT {
       statement.execute("CREATE DATABASE root.sg");
       try (ResultSet resultSet = statement.executeQuery("show databases root.sg")) {
         if (resultSet.next()) {
-          String storageGroupPath = resultSet.getString(ColumnHeaderConstant.DATABASE);
-          Assert.assertEquals("root.sg", storageGroupPath);
+          String databasePath = resultSet.getString(ColumnHeaderConstant.DATABASE);
+          Assert.assertEquals("root.sg", databasePath);
         } else {
           Assert.fail("This ResultSet is empty.");
         }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryIT.java
index ae039b792b1..6253e618eda 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryIT.java
@@ -26,7 +26,6 @@ import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
@@ -166,7 +165,6 @@ public class IoTDBFlushQueryIT {
   }
 
   @Test
-  @Ignore
   public void testFlushNotExistGroupNoData() {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
@@ -175,8 +173,7 @@ public class IoTDBFlushQueryIT {
         statement.execute(
             "FLUSH root.noexist.nodatagroup1,root.notExistGroup1,root.notExistGroup2");
       } catch (SQLException sqe) {
-        String expectedMsg =
-            "322: 322: storageGroup root.notExistGroup1,root.notExistGroup2 does not exist";
+        String expectedMsg = "500: Database root.notExistGroup1,root.notExistGroup2 does not exist";
         sqe.printStackTrace();
         assertTrue(sqe.getMessage().contains(expectedMsg));
       }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java
index 7d6d8774385..d84a2493cc2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestServiceIT.java
@@ -393,7 +393,7 @@ public class IoTDBRestServiceIT {
     queryShowChildPaths(httpClient);
     queryShowNodes(httpClient);
     showAllTTL(httpClient);
-    showStorageGroup(httpClient);
+    showDatabase(httpClient);
     showFunctions(httpClient);
     showTimeseries(httpClient);
 
@@ -413,7 +413,7 @@ public class IoTDBRestServiceIT {
     queryShowChildPathsV2(httpClient);
     queryShowNodesV2(httpClient);
     showAllTTLV2(httpClient);
-    showStorageGroupV2(httpClient);
+    showDatabaseV2(httpClient);
     showFunctionsV2(httpClient);
     showTimeseriesV2(httpClient);
 
@@ -1094,7 +1094,7 @@ public class IoTDBRestServiceIT {
     Assert.assertEquals(values2, valuesResult.get(1));
   }
 
-  public void showStorageGroup(CloseableHttpClient httpClient) {
+  public void showDatabase(CloseableHttpClient httpClient) {
     String sql = "{\"sql\":\"SHOW DATABASES root.sg25\"}";
     Map map = queryMetaData(httpClient, sql);
     List<String> columnNamesResult = (List<String>) map.get("columnNames");
@@ -1757,7 +1757,7 @@ public class IoTDBRestServiceIT {
     Assert.assertEquals(values2, valuesResult.get(1));
   }
 
-  public void showStorageGroupV2(CloseableHttpClient httpClient) {
+  public void showDatabaseV2(CloseableHttpClient httpClient) {
     String sql = "{\"sql\":\"SHOW DATABASES root.sg25\"}";
     Map map = queryMetaDataV2(httpClient, sql);
     List<String> columnNamesResult = (List<String>) map.get("column_names");
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSetConfigurationIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSetConfigurationIT.java
index aceec6d2075..96ee0bc30c1 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSetConfigurationIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSetConfigurationIT.java
@@ -188,7 +188,7 @@ public class IoTDBSetConfigurationIT {
 
     // can start with an illegal value
     EnvFactory.getEnv().cleanClusterEnvironment();
-    EnvFactory.getEnv().getConfig().getCommonConfig().setDefaultStorageGroupLevel(-1);
+    EnvFactory.getEnv().getConfig().getCommonConfig().setDefaultDatabaseLevel(-1);
     EnvFactory.getEnv().initClusterEnvironment();
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
index 19ca146e2e6..c56c0077f29 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
@@ -1040,7 +1040,7 @@ public class IoTDBSimpleQueryIT {
   }
 
   @Test
-  public void testStorageGroupWithHyphenInName() {
+  public void testDatabaseWithHyphenInName() {
     try (final Connection connection = EnvFactory.getEnv().getConnection();
         final Statement statement = connection.createStatement()) {
       statement.setFetchSize(5);
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java
index 8be33862554..c21e4e347c4 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java
@@ -388,7 +388,7 @@ public class IoTDBSyntaxConventionIdentifierIT {
   }
 
   @Test
-  public void testCreateIllegalStorageGroup() {
+  public void testCreateIllegalDatabase() {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
 
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/path/IoTDBQuotedPathIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/path/IoTDBQuotedPathIT.java
index 4cba7008a22..ed98ff2eac8 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/path/IoTDBQuotedPathIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/path/IoTDBQuotedPathIT.java
@@ -101,13 +101,13 @@ public class IoTDBQuotedPathIT {
   }
 
   @Test
-  public void testIllegalStorageGroup() {
+  public void testIllegalDatabase() {
     try (final Connection connection = EnvFactory.getEnv().getConnection();
         final Statement statement = connection.createStatement()) {
       statement.execute("CREATE DATABASE root.`\"ln`");
     } catch (final SQLException e) {
       Assert.assertTrue(
-          e.getMessage().contains("Error StorageGroup name")
+          e.getMessage().contains("Error Database name")
               || e.getMessage()
                   .contains(
                       "The database name can only contain english or chinese characters, numbers, backticks and underscores."));
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAutoCreateSchemaIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAutoCreateSchemaIT.java
index 5453fdc9ab1..620411b8c78 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAutoCreateSchemaIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAutoCreateSchemaIT.java
@@ -164,12 +164,12 @@ public class IoTDBAutoCreateSchemaIT extends AbstractSchemaIT {
    */
   @Test
   public void testInsertAutoCreate2() throws Exception {
-    String storageGroup = "root.sg2.a.b.c";
+    String database = "root.sg2.a.b.c";
     String timeSeriesPrefix = "root.sg2.a.b";
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
-      statement.execute(String.format("CREATE DATABASE %s", storageGroup));
+      statement.execute(String.format("CREATE DATABASE %s", database));
       try {
         statement.execute(
             String.format("INSERT INTO %s(timestamp, c) values(123, \"aabb\")", timeSeriesPrefix));
@@ -177,18 +177,18 @@ public class IoTDBAutoCreateSchemaIT extends AbstractSchemaIT {
       }
 
       // ensure that current database in cache is right.
-      InsertAutoCreate2Tool(statement, storageGroup, timeSeriesPrefix);
+      InsertAutoCreate2Tool(statement, database, timeSeriesPrefix);
     }
     // todo restart test
     //    EnvironmentUtils.stopDaemon();
     //    setUp();
     //
     //    // ensure that database in cache is right after recovering.
-    //    InsertAutoCreate2Tool(storageGroup, timeSeriesPrefix);
+    //    InsertAutoCreate2Tool(database, timeSeriesPrefix);
   }
 
-  private void InsertAutoCreate2Tool(
-      Statement statement, String storageGroup, String timeSeriesPrefix) throws SQLException {
+  private void InsertAutoCreate2Tool(Statement statement, String database, String timeSeriesPrefix)
+      throws SQLException {
     Set<String> resultList = new HashSet<>();
     try (ResultSet resultSet = statement.executeQuery("show timeseries")) {
       while (resultSet.next()) {
@@ -204,7 +204,7 @@ public class IoTDBAutoCreateSchemaIT extends AbstractSchemaIT {
         resultList.add(resultSet.getString(ColumnHeaderConstant.DATABASE));
       }
     }
-    Assert.assertTrue(resultList.contains(storageGroup));
+    Assert.assertTrue(resultList.contains(database));
   }
 
   /**
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java
index eb02ca1d7ee..22572aac6ee 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java
@@ -170,7 +170,7 @@ public class IoTDBDeactivateTemplateIT extends AbstractSchemaIT {
   }
 
   @Test
-  public void deactivateTemplateCrossStorageGroupTest() throws Exception {
+  public void deactivateTemplateCrossDatabaseTest() throws Exception {
     String insertSql = "insert into root.sg%d.d2(time, s1, s2) values(%d, %d, %d)";
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeSeriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeSeriesIT.java
index c278fd89f0a..0866b37836e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeSeriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeSeriesIT.java
@@ -304,7 +304,7 @@ public class IoTDBDeleteTimeSeriesIT extends AbstractSchemaIT {
   }
 
   @Test
-  public void deleteTimeSeriesCrossStorageGroupTest() throws Exception {
+  public void deleteTimeSeriesCrossDatabaseTest() throws Exception {
     String[] retArray1 = new String[] {"4,4,4,4"};
 
     String insertSql = "insert into root.sg%d.d1(time, s1, s2) values(%d, %d, %d)";
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java
index cb2d1ff3d47..1b6818d39f0 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java
@@ -592,7 +592,7 @@ public class IoTDBMetadataFetchIT extends AbstractSchemaIT {
   }
 
   @Test
-  public void showCountStorageGroup() throws SQLException {
+  public void showCountDatabase() throws SQLException {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       String[] sqls =
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java
index 8ed8d1ee29a..a403758cc36 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java
@@ -1073,7 +1073,7 @@ public class IoTDBTagIT extends AbstractSchemaIT {
   }
 
   @Test
-  public void deleteStorageGroupTest() {
+  public void deleteDatabaseTest() {
     List<String> ret =
         Collections.singletonList(
             "root.turbine.d1.s1,temperature,root.turbine,FLOAT,RLE,SNAPPY,"
diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/IoTDBSimpleQueryTableIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/IoTDBSimpleQueryTableIT.java
index d89c7a6b3e4..b97dc4915a1 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/IoTDBSimpleQueryTableIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/IoTDBSimpleQueryTableIT.java
@@ -606,7 +606,7 @@ public class IoTDBSimpleQueryTableIT {
   }
 
   @Test
-  public void testStorageGroupWithHyphenInName() {
+  public void testDatabaseWithHyphenInName() {
     try (final Connection connection =
             EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
         final Statement statement = connection.createStatement()) {
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java
index e60eb5471c9..38f6345bae5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSimpleIT.java
@@ -406,11 +406,11 @@ public class IoTDBSessionSimpleIT {
         session.close();
         return;
       }
-      String storageGroup = "root.存储组1";
+      String database = "root.存储组1";
       String[] devices = new String[] {"设备1.指标1", "设备1.s2", "d2.s1", "d2.指标2"};
-      session.setStorageGroup(storageGroup);
+      session.setStorageGroup(database);
       for (String path : devices) {
-        String fullPath = storageGroup + TsFileConstant.PATH_SEPARATOR + path;
+        String fullPath = database + TsFileConstant.PATH_SEPARATOR + path;
         session.createTimeseries(
             fullPath, TSDataType.INT64, TSEncoding.RLE, CompressionType.SNAPPY);
       }
@@ -418,7 +418,7 @@ public class IoTDBSessionSimpleIT {
       for (String path : devices) {
         for (int i = 0; i < 10; i++) {
           String[] ss = path.split("\\.");
-          StringBuilder deviceId = new StringBuilder(storageGroup);
+          StringBuilder deviceId = new StringBuilder(database);
           for (int j = 0; j < ss.length - 1; j++) {
             deviceId.append(TsFileConstant.PATH_SEPARATOR).append(ss[j]);
           }
@@ -441,7 +441,7 @@ public class IoTDBSessionSimpleIT {
         count++;
       }
       assertEquals(10, count);
-      session.deleteStorageGroup(storageGroup);
+      session.deleteDatabase(database);
     } catch (Exception e) {
       e.printStackTrace();
       fail(e.getMessage());
@@ -757,8 +757,8 @@ public class IoTDBSessionSimpleIT {
         session.close();
         return;
       }
-      String storageGroup = "root.sg";
-      session.setStorageGroup(storageGroup);
+      String database = "root.sg";
+      session.setStorageGroup(database);
 
       session.createTimeseries(
           "root.sg.`my.device.with.colon:`.s",
@@ -769,7 +769,7 @@ public class IoTDBSessionSimpleIT {
       final SessionDataSet dataSet = session.executeQueryStatement("SHOW TIMESERIES");
       assertTrue(dataSet.hasNext());
 
-      session.deleteStorageGroup(storageGroup);
+      session.deleteDatabase(database);
     } catch (Exception e) {
       e.printStackTrace();
       fail(e.getMessage());
@@ -785,8 +785,8 @@ public class IoTDBSessionSimpleIT {
         session.close();
         return;
       }
-      String storageGroup = "root.sg";
-      session.setStorageGroup(storageGroup);
+      String database = "root.sg";
+      session.setStorageGroup(database);
 
       try {
         session.createTimeseries(
@@ -804,7 +804,7 @@ public class IoTDBSessionSimpleIT {
       final SessionDataSet dataSet = session.executeQueryStatement("SHOW TIMESERIES root.sg.**");
       assertFalse(dataSet.hasNext());
 
-      session.deleteStorageGroup(storageGroup);
+      session.deleteDatabase(database);
     } catch (Exception e) {
       e.printStackTrace();
       fail(e.getMessage());
diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSyntaxConventionIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSyntaxConventionIT.java
index ac0c7501d26..ac65c6be784 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSyntaxConventionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionSyntaxConventionIT.java
@@ -69,8 +69,8 @@ public class IoTDBSessionSyntaxConventionIT {
   @Test
   public void createTimeSeriesTest() {
     try (ISession session = EnvFactory.getEnv().getSessionConnection()) {
-      String storageGroup = "root.sg";
-      session.setStorageGroup(storageGroup);
+      String database = "root.sg";
+      session.setStorageGroup(database);
 
       try {
         session.createTimeseries(
@@ -91,7 +91,7 @@ public class IoTDBSessionSyntaxConventionIT {
       final SessionDataSet dataSet = session.executeQueryStatement("SHOW TIMESERIES root.sg.**");
       assertFalse(dataSet.hasNext());
 
-      session.deleteStorageGroup(storageGroup);
+      session.deleteDatabase(database);
     } catch (Exception e) {
       e.printStackTrace();
       fail(e.getMessage());
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/write/database/PreDeleteDatabasePlan.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/write/database/PreDeleteDatabasePlan.java
index bc9313f92f1..743f305398c 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/write/database/PreDeleteDatabasePlan.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/write/database/PreDeleteDatabasePlan.java
@@ -29,25 +29,25 @@ import java.nio.ByteBuffer;
 import java.util.Objects;
 
 public class PreDeleteDatabasePlan extends ConfigPhysicalPlan {
-  private String storageGroup;
+  private String database;
   private PreDeleteType preDeleteType;
 
   public PreDeleteDatabasePlan() {
     super(ConfigPhysicalPlanType.PreDeleteDatabase);
   }
 
-  public PreDeleteDatabasePlan(String storageGroup, PreDeleteType preDeleteType) {
+  public PreDeleteDatabasePlan(String database, PreDeleteType preDeleteType) {
     this();
-    this.storageGroup = storageGroup;
+    this.database = database;
     this.preDeleteType = preDeleteType;
   }
 
-  public String getStorageGroup() {
-    return storageGroup;
+  public String getDatabase() {
+    return database;
   }
 
-  public void setStorageGroup(String storageGroup) {
-    this.storageGroup = storageGroup;
+  public void setDatabase(String database) {
+    this.database = database;
   }
 
   public PreDeleteType getPreDeleteType() {
@@ -57,13 +57,13 @@ public class PreDeleteDatabasePlan extends ConfigPhysicalPlan {
   @Override
   protected void serializeImpl(DataOutputStream stream) throws IOException {
     stream.writeShort(getType().getPlanType());
-    BasicStructureSerDeUtil.write(storageGroup, stream);
+    BasicStructureSerDeUtil.write(database, stream);
     stream.write(preDeleteType.getType());
   }
 
   @Override
   protected void deserializeImpl(ByteBuffer buffer) throws IOException {
-    this.storageGroup = BasicStructureSerDeUtil.readString(buffer);
+    this.database = BasicStructureSerDeUtil.readString(buffer);
     this.preDeleteType = buffer.get() == (byte) 1 ? PreDeleteType.ROLLBACK : PreDeleteType.EXECUTE;
   }
 
@@ -79,12 +79,12 @@ public class PreDeleteDatabasePlan extends ConfigPhysicalPlan {
       return false;
     }
     PreDeleteDatabasePlan that = (PreDeleteDatabasePlan) o;
-    return storageGroup.equals(that.storageGroup) && preDeleteType == that.preDeleteType;
+    return database.equals(that.database) && preDeleteType == that.preDeleteType;
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(super.hashCode(), storageGroup, preDeleteType);
+    return Objects.hash(super.hashCode(), database, preDeleteType);
   }
 
   public enum PreDeleteType {
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
index 65883f3065d..502937713c2 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
@@ -3062,23 +3062,17 @@ public class ConfigManager implements IManager {
   @Override
   public TFetchTableResp fetchTables(final Map<String, Set<String>> fetchTableMap) {
     final TSStatus status = confirmLeader();
-    return status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
-        ? clusterSchemaManager.fetchTables(
-            fetchTableMap.entrySet().stream()
-                .filter(
-                    entry -> {
-                      entry
-                          .getValue()
-                          .removeIf(
-                              table ->
-                                  procedureManager
-                                      .checkDuplicateTableTask(
-                                          entry.getKey(), null, table, null, null, null)
-                                      .getRight());
-                      return true;
-                    })
-                .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)))
-        : new TFetchTableResp(status);
+    if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+      return new TFetchTableResp(status);
+    }
+    fetchTableMap.forEach(
+        (key, value) ->
+            value.removeIf(
+                table ->
+                    procedureManager
+                        .checkDuplicateTableTask(key, null, table, null, null, null)
+                        .getRight()));
+    return clusterSchemaManager.fetchTables(fetchTableMap);
   }
 
   @Override
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/IManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/IManager.java
index 3415c2d2d6e..e15c33e04b7 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/IManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/IManager.java
@@ -401,18 +401,18 @@ public interface IManager {
   TSStatus setTimePartitionInterval(SetTimePartitionIntervalPlan configPhysicalPlan);
 
   /**
-   * Count StorageGroups.
+   * Count Databases.
    *
-   * @return The number of matched StorageGroups
+   * @return The number of matched Databases
    */
   DataSet countMatchedDatabases(CountDatabasePlan countDatabasePlan);
 
   /**
-   * Get StorageGroupSchemas.
+   * Get DatabaseSchemas.
    *
-   * @return StorageGroupSchemaDataSet
+   * @return DatabaseSchemaDataSet
    */
-  DataSet getMatchedDatabaseSchemas(GetDatabasePlan getOrCountStorageGroupPlan);
+  DataSet getMatchedDatabaseSchemas(GetDatabasePlan getOrCountDatabasePlan);
 
   /**
    * Set Database.
@@ -429,7 +429,7 @@ public interface IManager {
   TSStatus alterDatabase(DatabaseSchemaPlan databaseSchemaPlan);
 
   /**
-   * Delete StorageGroups.
+   * Delete Databases.
    *
    * @param tDeleteReq TDeleteDatabaseReq
    * @return status
@@ -660,10 +660,10 @@ public interface IManager {
   TShowConfigNodes4InformationSchemaResp showConfigNodes4InformationSchema();
 
   /**
-   * Show StorageGroup.
+   * Show Database.
    *
    * @param req TShowDatabaseReq
-   * @return TShowStorageGroupResp
+   * @return TShowDatabaseResp
    */
   TShowDatabaseResp showDatabase(TGetDatabaseReq req);
 
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java
index cb470308134..2e4227af3fc 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java
@@ -2112,6 +2112,33 @@ public class ProcedureManager {
     }
   }
 
+  public Map<String, List<String>> getAllExecutingTables() {
+    final Map<String, List<String>> result = new HashMap<>();
+    for (final Procedure<?> procedure : executor.getProcedures().values()) {
+      if (procedure.isFinished()) {
+        continue;
+      }
+      // CreateTableOrViewProcedure is covered by the default process, thus we can ignore it here
+      // Note that if a table is creating there will not be a working table, and the DN will either
+      // be updated by commit or fetch the CN tables
+      // And it won't be committed by other procedures because:
+      // if the preUpdate of other procedure has failed there will not be any commit here
+      // if it succeeded then it will go to the normal process and will not leave any problems
+      if (procedure instanceof AbstractAlterOrDropTableProcedure) {
+        result
+            .computeIfAbsent(
+                ((AbstractAlterOrDropTableProcedure<?>) procedure).getDatabase(),
+                k -> new ArrayList<>())
+            .add(((AbstractAlterOrDropTableProcedure<?>) procedure).getTableName());
+      }
+      if (procedure instanceof DeleteDatabaseProcedure
+          && ((DeleteDatabaseProcedure) procedure).getDeleteDatabaseSchema().isIsTableModel()) {
+        result.put(((DeleteDatabaseProcedure) procedure).getDatabase(), null);
+      }
+    }
+    return result;
+  }
+
   public TSStatus executeWithoutDuplicate(
       final String database,
       final TsTable table,
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
index 54dd582551d..993bfc0e400 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
@@ -103,7 +103,7 @@ public class LoadManager {
    * @param consensusGroupType TConsensusGroupType of RegionGroup to be allocated
    * @return CreateRegionGroupsPlan
    * @throws NotEnoughDataNodeException If there are not enough DataNodes
-   * @throws DatabaseNotExistsException If some specific StorageGroups don't exist
+   * @throws DatabaseNotExistsException If some specific Databases don't exist
    */
   public CreateRegionGroupsPlan allocateRegionGroups(
       final Map<String, Integer> allotmentMap, final TConsensusGroupType consensusGroupType)
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RegionBalancer.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RegionBalancer.java
index 3528cbe1360..10864e9fba9 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RegionBalancer.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/RegionBalancer.java
@@ -74,7 +74,7 @@ public class RegionBalancer {
    * @param consensusGroupType {@link TConsensusGroupType} of the new RegionGroups
    * @return CreateRegionGroupsPlan
    * @throws NotEnoughDataNodeException When the number of DataNodes is not enough for allocation
-   * @throws DatabaseNotExistsException When some StorageGroups don't exist
+   * @throws DatabaseNotExistsException When some Databases don't exist
    */
   public CreateRegionGroupsPlan genRegionGroupsAllocationPlan(
       final Map<String, Integer> allotmentMap, final TConsensusGroupType consensusGroupType)
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaManager.java
index bfe6e830cba..9a04d9e9e59 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaManager.java
@@ -27,6 +27,7 @@ import org.apache.iotdb.commons.exception.MetadataException;
 import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.path.PathPatternTree;
 import org.apache.iotdb.commons.schema.SchemaConstant;
+import org.apache.iotdb.commons.schema.table.NonCommittableTsTable;
 import org.apache.iotdb.commons.schema.table.TableNodeStatus;
 import org.apache.iotdb.commons.schema.table.TreeViewSchema;
 import org.apache.iotdb.commons.schema.table.TsTable;
@@ -1253,8 +1254,31 @@ public class ClusterSchemaManager {
   }
 
   public byte[] getAllTableInfoForDataNodeActivation() {
+    // To guarantee the safety of fetched tables
+    // If DataNode discovered that the table is being altered, it will fetch it from configNode, and
+    // if it's still in execution, it can use the table temporarily
+    // However, if the database is deleting then it must fetch it from configNode, or else the table
+    // is considered to be non exist
+    final Map<String, List<String>> alteringTables =
+        configManager.getProcedureManager().getAllExecutingTables();
+    final Map<String, List<TsTable>> usingTableMap = clusterSchemaInfo.getAllUsingTables();
+    final Map<String, List<TsTable>> preCreateTableMap = clusterSchemaInfo.getAllPreCreateTables();
+    alteringTables.forEach(
+        (k, v) -> {
+          final List<TsTable> preCreateList =
+              preCreateTableMap.computeIfAbsent(k, database -> new ArrayList<>());
+          if (Objects.isNull(v)) {
+            usingTableMap
+                .remove(k)
+                .forEach(
+                    table -> preCreateList.add(new NonCommittableTsTable(table.getTableName())));
+          } else {
+            preCreateList.addAll(
+                v.stream().map(NonCommittableTsTable::new).collect(Collectors.toList()));
+          }
+        });
     return TsTableInternalRPCUtil.serializeTableInitializationInfo(
-        clusterSchemaInfo.getAllUsingTables(), clusterSchemaInfo.getAllPreCreateTables());
+        usingTableMap, preCreateTableMap);
   }
 
   // endregion
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
index 2067783307c..b907527416b 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
@@ -292,7 +292,7 @@ public class PartitionInfo implements SnapshotProcessor {
   public TSStatus preDeleteDatabase(final PreDeleteDatabasePlan preDeleteDatabasePlan) {
     final PreDeleteDatabasePlan.PreDeleteType preDeleteType =
         preDeleteDatabasePlan.getPreDeleteType();
-    final String database = preDeleteDatabasePlan.getStorageGroup();
+    final String database = preDeleteDatabasePlan.getDatabase();
     final DatabasePartitionTable databasePartitionTable = databasePartitionTables.get(database);
     if (databasePartitionTable == null) {
       return new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/DeleteDatabaseProcedure.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/DeleteDatabaseProcedure.java
index 6d14b8be050..3ea3f2d0654 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/DeleteDatabaseProcedure.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/DeleteDatabaseProcedure.java
@@ -37,7 +37,7 @@ import org.apache.iotdb.confignode.persistence.partition.maintainer.RegionDelete
 import org.apache.iotdb.confignode.procedure.env.ConfigNodeProcedureEnv;
 import org.apache.iotdb.confignode.procedure.exception.ProcedureException;
 import org.apache.iotdb.confignode.procedure.impl.StateMachineProcedure;
-import org.apache.iotdb.confignode.procedure.state.schema.DeleteStorageGroupState;
+import org.apache.iotdb.confignode.procedure.state.schema.DeleteDatabaseState;
 import org.apache.iotdb.confignode.procedure.store.ProcedureType;
 import org.apache.iotdb.confignode.rpc.thrift.TDatabaseSchema;
 import org.apache.iotdb.consensus.exception.ConsensusException;
@@ -57,7 +57,7 @@ import java.util.Map;
 import java.util.Objects;
 
 public class DeleteDatabaseProcedure
-    extends StateMachineProcedure<ConfigNodeProcedureEnv, DeleteStorageGroupState> {
+    extends StateMachineProcedure<ConfigNodeProcedureEnv, DeleteDatabaseState> {
   private static final Logger LOG = LoggerFactory.getLogger(DeleteDatabaseProcedure.class);
   private static final int RETRY_THRESHOLD = 5;
 
@@ -82,8 +82,7 @@ public class DeleteDatabaseProcedure
   }
 
   @Override
-  protected Flow executeFromState(
-      final ConfigNodeProcedureEnv env, final DeleteStorageGroupState state)
+  protected Flow executeFromState(final ConfigNodeProcedureEnv env, final DeleteDatabaseState state)
       throws InterruptedException {
     if (deleteDatabaseSchema == null) {
       return Flow.NO_MORE_STATE;
@@ -95,14 +94,14 @@ public class DeleteDatabaseProcedure
               "[DeleteDatabaseProcedure] Pre delete database: {}", deleteDatabaseSchema.getName());
           env.preDeleteDatabase(
               PreDeleteDatabasePlan.PreDeleteType.EXECUTE, deleteDatabaseSchema.getName());
-          setNextState(DeleteStorageGroupState.INVALIDATE_CACHE);
+          setNextState(DeleteDatabaseState.INVALIDATE_CACHE);
           break;
         case INVALIDATE_CACHE:
           LOG.info(
               "[DeleteDatabaseProcedure] Invalidate cache of database: {}",
               deleteDatabaseSchema.getName());
           if (env.invalidateCache(deleteDatabaseSchema.getName())) {
-            setNextState(DeleteStorageGroupState.DELETE_DATABASE_SCHEMA);
+            setNextState(DeleteDatabaseState.DELETE_DATABASE_SCHEMA);
           } else {
             setFailure(new ProcedureException("[DeleteDatabaseProcedure] Invalidate cache failed"));
           }
@@ -240,8 +239,7 @@ public class DeleteDatabaseProcedure
   }
 
   @Override
-  protected void rollbackState(
-      final ConfigNodeProcedureEnv env, final DeleteStorageGroupState state)
+  protected void rollbackState(final ConfigNodeProcedureEnv env, final DeleteDatabaseState state)
       throws IOException, InterruptedException {
     switch (state) {
       case PRE_DELETE_DATABASE:
@@ -257,7 +255,7 @@ public class DeleteDatabaseProcedure
   }
 
   @Override
-  protected boolean isRollbackSupported(final DeleteStorageGroupState state) {
+  protected boolean isRollbackSupported(final DeleteDatabaseState state) {
     switch (state) {
       case PRE_DELETE_DATABASE:
       case INVALIDATE_CACHE:
@@ -268,18 +266,18 @@ public class DeleteDatabaseProcedure
   }
 
   @Override
-  protected DeleteStorageGroupState getState(final int stateId) {
-    return DeleteStorageGroupState.values()[stateId];
+  protected DeleteDatabaseState getState(final int stateId) {
+    return DeleteDatabaseState.values()[stateId];
   }
 
   @Override
-  protected int getStateId(final DeleteStorageGroupState deleteStorageGroupState) {
-    return deleteStorageGroupState.ordinal();
+  protected int getStateId(final DeleteDatabaseState deleteDatabaseState) {
+    return deleteDatabaseState.ordinal();
   }
 
   @Override
-  protected DeleteStorageGroupState getInitialState() {
-    return DeleteStorageGroupState.PRE_DELETE_DATABASE;
+  protected DeleteDatabaseState getInitialState() {
+    return DeleteDatabaseState.PRE_DELETE_DATABASE;
   }
 
   public String getDatabase() {
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/state/schema/DeleteStorageGroupState.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/state/schema/DeleteDatabaseState.java
similarity index 96%
rename from iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/state/schema/DeleteStorageGroupState.java
rename to iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/state/schema/DeleteDatabaseState.java
index bc19a262e64..cde6b2bdd81 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/state/schema/DeleteStorageGroupState.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/state/schema/DeleteDatabaseState.java
@@ -19,7 +19,7 @@
 
 package org.apache.iotdb.confignode.procedure.state.schema;
 
-public enum DeleteStorageGroupState {
+public enum DeleteDatabaseState {
   PRE_DELETE_DATABASE,
   INVALIDATE_CACHE,
   DELETE_DATABASE_SCHEMA
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java
index 3f050b1184f..90d7f20fb25 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java
@@ -655,12 +655,12 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
         executeSchemaBlackListTask(
             req.getSchemaRegionIdList(),
             consensusGroupId -> {
-              final String storageGroup =
+              final String database =
                   schemaEngine
                       .getSchemaRegion(new SchemaRegionId(consensusGroupId.getId()))
                       .getDatabaseFullPath();
               final PathPatternTree filteredPatternTree =
-                  filterPathPatternTree(patternTree, storageGroup);
+                  filterPathPatternTree(patternTree, database);
               if (filteredPatternTree.isEmpty()) {
                 return new TSStatus(TSStatusCode.ONLY_LOGICAL_VIEW.getStatusCode());
               }
@@ -688,11 +688,11 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
     return executeInternalSchemaTask(
         req.getSchemaRegionIdList(),
         consensusGroupId -> {
-          String storageGroup =
+          String database =
               schemaEngine
                   .getSchemaRegion(new SchemaRegionId(consensusGroupId.getId()))
                   .getDatabaseFullPath();
-          PathPatternTree filteredPatternTree = filterPathPatternTree(patternTree, storageGroup);
+          PathPatternTree filteredPatternTree = filterPathPatternTree(patternTree, database);
           if (filteredPatternTree.isEmpty()) {
             return RpcUtils.SUCCESS_STATUS;
           }
@@ -889,12 +889,12 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
       Map<PartialPath, List<Integer>> templateSetInfo, TConsensusGroupId consensusGroupId) {
 
     Map<PartialPath, List<Integer>> result = new HashMap<>();
-    PartialPath storageGroupPath = getStorageGroupPath(consensusGroupId);
-    if (null != storageGroupPath) {
-      PartialPath storageGroupPattern = storageGroupPath.concatNode(MULTI_LEVEL_PATH_WILDCARD);
+    PartialPath databasePath = getDatabasePath(consensusGroupId);
+    if (null != databasePath) {
+      PartialPath databasePattern = databasePath.concatNode(MULTI_LEVEL_PATH_WILDCARD);
       templateSetInfo.forEach(
           (k, v) -> {
-            if (storageGroupPattern.overlapWith(k) || storageGroupPath.overlapWith(k)) {
+            if (databasePattern.overlapWith(k) || databasePath.overlapWith(k)) {
               result.put(k, v);
             }
           });
@@ -902,10 +902,10 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
     return result;
   }
 
-  private PartialPath getStorageGroupPath(TConsensusGroupId consensusGroupId) {
-    PartialPath storageGroupPath = null;
+  private PartialPath getDatabasePath(TConsensusGroupId consensusGroupId) {
+    PartialPath databasePath = null;
     try {
-      storageGroupPath =
+      databasePath =
           new PartialPath(
               schemaEngine
                   .getSchemaRegion(new SchemaRegionId(consensusGroupId.getId()))
@@ -913,7 +913,7 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
     } catch (IllegalPathException ignored) {
       // Won't reach here
     }
-    return storageGroupPath;
+    return databasePath;
   }
 
   @Override
@@ -1099,12 +1099,12 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
         executeInternalSchemaTask(
             req.getSchemaRegionIdList(),
             consensusGroupId -> {
-              final String storageGroup =
+              final String database =
                   schemaEngine
                       .getSchemaRegion(new SchemaRegionId(consensusGroupId.getId()))
                       .getDatabaseFullPath();
               final PathPatternTree filteredPatternTree =
-                  filterPathPatternTree(patternTree, storageGroup);
+                  filterPathPatternTree(patternTree, database);
               if (filteredPatternTree.isEmpty()) {
                 return RpcUtils.SUCCESS_STATUS;
               }
@@ -1132,12 +1132,11 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
     return executeInternalSchemaTask(
         req.getSchemaRegionIdList(),
         consensusGroupId -> {
-          final String storageGroup =
+          final String database =
               schemaEngine
                   .getSchemaRegion(new SchemaRegionId(consensusGroupId.getId()))
                   .getDatabaseFullPath();
-          final PathPatternTree filteredPatternTree =
-              filterPathPatternTree(patternTree, storageGroup);
+          final PathPatternTree filteredPatternTree = filterPathPatternTree(patternTree, database);
           if (filteredPatternTree.isEmpty()) {
             return RpcUtils.SUCCESS_STATUS;
           }
@@ -1157,11 +1156,11 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
     return executeInternalSchemaTask(
         req.getSchemaRegionIdList(),
         consensusGroupId -> {
-          String storageGroup =
+          String database =
               schemaEngine
                   .getSchemaRegion(new SchemaRegionId(consensusGroupId.getId()))
                   .getDatabaseFullPath();
-          PathPatternTree filteredPatternTree = filterPathPatternTree(patternTree, storageGroup);
+          PathPatternTree filteredPatternTree = filterPathPatternTree(patternTree, database);
           if (filteredPatternTree.isEmpty()) {
             return RpcUtils.SUCCESS_STATUS;
           }
@@ -2070,12 +2069,11 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
     return new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
   }
 
-  private PathPatternTree filterPathPatternTree(PathPatternTree patternTree, String storageGroup) {
+  private PathPatternTree filterPathPatternTree(PathPatternTree patternTree, String database) {
     PathPatternTree filteredPatternTree = new PathPatternTree();
     try {
-      PartialPath storageGroupPattern =
-          new PartialPath(storageGroup).concatNode(MULTI_LEVEL_PATH_WILDCARD);
-      for (PartialPath pathPattern : patternTree.getOverlappedPathPatterns(storageGroupPattern)) {
+      PartialPath databasePattern = new PartialPath(database).concatNode(MULTI_LEVEL_PATH_WILDCARD);
+      for (PartialPath pathPattern : patternTree.getOverlappedPathPatterns(databasePattern)) {
         filteredPatternTree.appendPathPattern(pathPattern);
       }
       filteredPatternTree.constructTree();
@@ -2733,8 +2731,8 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
     return new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
   }
 
-  private TSStatus createNewRegion(ConsensusGroupId regionId, String storageGroup) {
-    return regionManager.createNewRegion(regionId, storageGroup);
+  private TSStatus createNewRegion(ConsensusGroupId regionId, String database) {
+    return regionManager.createNewRegion(regionId, database);
   }
 
   @Override
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java
index 30e8426c707..34a289b76c9 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java
@@ -3295,7 +3295,7 @@ public class AnalyzeVisitor extends StatementVisitor<Analysis, MPPQueryContext>
   }
 
   @Override
-  public Analysis visitCountStorageGroup(
+  public Analysis visitCountDatabase(
       CountDatabaseStatement countDatabaseStatement, MPPQueryContext context) {
     Analysis analysis = new Analysis();
     analysis.setRealStatement(countDatabaseStatement);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java
index 1fdf636c33d..40724d4df15 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java
@@ -263,8 +263,7 @@ public class TreeConfigTaskVisitor extends StatementVisitor<IConfigTask, MPPQuer
   }
 
   @Override
-  public IConfigTask visitCountStorageGroup(
-      CountDatabaseStatement statement, MPPQueryContext context) {
+  public IConfigTask visitCountDatabase(CountDatabaseStatement statement, MPPQueryContext context) {
     return new CountDatabaseTask(statement);
   }
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
index c4e8664cf6d..64d606ef72e 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
@@ -943,7 +943,7 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
     return new CountNodesStatement(path, level);
   }
 
-  // Count StorageGroup ========================================================================
+  // Count Database ========================================================================
   @Override
   public Statement visitCountDatabases(CountDatabasesContext ctx) {
     PartialPath path;
@@ -3574,18 +3574,18 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
   @Override
   public Statement visitFlush(final IoTDBSqlParser.FlushContext ctx) {
     final FlushStatement flushStatement = new FlushStatement(StatementType.FLUSH);
-    List<String> storageGroups = null;
+    List<String> databases = null;
     if (ctx.boolean_literal() != null) {
       flushStatement.setSeq(Boolean.parseBoolean(ctx.boolean_literal().getText()));
     }
     flushStatement.setOnCluster(ctx.LOCAL() == null);
     if (ctx.prefixPath(0) != null) {
-      storageGroups = new ArrayList<>();
+      databases = new ArrayList<>();
       for (final IoTDBSqlParser.PrefixPathContext prefixPathContext : ctx.prefixPath()) {
-        storageGroups.add(parsePrefixPath(prefixPathContext).getFullPath());
+        databases.add(parsePrefixPath(prefixPathContext).getFullPath());
       }
     }
-    flushStatement.setDatabases(storageGroups);
+    flushStatement.setDatabases(databases);
     return flushStatement;
   }
 
@@ -3741,14 +3741,14 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
     }
 
     if (ctx.OF() != null) {
-      List<PartialPath> storageGroups = null;
+      List<PartialPath> databases = null;
       if (ctx.prefixPath(0) != null) {
-        storageGroups = new ArrayList<>();
+        databases = new ArrayList<>();
         for (IoTDBSqlParser.PrefixPathContext prefixPathContext : ctx.prefixPath()) {
-          storageGroups.add(parsePrefixPath(prefixPathContext));
+          databases.add(parsePrefixPath(prefixPathContext));
         }
       }
-      showRegionStatement.setDatabases(storageGroups);
+      showRegionStatement.setDatabases(databases);
     } else {
       showRegionStatement.setDatabases(null);
     }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
index 9b0bea05bce..84c8c9c002e 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
@@ -459,11 +459,11 @@ public class TableDeviceSchemaFetcher {
   }
 
   public static IDeviceID convertTagValuesToDeviceID(
-      final String tableName, final String[] idValues) {
+      final String tableName, final String[] tagValues) {
     // Convert to IDeviceID
-    final String[] deviceIdNodes = new String[idValues.length + 1];
+    final String[] deviceIdNodes = new String[tagValues.length + 1];
     deviceIdNodes[0] = tableName;
-    System.arraycopy(idValues, 0, deviceIdNodes, 1, idValues.length);
+    System.arraycopy(tagValues, 0, deviceIdNodes, 1, tagValues.length);
     return IDeviceID.Factory.DEFAULT_FACTORY.create(deviceIdNodes);
   }
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java
index 9f4c2cf9fb6..d24ec3ef0d3 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java
@@ -959,7 +959,7 @@ public class TreeAccessCheckVisitor extends StatementVisitor<TSStatus, TreeAcces
   }
 
   @Override
-  public TSStatus visitCountStorageGroup(
+  public TSStatus visitCountDatabase(
       CountDatabaseStatement countDatabaseStatement, TreeAccessCheckContext context) {
     context
         .setAuditLogOperation(AuditLogOperation.QUERY)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementVisitor.java
index 7ce212c3297..3f8bb158c09 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementVisitor.java
@@ -402,7 +402,7 @@ public abstract class StatementVisitor<R, C> {
     return visitStatement(showDevicesStatement, context);
   }
 
-  public R visitCountStorageGroup(CountDatabaseStatement countDatabaseStatement, C context) {
+  public R visitCountDatabase(CountDatabaseStatement countDatabaseStatement, C context) {
     return visitStatement(countDatabaseStatement, context);
   }
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/CountDatabaseStatement.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/CountDatabaseStatement.java
index 4ff683f4436..2d186ce4173 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/CountDatabaseStatement.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/CountDatabaseStatement.java
@@ -32,7 +32,7 @@ public class CountDatabaseStatement extends CountStatement implements IConfigSta
 
   @Override
   public <R, C> R accept(StatementVisitor<R, C> visitor, C context) {
-    return visitor.visitCountStorageGroup(this, context);
+    return visitor.visitCountDatabase(this, context);
   }
 
   @Override
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java
index 53e8c2617bc..15d51928d64 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java
@@ -141,7 +141,7 @@ public class MTreeBelowSGMemoryImpl {
   private final MemMTreeStore store;
 
   @SuppressWarnings("java:S3077")
-  private volatile IMemMNode storageGroupMNode;
+  private volatile IMemMNode databaseMNode;
 
   private final IMemMNode rootNode;
   private final Function<IMeasurementMNode<IMemMNode>, Map<String, String>> tagGetter;
@@ -153,38 +153,38 @@ public class MTreeBelowSGMemoryImpl {
 
   // region MTree initialization, clear and serialization
   public MTreeBelowSGMemoryImpl(
-      final PartialPath storageGroupPath,
+      final PartialPath databasePath,
       final Function<IMeasurementMNode<IMemMNode>, Map<String, String>> tagGetter,
       final Function<IMeasurementMNode<IMemMNode>, Map<String, String>> attributeGetter,
       final MemSchemaRegionStatistics regionStatistics,
       final SchemaRegionMemMetric metric) {
-    store = new MemMTreeStore(storageGroupPath, regionStatistics, metric);
+    store = new MemMTreeStore(databasePath, regionStatistics, metric);
     this.regionStatistics = regionStatistics;
-    this.storageGroupMNode = store.getRoot();
-    this.rootNode = store.generatePrefix(storageGroupPath);
-    levelOfSG = storageGroupPath.getNodeLength() - 1;
+    this.databaseMNode = store.getRoot();
+    this.rootNode = store.generatePrefix(databasePath);
+    levelOfSG = databasePath.getNodeLength() - 1;
     this.tagGetter = tagGetter;
     this.attributeGetter = attributeGetter;
   }
 
   private MTreeBelowSGMemoryImpl(
-      final PartialPath storageGroupPath,
+      final PartialPath databasePath,
       final MemMTreeStore store,
       final Function<IMeasurementMNode<IMemMNode>, Map<String, String>> tagGetter,
       final Function<IMeasurementMNode<IMemMNode>, Map<String, String>> attributeGetter,
       final MemSchemaRegionStatistics regionStatistics) {
     this.store = store;
     this.regionStatistics = regionStatistics;
-    this.storageGroupMNode = store.getRoot();
-    this.rootNode = store.generatePrefix(storageGroupPath);
-    levelOfSG = storageGroupPath.getNodeLength() - 1;
+    this.databaseMNode = store.getRoot();
+    this.rootNode = store.generatePrefix(databasePath);
+    levelOfSG = databasePath.getNodeLength() - 1;
     this.tagGetter = tagGetter;
     this.attributeGetter = attributeGetter;
   }
 
   public void clear() {
     store.clear();
-    storageGroupMNode = null;
+    databaseMNode = null;
   }
 
   public synchronized boolean createSnapshot(final File snapshotDir) {
@@ -193,7 +193,7 @@ public class MTreeBelowSGMemoryImpl {
 
   public static MTreeBelowSGMemoryImpl loadFromSnapshot(
       final File snapshotDir,
-      final String storageGroupFullPath,
+      final String databaseFullPath,
       final MemSchemaRegionStatistics regionStatistics,
       final SchemaRegionMemMetric metric,
       final Consumer<IMeasurementMNode<IMemMNode>> measurementProcess,
@@ -203,7 +203,7 @@ public class MTreeBelowSGMemoryImpl {
       final Function<IMeasurementMNode<IMemMNode>, Map<String, String>> attributeGetter)
       throws IOException, IllegalPathException {
     return new MTreeBelowSGMemoryImpl(
-        PartialPath.getQualifiedDatabasePartialPath(storageGroupFullPath),
+        PartialPath.getQualifiedDatabasePartialPath(databaseFullPath),
         MemMTreeStore.loadFromSnapshot(
             snapshotDir,
             measurementProcess,
@@ -409,7 +409,7 @@ public class MTreeBelowSGMemoryImpl {
     if (nodeNames.length == levelOfSG + 1) {
       return null;
     }
-    IMemMNode cur = storageGroupMNode;
+    IMemMNode cur = databaseMNode;
     IMemMNode child;
     String childName;
     // e.g, path = root.sg.d1.s1,  create internal nodes and set cur to sg node, parent of d1
@@ -433,13 +433,12 @@ public class MTreeBelowSGMemoryImpl {
       throws PathAlreadyExistException, ExceedQuotaException {
     if (deviceParent == null) {
       // device is sg
-      return storageGroupMNode;
+      return databaseMNode;
     }
     IMemMNode device = store.getChild(deviceParent, deviceName);
     if (device == null) {
       if (IoTDBDescriptor.getInstance().getConfig().isQuotaEnable()) {
-        if (!DataNodeSpaceQuotaManager.getInstance()
-            .checkDeviceLimit(storageGroupMNode.getName())) {
+        if (!DataNodeSpaceQuotaManager.getInstance().checkDeviceLimit(databaseMNode.getName())) {
           throw new ExceedQuotaException(
               "The number of devices has reached the upper limit",
               TSStatusCode.SPACE_QUOTA_EXCEEDED.getStatusCode());
@@ -501,8 +500,7 @@ public class MTreeBelowSGMemoryImpl {
                 devicePath.getFullPath() + "." + measurementList.get(i), aliasList.get(i)));
       }
       if (IoTDBDescriptor.getInstance().getConfig().isQuotaEnable()) {
-        if (!DataNodeSpaceQuotaManager.getInstance()
-            .checkTimeSeriesNum(storageGroupMNode.getName())) {
+        if (!DataNodeSpaceQuotaManager.getInstance().checkTimeSeriesNum(databaseMNode.getName())) {
           failingMeasurementMap.put(
               i,
               new ExceedQuotaException(
@@ -747,7 +745,7 @@ public class MTreeBelowSGMemoryImpl {
       throws MetadataException {
     MetaFormatUtils.checkTimeseries(deviceId);
     final String[] nodeNames = deviceId.getNodes();
-    IMemMNode cur = storageGroupMNode;
+    IMemMNode cur = databaseMNode;
     IMemMNode child;
     for (int i = levelOfSG + 1; i < nodeNames.length; i++) {
       child = cur.getChild(nodeNames[i]);
@@ -894,7 +892,7 @@ public class MTreeBelowSGMemoryImpl {
    */
   public IMemMNode getNodeByPath(final PartialPath path) throws PathNotExistException {
     final String[] nodes = path.getNodes();
-    IMemMNode cur = storageGroupMNode;
+    IMemMNode cur = databaseMNode;
     IMemMNode next;
     for (int i = levelOfSG + 1; i < nodes.length; i++) {
       next = cur.getChild(nodes[i]);
@@ -930,7 +928,7 @@ public class MTreeBelowSGMemoryImpl {
   public void activateTemplate(final PartialPath activatePath, final Template template)
       throws MetadataException {
     final String[] nodes = activatePath.getNodes();
-    IMemMNode cur = storageGroupMNode;
+    IMemMNode cur = databaseMNode;
     for (int i = levelOfSG + 1; i < nodes.length; i++) {
       cur = cur.getChild(nodes[i]);
     }
@@ -1037,7 +1035,7 @@ public class MTreeBelowSGMemoryImpl {
   public void activateTemplateWithoutCheck(
       final PartialPath activatePath, final int templateId, final boolean isAligned) {
     final String[] nodes = activatePath.getNodes();
-    IMemMNode cur = storageGroupMNode;
+    IMemMNode cur = databaseMNode;
     for (int i = levelOfSG + 1; i < nodes.length; i++) {
       cur = cur.getChild(nodes[i]);
     }
@@ -1334,18 +1332,16 @@ public class MTreeBelowSGMemoryImpl {
 
   private IMemMNode getTableDeviceNode(final String table, final Object[] deviceId)
       throws PathNotExistException {
-    IMemMNode cur = storageGroupMNode;
+    IMemMNode cur = databaseMNode;
     IMemMNode next;
 
     next = cur.getChild(table);
     if (next == null) {
       throw new PathNotExistException(
-          storageGroupMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId),
-          true);
+          databaseMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId), true);
     } else if (next.isMeasurement()) {
       throw new PathNotExistException(
-          storageGroupMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId),
-          true);
+          databaseMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId), true);
     }
     cur = next;
 
@@ -1353,14 +1349,13 @@ public class MTreeBelowSGMemoryImpl {
       next = cur.getChild(deviceId[i] == null ? null : String.valueOf(deviceId[i]));
       if (next == null) {
         throw new PathNotExistException(
-            storageGroupMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId),
-            true);
+            databaseMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId), true);
       } else if (next.isMeasurement()) {
         if (i == deviceId.length - 1) {
           return next;
         } else {
           throw new PathNotExistException(
-              storageGroupMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId),
+              databaseMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId),
               true);
         }
       }
@@ -1628,7 +1623,7 @@ public class MTreeBelowSGMemoryImpl {
   // region table device management
 
   public int getTableDeviceNotExistNum(final String tableName, final List<Object[]> deviceIdList) {
-    final IMemMNode tableNode = storageGroupMNode.getChild(tableName);
+    final IMemMNode tableNode = databaseMNode.getChild(tableName);
     int notExistNum = deviceIdList.size();
     if (tableNode == null) {
       return notExistNum;
@@ -1659,11 +1654,10 @@ public class MTreeBelowSGMemoryImpl {
     if (LOGGER.isDebugEnabled()) {
       LOGGER.debug("Start to create table device {}.{}", tableName, Arrays.toString(devicePath));
     }
-    IMemMNode cur = storageGroupMNode.getChild(tableName);
+    IMemMNode cur = databaseMNode.getChild(tableName);
     if (cur == null) {
       cur =
-          store.addChild(
-              storageGroupMNode, tableName, nodeFactory.createInternalMNode(cur, tableName));
+          store.addChild(databaseMNode, tableName, nodeFactory.createInternalMNode(cur, tableName));
     }
 
     for (final String childName : devicePath) {
@@ -1776,14 +1770,14 @@ public class MTreeBelowSGMemoryImpl {
 
   public boolean deleteTableDevice(final String tableName, final IntConsumer attributeDeleter)
       throws MetadataException {
-    if (!store.hasChild(storageGroupMNode, tableName)) {
+    if (!store.hasChild(databaseMNode, tableName)) {
       return false;
     }
     final AtomicInteger memoryReleased = new AtomicInteger(0);
     try (final MNodeCollector<Void, IMemMNode> collector =
         new MNodeCollector<Void, IMemMNode>(
-            storageGroupMNode,
-            new PartialPath(new String[] {storageGroupMNode.getName(), tableName}),
+            databaseMNode,
+            new PartialPath(new String[] {databaseMNode.getName(), tableName}),
             this.store,
             true,
             SchemaConstant.ALL_MATCH_SCOPE) {
@@ -1805,7 +1799,7 @@ public class MTreeBelowSGMemoryImpl {
         }) {
       collector.traverse();
     }
-    storageGroupMNode.deleteChild(tableName);
+    databaseMNode.deleteChild(tableName);
     regionStatistics.resetTableDevice(tableName);
     store.releaseMemory(memoryReleased.get());
     return true;
@@ -1813,14 +1807,14 @@ public class MTreeBelowSGMemoryImpl {
 
   public boolean dropTableAttribute(final String tableName, final IntConsumer attributeDropper)
       throws MetadataException {
-    if (!store.hasChild(storageGroupMNode, tableName)) {
+    if (!store.hasChild(databaseMNode, tableName)) {
       return false;
     }
     final AtomicInteger memoryReleased = new AtomicInteger(0);
     try (final EntityUpdater<IMemMNode> updater =
         new EntityUpdater<IMemMNode>(
-            storageGroupMNode,
-            new PartialPath(new String[] {storageGroupMNode.getName(), tableName}),
+            databaseMNode,
+            new PartialPath(new String[] {databaseMNode.getName(), tableName}),
             this.store,
             true,
             SchemaConstant.ALL_MATCH_SCOPE) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/DataNodeTableCache.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/DataNodeTableCache.java
index fdbca98cc00..2001550ab67 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/DataNodeTableCache.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/DataNodeTableCache.java
@@ -19,6 +19,7 @@
 
 package org.apache.iotdb.db.schemaengine.table;
 
+import org.apache.iotdb.commons.schema.table.NonCommittableTsTable;
 import org.apache.iotdb.commons.schema.table.TsTable;
 import org.apache.iotdb.commons.schema.table.TsTableInternalRPCUtil;
 import org.apache.iotdb.commons.schema.table.column.TsTableColumnSchema;
@@ -177,6 +178,14 @@ public class DataNodeTableCache implements ITableCache {
       if (Objects.nonNull(oldName)) {
         // Equals to commit update
         final TsTable oldTable = preUpdateTableMap.get(database).get(oldName).getLeft();
+        // Cannot be rolled back, consider:
+        // 1. Fetched a written CN table
+        // 2. CN rollback because of timeout
+        // 3. If we roll back here, the flag will be cleared, and it will always be the written
+        // one
+        if (oldTable instanceof NonCommittableTsTable) {
+          return;
+        }
         databaseTableMap
             .computeIfAbsent(database, k -> new ConcurrentHashMap<>())
             .put(tableName, oldTable);
@@ -207,6 +216,14 @@ public class DataNodeTableCache implements ITableCache {
     readWriteLock.writeLock().lock();
     try {
       final TsTable newTable = preUpdateTableMap.get(database).get(tableName).getLeft();
+      // Cannot be committed, consider:
+      // 1. Fetched a non-changed CN table
+      // 2. CN is changed
+      // 3. If we commit here, it will always be the non-changed one
+      // (And it is not committable because it's not real table)
+      if (newTable instanceof NonCommittableTsTable) {
+        return;
+      }
       final TsTable oldTable =
           databaseTableMap
               .computeIfAbsent(database, k -> new ConcurrentHashMap<>())
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/CountDatabaseStatement.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/NonCommittableTsTable.java
similarity index 52%
copy from iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/CountDatabaseStatement.java
copy to iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/NonCommittableTsTable.java
index 4ff683f4436..5f22c86474f 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/CountDatabaseStatement.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/NonCommittableTsTable.java
@@ -17,26 +17,27 @@
  * under the License.
  */
 
-package org.apache.iotdb.db.queryengine.plan.statement.metadata;
+package org.apache.iotdb.commons.schema.table;
 
-import org.apache.iotdb.commons.path.PartialPath;
-import org.apache.iotdb.db.queryengine.plan.analyze.QueryType;
-import org.apache.iotdb.db.queryengine.plan.statement.IConfigStatement;
-import org.apache.iotdb.db.queryengine.plan.statement.StatementVisitor;
+import org.apache.tsfile.utils.ReadWriteIOUtils;
 
-public class CountDatabaseStatement extends CountStatement implements IConfigStatement {
+import java.io.IOException;
+import java.io.OutputStream;
 
-  public CountDatabaseStatement(PartialPath partialPath) {
-    super(partialPath);
-  }
-
-  @Override
-  public <R, C> R accept(StatementVisitor<R, C> visitor, C context) {
-    return visitor.visitCountStorageGroup(this, context);
+/**
+ * This table is just for occupation, and notice the dataNode to fetch the newest version from
+ * configNode. Note that the table cannot be committed or rolled-back, yet it can still be
+ * pre-updated or invalidated, because the two can update the table to the newest and trustable
+ * version.
+ */
+public class NonCommittableTsTable extends TsTable {
+  public NonCommittableTsTable(final String tableName) {
+    super(tableName);
   }
 
   @Override
-  public QueryType getQueryType() {
-    return QueryType.READ;
+  public void serialize(final OutputStream stream) throws IOException {
+    ReadWriteIOUtils.write(tableName, stream);
+    ReadWriteIOUtils.write(-1, stream);
   }
 }
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/TsTable.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/TsTable.java
index 00ced1990ea..3bc5ab64248 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/TsTable.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/TsTable.java
@@ -65,7 +65,7 @@ public class TsTable {
 
   public static final String TTL_PROPERTY = "ttl";
   public static final Set<String> TABLE_ALLOWED_PROPERTIES = Collections.singleton(TTL_PROPERTY);
-  private String tableName;
+  protected String tableName;
 
   private final Map<String, TsTableColumnSchema> columnSchemaMap = new LinkedHashMap<>();
   private final Map<String, Integer> tagColumnIndexMap = new HashMap<>();
@@ -331,10 +331,13 @@ public class TsTable {
     ReadWriteIOUtils.write(props, stream);
   }
 
-  public static TsTable deserialize(InputStream inputStream) throws IOException {
-    String name = ReadWriteIOUtils.readString(inputStream);
-    TsTable table = new TsTable(name);
-    int columnNum = ReadWriteIOUtils.readInt(inputStream);
+  public static TsTable deserialize(final InputStream inputStream) throws IOException {
+    final String name = ReadWriteIOUtils.readString(inputStream);
+    final int columnNum = ReadWriteIOUtils.readInt(inputStream);
+    if (columnNum < 0) {
+      return new NonCommittableTsTable(name);
+    }
+    final TsTable table = new TsTable(name);
     for (int i = 0; i < columnNum; i++) {
       table.addColumnSchema(TsTableColumnSchemaUtil.deserialize(inputStream));
     }
@@ -342,10 +345,13 @@ public class TsTable {
     return table;
   }
 
-  public static TsTable deserialize(ByteBuffer buffer) {
-    String name = ReadWriteIOUtils.readString(buffer);
-    TsTable table = new TsTable(name);
-    int columnNum = ReadWriteIOUtils.readInt(buffer);
+  public static TsTable deserialize(final ByteBuffer buffer) {
+    final String name = ReadWriteIOUtils.readString(buffer);
+    final int columnNum = ReadWriteIOUtils.readInt(buffer);
+    if (columnNum < 0) {
+      return new NonCommittableTsTable(name);
+    }
+    final TsTable table = new TsTable(name);
     for (int i = 0; i < columnNum; i++) {
       table.addColumnSchema(TsTableColumnSchemaUtil.deserialize(buffer));
     }


(iotdb) 12/45: Change the privilege of showVersionStatement #16736

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit f19824d287be7f66ecdb08882e79a91d31278abb
Author: shuwenwei <55...@users.noreply.github.com>
AuthorDate: Wed Nov 12 11:07:58 2025 +0800

    Change the privilege of showVersionStatement #16736
    
    (cherry picked from commit 43b89b9a4802174864bd61699b6bfa5c2c34e723)
---
 .../java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionIT.java | 3 +--
 .../iotdb/db/it/auth/IoTDBSystemPermissionRelationalIT.java       | 3 +--
 .../iotdb/relational/it/query/recent/IoTDBMaintainAuthIT.java     | 8 ++------
 .../queryengine/plan/execution/config/TableConfigTaskVisitor.java | 1 -
 .../plan/relational/security/TreeAccessCheckVisitor.java          | 2 +-
 5 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionIT.java
index e5a8ee7ed83..2ebdd37758f 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionIT.java
@@ -193,6 +193,7 @@ public class IoTDBSystemPermissionIT {
   @Test
   public void maintainOperationsTest() {
     executeQuery("show queries", "test6", "test123123456");
+    executeQuery("show version", "test6", "test123123456");
     assertNonQueryTestFail(
         "kill query '20250918_015728_00003_1'", "714: No such query", "test6", "test123123456");
     assertNonQueriesTestFail(
@@ -205,7 +206,6 @@ public class IoTDBSystemPermissionIT {
           "set configuration 'enable_seq_space_compaction'='true'",
           "start repair data",
           "stop repair data",
-          "show version"
         },
         "803: No permissions for this operation, please add privilege SYSTEM",
         "test6",
@@ -220,7 +220,6 @@ public class IoTDBSystemPermissionIT {
     executeNonQuery("start repair data", "test6", "test123123456");
     executeNonQuery("stop repair data", "test6", "test123123456");
     executeQuery("show queries", "test6", "test123123456");
-    executeNonQuery("show version", "test6", "test123123456");
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionRelationalIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionRelationalIT.java
index 98326a61ca9..aab39581ee5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionRelationalIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionRelationalIT.java
@@ -65,6 +65,7 @@ public class IoTDBSystemPermissionRelationalIT {
   @Test
   public void maintainOperationsTest() {
     executeTableQuery("show queries", "test6", "test123123456");
+    executeTableNonQuery("show version", "test6", "test123123456");
     assertTableNonQueryTestFail(
         "kill query '20250918_015728_00003_1'", "714: No such query", "test6", "test123123456");
     assertTableNonQueriesTestFail(
@@ -77,7 +78,6 @@ public class IoTDBSystemPermissionRelationalIT {
           "set configuration enable_seq_space_compaction='true'",
           "start repair data",
           "stop repair data",
-          "show version"
         },
         "803: Access Denied: No permissions for this operation, please add privilege SYSTEM",
         "test6",
@@ -92,7 +92,6 @@ public class IoTDBSystemPermissionRelationalIT {
     executeTableNonQuery("start repair data", "test6", "test123123456");
     executeTableNonQuery("stop repair data", "test6", "test123123456");
     executeTableQuery("show queries", "test6", "test123123456");
-    executeTableNonQuery("show version", "test6", "test123123456");
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBMaintainAuthIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBMaintainAuthIT.java
index e3acb184883..56425b4d7ff 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBMaintainAuthIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBMaintainAuthIT.java
@@ -112,12 +112,8 @@ public class IoTDBMaintainAuthIT {
     tableQueryNoVerifyResultTest("SHOW CURRENT_USER", expectedHeader, USER_2, PASSWORD);
 
     // case 5: show version
-    tableAssertTestFail(
-        "SHOW VERSION",
-        TSStatusCode.NO_PERMISSION.getStatusCode()
-            + ": Access Denied: No permissions for this operation, please add privilege SYSTEM",
-        USER_2,
-        PASSWORD);
+    expectedHeader = new String[] {"Version", "BuildInfo"};
+    tableQueryNoVerifyResultTest("SHOW VERSION", expectedHeader, USER_2, PASSWORD);
 
     // case 6: show current_timestamp
     expectedHeader = new String[] {"CurrentTimestamp"};
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
index 0475a27c26d..32b964ec584 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
@@ -1358,7 +1358,6 @@ public class TableConfigTaskVisitor extends AstVisitor<IConfigTask, MPPQueryCont
   @Override
   protected IConfigTask visitShowVersion(ShowVersion node, MPPQueryContext context) {
     context.setQueryType(QueryType.READ);
-    accessControl.checkUserGlobalSysPrivilege(context);
     return new ShowVersionTask();
   }
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java
index d24ec3ef0d3..aa8c4d0ed80 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java
@@ -1730,7 +1730,7 @@ public class TreeAccessCheckVisitor extends StatementVisitor<TSStatus, TreeAcces
 
   @Override
   public TSStatus visitShowVersion(ShowVersionStatement statement, TreeAccessCheckContext context) {
-    return checkGlobalAuth(context, PrivilegeType.MAINTAIN, () -> "");
+    return SUCCEED;
   }
 
   @Override


(iotdb) 28/45: fix (#16773)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 2078b4f706dc9672537b6993f83b46df5de3329d
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Tue Nov 18 16:02:04 2025 +0800

    fix (#16773)
    
    (cherry picked from commit bd97844bb7f54c9ecd8f4831a8fd3efc8400d996)
---
 .../java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java    | 10 +++++++---
 .../plan/analyze/cache/partition/PartitionCache.java           |  2 +-
 .../metadata/fetcher/cache/TableDeviceSchemaCache.java         |  2 +-
 .../metadata/fetcher/cache/TableDeviceSchemaCacheMetrics.java  |  9 +++++----
 .../db/schemaengine/rescon/MemSchemaEngineStatistics.java      |  3 ++-
 5 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java
index 551d8a9031d..373cec94a66 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/DataNodeMemoryConfig.java
@@ -32,6 +32,10 @@ import org.slf4j.LoggerFactory;
 public class DataNodeMemoryConfig {
   private static final Logger LOGGER = LoggerFactory.getLogger(DataNodeMemoryConfig.class);
 
+  public static final String SCHEMA_CACHE = "SchemaCache";
+  public static final String SCHEMA_REGION = "SchemaRegion";
+  public static final String PARTITION_CACHE = "PartitionCache";
+
   /** Reject proportion for system */
   private double rejectProportion = 0.8;
 
@@ -265,13 +269,13 @@ public class DataNodeMemoryConfig {
 
     schemaRegionMemoryManager =
         schemaEngineMemoryManager.getOrCreateMemoryManager(
-            "SchemaRegion", schemaMemoryTotal * schemaMemoryProportion[0] / proportionSum);
+            SCHEMA_REGION, schemaMemoryTotal * schemaMemoryProportion[0] / proportionSum);
     schemaCacheMemoryManager =
         schemaEngineMemoryManager.getOrCreateMemoryManager(
-            "SchemaCache", schemaMemoryTotal * schemaMemoryProportion[1] / proportionSum);
+            SCHEMA_CACHE, schemaMemoryTotal * schemaMemoryProportion[1] / proportionSum);
     partitionCacheMemoryManager =
         schemaEngineMemoryManager.getOrCreateMemoryManager(
-            "PartitionCache", schemaMemoryTotal * schemaMemoryProportion[2] / proportionSum);
+            PARTITION_CACHE, schemaMemoryTotal * schemaMemoryProportion[2] / proportionSum);
 
     LOGGER.info(
         "allocateMemoryForSchemaRegion = {}",
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java
index df379b47896..3c76bd08c1d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/cache/partition/PartitionCache.java
@@ -128,7 +128,7 @@ public class PartitionCache {
     this.memoryBlock =
         memoryConfig
             .getPartitionCacheMemoryManager()
-            .exactAllocate("PartitionCache", MemoryBlockType.STATIC);
+            .exactAllocate(DataNodeMemoryConfig.PARTITION_CACHE, MemoryBlockType.STATIC);
     this.memoryBlock.allocate(this.memoryBlock.getTotalMemorySizeInBytes());
     // TODO @spricoder: PartitionCache need to be controlled according to memory
     this.schemaPartitionCache =
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java
index 90fc4fb0e94..acb9c5e6180 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCache.java
@@ -112,7 +112,7 @@ public class TableDeviceSchemaCache {
     memoryBlock =
         memoryConfig
             .getSchemaCacheMemoryManager()
-            .exactAllocate("TableDeviceSchemaCache", MemoryBlockType.STATIC);
+            .exactAllocate(DataNodeMemoryConfig.SCHEMA_CACHE, MemoryBlockType.STATIC);
     dualKeyCache =
         new DualKeyCacheBuilder<TableId, IDeviceID, TableDeviceCacheEntry>()
             .cacheEvictionPolicy(
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCacheMetrics.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCacheMetrics.java
index e65c418c0c1..5063150759f 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCacheMetrics.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/cache/TableDeviceSchemaCacheMetrics.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache;
 
 import org.apache.iotdb.commons.service.metric.enums.Metric;
 import org.apache.iotdb.commons.service.metric.enums.Tag;
+import org.apache.iotdb.db.conf.DataNodeMemoryConfig;
 import org.apache.iotdb.metrics.AbstractMetricService;
 import org.apache.iotdb.metrics.metricsets.IMetricSet;
 import org.apache.iotdb.metrics.utils.MetricLevel;
@@ -47,7 +48,7 @@ public class TableDeviceSchemaCacheMetrics implements IMetricSet {
         tableDeviceSchemaCache,
         TableDeviceSchemaCache::getHitCount,
         Tag.NAME.toString(),
-        "SchemaCache",
+        DataNodeMemoryConfig.SCHEMA_CACHE,
         Tag.TYPE.toString(),
         "hit");
     metricService.createAutoGauge(
@@ -56,7 +57,7 @@ public class TableDeviceSchemaCacheMetrics implements IMetricSet {
         tableDeviceSchemaCache,
         TableDeviceSchemaCache::getRequestCount,
         Tag.NAME.toString(),
-        "SchemaCache",
+        DataNodeMemoryConfig.SCHEMA_CACHE,
         Tag.TYPE.toString(),
         "all");
     metricService.createAutoGauge(
@@ -86,14 +87,14 @@ public class TableDeviceSchemaCacheMetrics implements IMetricSet {
         MetricType.AUTO_GAUGE,
         Metric.CACHE.toString(),
         Tag.NAME.toString(),
-        "SchemaCache",
+        DataNodeMemoryConfig.SCHEMA_CACHE,
         Tag.TYPE.toString(),
         "hit");
     metricService.remove(
         MetricType.AUTO_GAUGE,
         Metric.CACHE.toString(),
         Tag.NAME.toString(),
-        "SchemaCache",
+        DataNodeMemoryConfig.SCHEMA_CACHE,
         Tag.TYPE.toString(),
         "all");
     metricService.remove(
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java
index c50dd62ecea..61de4a1a813 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/rescon/MemSchemaEngineStatistics.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.db.schemaengine.rescon;
 
 import org.apache.iotdb.commons.memory.IMemoryBlock;
 import org.apache.iotdb.commons.memory.MemoryBlockType;
+import org.apache.iotdb.db.conf.DataNodeMemoryConfig;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.schemaengine.SchemaEngine;
 import org.apache.iotdb.db.schemaengine.template.ClusterTemplateManager;
@@ -41,7 +42,7 @@ public class MemSchemaEngineStatistics implements ISchemaEngineStatistics {
       IoTDBDescriptor.getInstance()
           .getMemoryConfig()
           .getSchemaRegionMemoryManager()
-          .exactAllocate("SchemaRegion", MemoryBlockType.DYNAMIC);
+          .exactAllocate(DataNodeMemoryConfig.SCHEMA_REGION, MemoryBlockType.DYNAMIC);
   private final ClusterTemplateManager clusterTemplateManager =
       ClusterTemplateManager.getInstance();
 


(iotdb) 07/45: Make ErrMsg more readable when the predicate has too many conjunctions because of too many devices #16715

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit a3807d284262fc1b0102f5a08dbd2b2fac2470c4
Author: Weihao Li <60...@users.noreply.github.com>
AuthorDate: Tue Nov 11 10:45:02 2025 +0800

    Make ErrMsg more readable when the predicate has too many conjunctions because of too many devices #16715
    
    (cherry picked from commit 93b2d1fe99917ec02dcca3e8d4ad53ef7bc573f8)
---
 .../db/queryengine/plan/analyze/PredicateUtils.java      | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/PredicateUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/PredicateUtils.java
index 381e8cfb5a0..9b45d2c51fa 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/PredicateUtils.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/PredicateUtils.java
@@ -338,6 +338,12 @@ public class PredicateUtils {
     if (conjuncts.size() == 1) {
       return conjuncts.get(0);
     }
+
+    if (conjuncts.size() > 1000) {
+      throw new SemanticException(
+          "There are too many conjuncts (more than 1000) in predicate after rewriting, this may be caused by too many devices in query, try to use ALIGN BY DEVICE");
+    }
+
     return constructRightDeepTreeWithAnd(conjuncts);
   }
 
@@ -346,14 +352,8 @@ public class PredicateUtils {
     if (conjuncts.size() == 2) {
       return new LogicAndExpression(conjuncts.get(0), conjuncts.get(1));
     } else {
-      try {
-        return new LogicAndExpression(
-            conjuncts.get(0),
-            constructRightDeepTreeWithAnd(conjuncts.subList(1, conjuncts.size())));
-      } catch (StackOverflowError e) {
-        throw new SemanticException(
-            "There are too many conjuncts in predicate after rewriting, this may be caused by too many devices, try to use ALIGN BY DEVICE");
-      }
+      return new LogicAndExpression(
+          conjuncts.get(0), constructRightDeepTreeWithAnd(conjuncts.subList(1, conjuncts.size())));
     }
   }
 


(iotdb) 20/45: Active Load: Fixes errors caused by Load copying resource files. (#16753)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 43c0320204d2f26c15d20ec767e200b4bc44eca3
Author: Zhenyu Luo <zh...@apache.org>
AuthorDate: Fri Nov 14 14:33:52 2025 +0800

    Active Load: Fixes errors caused by Load copying resource files. (#16753)
    
    (cherry picked from commit db7c801d8465a8d0dc9fa5e844d14102045b59a6)
---
 .../org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java
index 5bfa9b71105..669013ec450 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java
@@ -91,11 +91,11 @@ public class ActiveLoadUtil {
       targetDir = targetFilePath;
     }
 
-    loadTsFileAsyncToTargetDir(targetDir, file, isDeleteAfterLoad);
     loadTsFileAsyncToTargetDir(
         targetDir, new File(file.getAbsolutePath() + ".resource"), isDeleteAfterLoad);
     loadTsFileAsyncToTargetDir(
         targetDir, new File(file.getAbsolutePath() + ".mods"), isDeleteAfterLoad);
+    loadTsFileAsyncToTargetDir(targetDir, file, isDeleteAfterLoad);
     return true;
   }
 


(iotdb) 30/45: [AINode] Fix bug of sundial and forecast udf (#16768)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 81b6d5922516e8c834d04b8efa79cd4fad2d585d
Author: Leo <16...@users.noreply.github.com>
AuthorDate: Wed Nov 19 09:23:19 2025 +0800

    [AINode] Fix bug of sundial and forecast udf (#16768)
    
    (cherry picked from commit 2b47be756ad8703ce3673973260983f10c4f94e3)
---
 .../iotdb/ainode/core/model/sundial/modeling_sundial.py     | 13 +++++++++----
 .../iotdb/ainode/core/model/timerxl/modeling_timer.py       |  6 +++++-
 .../apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java  |  1 -
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/iotdb-core/ainode/iotdb/ainode/core/model/sundial/modeling_sundial.py b/iotdb-core/ainode/iotdb/ainode/core/model/sundial/modeling_sundial.py
index 544193e4d9c..3ebf516f705 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/model/sundial/modeling_sundial.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/model/sundial/modeling_sundial.py
@@ -616,7 +616,11 @@ class SundialForPrediction(SundialPreTrainedModel, TSGenerationMixin):
             if attention_mask is not None and attention_mask.shape[1] > (
                 input_ids.shape[1] // self.config.input_token_len
             ):
-                input_ids = input_ids[:, -(attention_mask.shape[1] - past_length) :]
+                input_ids = input_ids[
+                    :,
+                    -(attention_mask.shape[1] - past_length)
+                    * self.config.input_token_len :,
+                ]
             # 2 - If the past_length is smaller than input_ids', then input_ids holds all input tokens. We can discard
             # input_ids based on the past_length.
             elif past_length < (input_ids.shape[1] // self.config.input_token_len):
@@ -629,9 +633,10 @@ class SundialForPrediction(SundialPreTrainedModel, TSGenerationMixin):
             position_ids = attention_mask.long().cumsum(-1) - 1
             position_ids.masked_fill_(attention_mask == 0, 1)
             if past_key_values:
-                position_ids = position_ids[
-                    :, -(input_ids.shape[1] // self.config.input_token_len) :
-                ]
+                token_num = (
+                    input_ids.shape[1] + self.config.input_token_len - 1
+                ) // self.config.input_token_len
+                position_ids = position_ids[:, -token_num:]
 
         # if `inputs_embeds` are passed, we only want to use them in the 1st generation step
         if inputs_embeds is not None and past_key_values is None:
diff --git a/iotdb-core/ainode/iotdb/ainode/core/model/timerxl/modeling_timer.py b/iotdb-core/ainode/iotdb/ainode/core/model/timerxl/modeling_timer.py
index 37bf56dfc59..0a33c682742 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/model/timerxl/modeling_timer.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/model/timerxl/modeling_timer.py
@@ -606,7 +606,11 @@ class TimerForPrediction(TimerPreTrainedModel, TSGenerationMixin):
             if attention_mask is not None and attention_mask.shape[1] > (
                 input_ids.shape[1] // self.config.input_token_len
             ):
-                input_ids = input_ids[:, -(attention_mask.shape[1] - past_length) :]
+                input_ids = input_ids[
+                    :,
+                    -(attention_mask.shape[1] - past_length)
+                    * self.config.input_token_len :,
+                ]
             # 2 - If the past_length is smaller than input_ids', then input_ids holds all input tokens. We can discard
             # input_ids based on the past_length.
             elif past_length < (input_ids.shape[1] // self.config.input_token_len):
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java
index e77e0641ae9..260410954d4 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java
@@ -114,7 +114,6 @@ public class UDTFForecast implements UDTF {
     }
     ModelInferenceDescriptor descriptor = modelFetcher.fetchModel(this.model_id);
     this.targetAINode = descriptor.getTargetAINode();
-    this.maxInputLength = descriptor.getModelInformation().getInputShape()[0];
 
     this.outputInterval = parameters.getLongOrDefault(OUTPUT_INTERVAL, DEFAULT_OUTPUT_INTERVAL);
     this.outputLength =


(iotdb) 33/45: Load: Fixed the issue of TSFile parent directory being null and TSFile resource being updated during the Load process. (#16751)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 769f10374dd690d76832028bd779bf6f0b8a91e4
Author: Zhenyu Luo <zh...@apache.org>
AuthorDate: Thu Nov 20 18:57:17 2025 +0800

    Load: Fixed the issue of TSFile parent directory being null and TSFile resource being updated during the Load process. (#16751)
    
    * Load: Fixed the issue of TSFile parent directory being null and TSFile resource being updated during the Load process.
    
    * add IT
    
    * fix
    
    * FIX
    
    * update
    
    * update
    
    (cherry picked from commit 0f2483fbe2ee16c4f34371417ad49b2dff71ce8d)
---
 .../org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java  | 43 ++++++++++++++++++++++
 .../scheduler/load/LoadTsFileDispatcherImpl.java   | 12 ++++--
 .../plan/statement/crud/LoadTsFileStatement.java   |  2 +-
 .../db/storageengine/dataregion/DataRegion.java    |  6 ++-
 .../dataregion/tsfile/TsFileResource.java          | 43 +++++++++++++++++++++-
 .../db/storageengine/load/disk/MinIOSelector.java  | 10 +++--
 6 files changed, 105 insertions(+), 11 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
index 36a94174751..c54adb34711 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java
@@ -23,6 +23,7 @@ import org.apache.iotdb.commons.auth.entity.PrivilegeType;
 import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
 import org.apache.iotdb.db.it.utils.TestUtils;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.cluster.node.DataNodeWrapper;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.it.utils.TsFileGenerator;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -67,6 +68,7 @@ import static org.apache.iotdb.db.it.utils.TestUtils.createUser;
 import static org.apache.iotdb.db.it.utils.TestUtils.executeNonQuery;
 import static org.apache.iotdb.db.it.utils.TestUtils.grantUserSeriesPrivilege;
 import static org.apache.iotdb.db.it.utils.TestUtils.grantUserSystemPrivileges;
+import static org.apache.iotdb.it.env.cluster.ClusterConstant.USER_DIR;
 
 @RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
@@ -742,6 +744,47 @@ public class IoTDBLoadTsFileIT {
     }
   }
 
+  @Test
+  public void testLoadWithRelativePathName() throws Exception {
+    DataNodeWrapper dataNodeWrapper = EnvFactory.getEnv().getDataNodeWrapper(0);
+
+    registerSchema();
+
+    final long writtenPoint1;
+    // device 0, device 1, sg 0
+    File relativePathFile = new File(System.getProperty(USER_DIR), "1-0-0-0.tsfile");
+    try {
+      try (final TsFileGenerator generator = new TsFileGenerator(relativePathFile)) {
+        generator.registerTimeseries(
+            SchemaConfig.DEVICE_0, Collections.singletonList(SchemaConfig.MEASUREMENT_00));
+        generator.generateData(SchemaConfig.DEVICE_0, 1, PARTITION_INTERVAL / 10_000, false);
+        writtenPoint1 = generator.getTotalNumber();
+      }
+
+      try (final Connection connection =
+              EnvFactory.getEnv().getConnectionWithSpecifiedDataNode(dataNodeWrapper);
+          final Statement statement = connection.createStatement()) {
+
+        statement.execute(String.format("load \"%s\" sglevel=2", "1-0-0-0.tsfile"));
+
+        try (final ResultSet resultSet =
+            statement.executeQuery("select count(*) from root.sg.** group by level=1,2")) {
+          if (resultSet.next()) {
+            final long sg1Count = resultSet.getLong("count(root.sg.test_0.*.*)");
+            Assert.assertEquals(writtenPoint1, sg1Count);
+          } else {
+            Assert.fail("This ResultSet is empty.");
+          }
+        }
+      }
+
+    } finally {
+      if (relativePathFile.exists()) {
+        relativePathFile.delete();
+      }
+    }
+  }
+
   @Test
   public void testLoadWithMods() throws Exception {
     final long writtenPoint1;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/load/LoadTsFileDispatcherImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/load/LoadTsFileDispatcherImpl.java
index cfe6bb1a1a6..7301ce0f406 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/load/LoadTsFileDispatcherImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/load/LoadTsFileDispatcherImpl.java
@@ -170,15 +170,22 @@ public class LoadTsFileDispatcherImpl implements IFragInstanceDispatcher {
       }
     } else if (planNode instanceof LoadSingleTsFileNode) { // do not need to split
       final TsFileResource tsFileResource = ((LoadSingleTsFileNode) planNode).getTsFileResource();
+      final String filePath = tsFileResource.getTsFile().getAbsolutePath();
       try {
         PipeDataNodeAgent.runtime().assignProgressIndexForTsFileLoad(tsFileResource);
         tsFileResource.setGeneratedByPipe(isGeneratedByPipe);
         tsFileResource.serialize();
+        TsFileResource cloneTsFileResource = null;
+        try {
+          cloneTsFileResource = tsFileResource.shallowCloneForNative();
+        } catch (CloneNotSupportedException e) {
+          cloneTsFileResource = tsFileResource.shallowClone();
+        }
 
         StorageEngine.getInstance()
             .getDataRegion((DataRegionId) groupId)
             .loadNewTsFile(
-                tsFileResource,
+                cloneTsFileResource,
                 ((LoadSingleTsFileNode) planNode).isDeleteAfterLoad(),
                 isGeneratedByPipe,
                 false);
@@ -189,8 +196,7 @@ public class LoadTsFileDispatcherImpl implements IFragInstanceDispatcher {
         resultStatus.setMessage(e.getMessage());
         throw new FragmentInstanceDispatchException(resultStatus);
       } catch (IOException e) {
-        LOGGER.warn(
-            "Serialize TsFileResource {} error.", tsFileResource.getTsFile().getAbsolutePath(), e);
+        LOGGER.warn("Serialize TsFileResource {} error.", filePath, e);
         TSStatus resultStatus = new TSStatus();
         resultStatus.setCode(TSStatusCode.LOAD_FILE_ERROR.getStatusCode());
         resultStatus.setMessage(e.getMessage());
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/LoadTsFileStatement.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/LoadTsFileStatement.java
index 2d74925971c..d1dff1bb9cf 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/LoadTsFileStatement.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/LoadTsFileStatement.java
@@ -70,7 +70,7 @@ public class LoadTsFileStatement extends Statement {
   private List<Long> writePointCountList;
 
   public LoadTsFileStatement(String filePath) throws FileNotFoundException {
-    this.file = new File(filePath);
+    this.file = new File(filePath).getAbsoluteFile();
     this.databaseLevel = IoTDBDescriptor.getInstance().getConfig().getDefaultDatabaseLevel();
     this.verifySchema = true;
     this.deleteAfterLoad = false;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
index 2c0c39032c4..43c395abc12 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
@@ -3549,10 +3549,12 @@ public class DataRegion implements IDataRegionForQuery {
       final boolean isGeneratedByPipe,
       final boolean isFromConsensus)
       throws LoadFileException {
-    final File tsfileToBeInserted = newTsFileResource.getTsFile();
+    final File tsfileToBeInserted = newTsFileResource.getTsFile().getAbsoluteFile();
     final long newFilePartitionId = newTsFileResource.getTimePartitionWithCheck();
 
-    if (!TsFileValidator.getInstance().validateTsFile(newTsFileResource)) {
+    if (!TsFileValidator.getInstance().validateTsFile(newTsFileResource)
+        || !tsfileToBeInserted.exists()
+        || tsfileToBeInserted.getParentFile() == null) {
       throw new LoadFileException(
           "tsfile validate failed, " + newTsFileResource.getTsFile().getName());
     }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java
index 35ea1660fde..3169cf85ccb 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java
@@ -96,7 +96,7 @@ import static org.apache.iotdb.commons.conf.IoTDBConstant.FILE_NAME_SEPARATOR;
 import static org.apache.tsfile.common.constant.TsFileConstant.TSFILE_SUFFIX;
 
 @SuppressWarnings("java:S1135") // ignore todos
-public class TsFileResource implements PersistentResource {
+public class TsFileResource implements PersistentResource, Cloneable {
 
   private static final long INSTANCE_SIZE =
       RamUsageEstimator.shallowSizeOfInstance(TsFileResource.class)
@@ -1585,4 +1585,45 @@ public class TsFileResource implements PersistentResource {
   public void setLastValues(Map<IDeviceID, List<Pair<String, TimeValuePair>>> lastValues) {
     this.lastValues = lastValues;
   }
+
+  public TsFileResource shallowClone() {
+    TsFileResource cloned = new TsFileResource();
+    cloned.file = this.file;
+    cloned.timeIndex = this.timeIndex;
+    cloned.maxPlanIndex = this.maxPlanIndex;
+    cloned.minPlanIndex = this.minPlanIndex;
+    cloned.exclusiveModFileFuture = this.exclusiveModFileFuture;
+    cloned.sharedModFilePathFuture = this.sharedModFilePathFuture;
+    cloned.modFileManagement = this.modFileManagement;
+    cloned.exclusiveModFile = this.exclusiveModFile;
+    cloned.sharedModFile = this.sharedModFile;
+    cloned.sharedModFileOffset = this.sharedModFileOffset;
+    cloned.compactionModFile = this.compactionModFile;
+    cloned.isSeq = this.isSeq;
+    cloned.tsFileRepairStatus = this.tsFileRepairStatus;
+    cloned.settleTsFileCallBack = this.settleTsFileCallBack;
+    cloned.deviceTimeIndexRamSize = this.deviceTimeIndexRamSize;
+    cloned.tsFileSize = this.tsFileSize;
+    cloned.processor = this.processor;
+    cloned.originTsFileResource = this.originTsFileResource;
+    cloned.isGeneratedByPipeConsensus = this.isGeneratedByPipeConsensus;
+    cloned.isGeneratedByPipe = this.isGeneratedByPipe;
+    cloned.insertionCompactionCandidateStatus = this.insertionCompactionCandidateStatus;
+    cloned.tierLevel = this.tierLevel;
+    cloned.pathToChunkMetadataListMap = this.pathToChunkMetadataListMap;
+    cloned.pathToReadOnlyMemChunkMap = this.pathToReadOnlyMemChunkMap;
+    cloned.pathToTimeSeriesMetadataMap = this.pathToTimeSeriesMetadataMap;
+    cloned.lastValues = this.lastValues;
+    cloned.maxProgressIndex.set(this.maxProgressIndex.get());
+    cloned.atomicStatus.set(this.atomicStatus.get());
+    cloned.isEmpty.set(this.isEmpty.get());
+    cloned.tsFileID = this.tsFileID;
+    cloned.prev = null;
+    cloned.next = null;
+    return cloned;
+  }
+
+  public TsFileResource shallowCloneForNative() throws CloneNotSupportedException {
+    return (TsFileResource) clone();
+  }
 }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/disk/MinIOSelector.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/disk/MinIOSelector.java
index 9956148b083..7ec8300058a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/disk/MinIOSelector.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/disk/MinIOSelector.java
@@ -81,10 +81,12 @@ public class MinIOSelector extends InheritSystemMultiDisksStrategySelector {
       throws DiskSpaceInsufficientException, LoadFileException {
     String fileDirRoot = null;
     try {
-      fileDirRoot =
-          Optional.ofNullable(FileStoreUtils.getFileStore(sourceDirectory.getCanonicalPath()))
-              .map(Object::toString)
-              .orElse(null);
+      if (sourceDirectory != null) {
+        fileDirRoot =
+            Optional.ofNullable(FileStoreUtils.getFileStore(sourceDirectory.getCanonicalPath()))
+                .map(Object::toString)
+                .orElse(null);
+      }
     } catch (Exception e) {
       logger.warn(
           "Exception occurs when reading target file's mount point {}",


(iotdb) 42/45: Fix slowQueryThreshold & optimize encodeBatch (#16765)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 45823164d0fd4c8b23fda5af050aaca19f83061c
Author: shuwenwei <55...@users.noreply.github.com>
AuthorDate: Tue Nov 25 18:18:16 2025 +0800

    Fix slowQueryThreshold & optimize encodeBatch (#16765)
    
    (cherry picked from commit 03b60d1390cc399f635d4f1dac276306a5f11660)
---
 .../java/org/apache/iotdb/db/conf/IoTDBConfig.java |  2 +-
 .../db/utils/datastructure/AlignedTVList.java      | 16 +++++-
 .../memtable/AlignedTVListIteratorTest.java        | 57 ++++++++++++++++++++++
 3 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index 36a148430cb..70a23bbf1a6 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -812,7 +812,7 @@ public class IoTDBConfig {
   private int thriftDefaultBufferSize = RpcUtils.THRIFT_DEFAULT_BUF_CAPACITY;
 
   /** time cost(ms) threshold for slow query. Unit: millisecond */
-  private long slowQueryThreshold = 30000;
+  private long slowQueryThreshold = 10000;
 
   private int patternMatchingThreshold = 1000000;
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java
index 2a91c6f09ce..36aefd2c976 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java
@@ -278,6 +278,7 @@ public abstract class AlignedTVList extends TVList {
     return getAlignedValueByValueIndex(valueIndex, null, floatPrecision, encodingList);
   }
 
+  @SuppressWarnings("java:S6541")
   private TsPrimitiveType getAlignedValueByValueIndex(
       int valueIndex,
       int[] validIndexesForTimeDuplicatedRows,
@@ -1051,6 +1052,7 @@ public abstract class AlignedTVList extends TVList {
   }
 
   /** Build TsBlock by column. */
+  @SuppressWarnings("java:S6541")
   public TsBlock buildTsBlock(
       int floatPrecision,
       List<TSEncoding> encodingList,
@@ -1371,6 +1373,7 @@ public abstract class AlignedTVList extends TVList {
     }
   }
 
+  @SuppressWarnings("java:S6541")
   public static AlignedTVList deserialize(DataInputStream stream) throws IOException {
     TSDataType dataType = ReadWriteIOUtils.readDataType(stream);
     if (dataType != TSDataType.VECTOR) {
@@ -1693,6 +1696,7 @@ public abstract class AlignedTVList extends TVList {
     }
 
     @Override
+    @SuppressWarnings("java:S6541")
     protected void prepareNext() {
       // find the first row that is neither deleted nor empty (all NULL values)
       findValidRow = false;
@@ -1870,6 +1874,7 @@ public abstract class AlignedTVList extends TVList {
     }
 
     @Override
+    @SuppressWarnings("java:S6541")
     public boolean hasNextBatch() {
       if (!paginationController.hasCurLimit()) {
         return false;
@@ -2150,11 +2155,18 @@ public abstract class AlignedTVList extends TVList {
     }
 
     @Override
+    @SuppressWarnings("java:S6541")
     public void encodeBatch(IChunkWriter chunkWriter, BatchEncodeInfo encodeInfo, long[] times) {
+      int maxRowCountOfCurrentBatch =
+          Math.min(
+              rows - index,
+              Math.min(
+                  (int) encodeInfo.maxNumberOfPointsInChunk - encodeInfo.pointNumInChunk, // NOSONAR
+                  encodeInfo.maxNumberOfPointsInPage - encodeInfo.pointNumInPage));
       AlignedChunkWriterImpl alignedChunkWriter = (AlignedChunkWriterImpl) chunkWriter;
 
       // duplicated time or deleted time are all invalid, true if we don't need this row
-      BitMap timeDuplicateInfo = null;
+      LazyBitMap timeDuplicateInfo = null;
 
       int startIndex = index;
       // time column
@@ -2183,7 +2195,7 @@ public abstract class AlignedTVList extends TVList {
           encodeInfo.pointNumInChunk++;
         } else {
           if (Objects.isNull(timeDuplicateInfo)) {
-            timeDuplicateInfo = new BitMap(rows);
+            timeDuplicateInfo = new LazyBitMap(index, maxRowCountOfCurrentBatch, rows - 1);
           }
           timeDuplicateInfo.mark(index);
         }
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedTVListIteratorTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedTVListIteratorTest.java
index 2dbbb5df865..b0c383e3213 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedTVListIteratorTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedTVListIteratorTest.java
@@ -20,6 +20,7 @@
 package org.apache.iotdb.db.storageengine.dataregion.memtable;
 
 import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.exception.query.QueryProcessException;
 import org.apache.iotdb.db.queryengine.common.FragmentInstanceId;
 import org.apache.iotdb.db.queryengine.common.PlanFragmentId;
@@ -27,6 +28,7 @@ import org.apache.iotdb.db.queryengine.execution.fragment.FragmentInstanceContex
 import org.apache.iotdb.db.queryengine.execution.fragment.FragmentInstanceStateMachine;
 import org.apache.iotdb.db.queryengine.plan.statement.component.Ordering;
 import org.apache.iotdb.db.utils.datastructure.AlignedTVList;
+import org.apache.iotdb.db.utils.datastructure.BatchEncodeInfo;
 import org.apache.iotdb.db.utils.datastructure.MemPointIterator;
 import org.apache.iotdb.db.utils.datastructure.TVList;
 
@@ -41,6 +43,7 @@ import org.apache.tsfile.read.filter.basic.Filter;
 import org.apache.tsfile.read.filter.operator.LongFilterOperators;
 import org.apache.tsfile.read.filter.operator.TimeFilterOperators;
 import org.apache.tsfile.read.reader.series.PaginationController;
+import org.apache.tsfile.write.chunk.AlignedChunkWriterImpl;
 import org.apache.tsfile.write.schema.IMeasurementSchema;
 import org.apache.tsfile.write.schema.VectorMeasurementSchema;
 import org.junit.AfterClass;
@@ -952,4 +955,58 @@ public class AlignedTVListIteratorTest {
     }
     Assert.assertEquals(expectedTimestamps, resultTimestamps);
   }
+
+  @Test
+  public void testEncodeBatch() {
+    testEncodeBatch(largeSingleTvListMap, 400000);
+    testEncodeBatch(largeOrderedMultiTvListMap, 400000);
+    testEncodeBatch(largeMergeSortMultiTvListMap, 400000);
+  }
+
+  private void testEncodeBatch(Map<TVList, Integer> tvListMap, long expectedCount) {
+    AlignedChunkWriterImpl alignedChunkWriter = new AlignedChunkWriterImpl(getMeasurementSchema());
+    List<Integer> columnIdxList = Arrays.asList(0, 1, 2);
+    IMeasurementSchema measurementSchema = getMeasurementSchema();
+    AlignedReadOnlyMemChunk chunk =
+        new AlignedReadOnlyMemChunk(
+            fragmentInstanceContext,
+            columnIdxList,
+            measurementSchema,
+            tvListMap,
+            Collections.emptyList(),
+            Arrays.asList(
+                Collections.emptyList(), Collections.emptyList(), Collections.emptyList()));
+    chunk.sortTvLists();
+    chunk.initChunkMetaFromTVListsWithFakeStatistics();
+    MemPointIterator memPointIterator = chunk.createMemPointIterator(Ordering.ASC, null);
+    BatchEncodeInfo encodeInfo =
+        new BatchEncodeInfo(
+            0, 0, 0, 10000, 100000, IoTDBDescriptor.getInstance().getConfig().getTargetChunkSize());
+    long[] times = new long[10000];
+    long count = 0;
+    while (memPointIterator.hasNextBatch()) {
+      memPointIterator.encodeBatch(alignedChunkWriter, encodeInfo, times);
+      if (encodeInfo.pointNumInPage >= encodeInfo.maxNumberOfPointsInPage) {
+        alignedChunkWriter.write(times, encodeInfo.pointNumInPage, 0);
+        encodeInfo.pointNumInPage = 0;
+      }
+
+      if (encodeInfo.pointNumInChunk >= encodeInfo.maxNumberOfPointsInChunk) {
+        alignedChunkWriter.sealCurrentPage();
+        alignedChunkWriter.clearPageWriter();
+        count += alignedChunkWriter.getTimeChunkWriter().getStatistics().getCount();
+        alignedChunkWriter = new AlignedChunkWriterImpl(getMeasurementSchema());
+        encodeInfo.reset();
+      }
+    }
+    // Handle remaining data in the final unsealed chunk
+    if (encodeInfo.pointNumInChunk > 0 || encodeInfo.pointNumInPage > 0) {
+      if (encodeInfo.pointNumInPage > 0) {
+        alignedChunkWriter.write(times, encodeInfo.pointNumInPage, 0);
+      }
+      alignedChunkWriter.sealCurrentPage();
+      count += alignedChunkWriter.getTimeChunkWriter().getStatistics().getCount();
+    }
+    Assert.assertEquals(expectedCount, count);
+  }
 }


(iotdb) 45/45: Bump ratis to apache 3.2.1 (#16801)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 1b2d3ffcff0033e82c0f6f37e69901126f9f8c07
Author: Jiang Tian <jt...@163.com>
AuthorDate: Wed Nov 26 09:35:54 2025 +0800

    Bump ratis to apache 3.2.1 (#16801)
    
    * Bump ratis to apache 3.2.1
    
    * fix
    
    (cherry picked from commit 1c6a2b02ab9473c1e3e38214317b4d398707021b)
---
 dependencies.json               | 14 +++++++-------
 iotdb-core/confignode/pom.xml   |  2 +-
 iotdb-core/consensus/pom.xml    | 14 +++++++-------
 iotdb-core/datanode/pom.xml     |  2 +-
 iotdb-core/node-commons/pom.xml |  2 +-
 pom.xml                         | 14 +++++++-------
 6 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/dependencies.json b/dependencies.json
index 40421228542..6553a8dfe3e 100644
--- a/dependencies.json
+++ b/dependencies.json
@@ -32,13 +32,13 @@
     "com.nimbusds:nimbus-jose-jwt",
     "com.nimbusds:oauth2-oidc-sdk",
     "com.sun.istack:istack-commons-runtime",
-    "com.timecho.ratis:ratis-client",
-    "com.timecho.ratis:ratis-common",
-    "com.timecho.ratis:ratis-grpc",
-    "com.timecho.ratis:ratis-metrics-api",
-    "com.timecho.ratis:ratis-proto",
-    "com.timecho.ratis:ratis-server",
-    "com.timecho.ratis:ratis-server-api",
+    "org.apache.ratis:ratis-client",
+    "org.apache.ratis:ratis-common",
+    "org.apache.ratis:ratis-grpc",
+    "org.apache.ratis:ratis-metrics-api",
+    "org.apache.ratis:ratis-proto",
+    "org.apache.ratis:ratis-server",
+    "org.apache.ratis:ratis-server-api",
     "com.zaxxer:HikariCP",
     "commons-cli:commons-cli",
     "commons-codec:commons-codec",
diff --git a/iotdb-core/confignode/pom.xml b/iotdb-core/confignode/pom.xml
index c2159fc6647..4d255099b10 100644
--- a/iotdb-core/confignode/pom.xml
+++ b/iotdb-core/confignode/pom.xml
@@ -113,7 +113,7 @@
             <artifactId>slf4j-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.timecho.ratis</groupId>
+            <groupId>org.apache.ratis</groupId>
             <artifactId>ratis-common</artifactId>
         </dependency>
         <dependency>
diff --git a/iotdb-core/consensus/pom.xml b/iotdb-core/consensus/pom.xml
index de9a3574eef..c36193c8c07 100644
--- a/iotdb-core/consensus/pom.xml
+++ b/iotdb-core/consensus/pom.xml
@@ -67,31 +67,31 @@
             <version>2.0.6-SNAPSHOT</version>
         </dependency>
         <dependency>
-            <groupId>com.timecho.ratis</groupId>
+            <groupId>org.apache.ratis</groupId>
             <artifactId>ratis-server</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.timecho.ratis</groupId>
+            <groupId>org.apache.ratis</groupId>
             <artifactId>ratis-server-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.timecho.ratis</groupId>
+            <groupId>org.apache.ratis</groupId>
             <artifactId>ratis-common</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.timecho.ratis</groupId>
+            <groupId>org.apache.ratis</groupId>
             <artifactId>ratis-client</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.timecho.ratis</groupId>
+            <groupId>org.apache.ratis</groupId>
             <artifactId>ratis-grpc</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.timecho.ratis</groupId>
+            <groupId>org.apache.ratis</groupId>
             <artifactId>ratis-proto</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.timecho.ratis</groupId>
+            <groupId>org.apache.ratis</groupId>
             <artifactId>ratis-metrics-api</artifactId>
         </dependency>
         <dependency>
diff --git a/iotdb-core/datanode/pom.xml b/iotdb-core/datanode/pom.xml
index 626d8265eed..210a08d6366 100644
--- a/iotdb-core/datanode/pom.xml
+++ b/iotdb-core/datanode/pom.xml
@@ -156,7 +156,7 @@
             <artifactId>netty-common</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.timecho.ratis</groupId>
+            <groupId>org.apache.ratis</groupId>
             <artifactId>ratis-common</artifactId>
         </dependency>
         <dependency>
diff --git a/iotdb-core/node-commons/pom.xml b/iotdb-core/node-commons/pom.xml
index 4a42198f5b5..85ff69ee8ac 100644
--- a/iotdb-core/node-commons/pom.xml
+++ b/iotdb-core/node-commons/pom.xml
@@ -176,7 +176,7 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>com.timecho.ratis</groupId>
+            <groupId>org.apache.ratis</groupId>
             <artifactId>ratis-common</artifactId>
         </dependency>
     </dependencies>
diff --git a/pom.xml b/pom.xml
index 71e0f017c5d..79d231b3c39 100644
--- a/pom.xml
+++ b/pom.xml
@@ -321,37 +321,37 @@
                 <version>${bouncycastle.version}</version>
             </dependency>
             <dependency>
-                <groupId>com.timecho.ratis</groupId>
+                <groupId>org.apache.ratis</groupId>
                 <artifactId>ratis-server</artifactId>
                 <version>${ratis.version}</version>
             </dependency>
             <dependency>
-                <groupId>com.timecho.ratis</groupId>
+                <groupId>org.apache.ratis</groupId>
                 <artifactId>ratis-server-api</artifactId>
                 <version>${ratis.version}</version>
             </dependency>
             <dependency>
-                <groupId>com.timecho.ratis</groupId>
+                <groupId>org.apache.ratis</groupId>
                 <artifactId>ratis-common</artifactId>
                 <version>${ratis.version}</version>
             </dependency>
             <dependency>
-                <groupId>com.timecho.ratis</groupId>
+                <groupId>org.apache.ratis</groupId>
                 <artifactId>ratis-client</artifactId>
                 <version>${ratis.version}</version>
             </dependency>
             <dependency>
-                <groupId>com.timecho.ratis</groupId>
+                <groupId>org.apache.ratis</groupId>
                 <artifactId>ratis-grpc</artifactId>
                 <version>${ratis.version}</version>
             </dependency>
             <dependency>
-                <groupId>com.timecho.ratis</groupId>
+                <groupId>org.apache.ratis</groupId>
                 <artifactId>ratis-proto</artifactId>
                 <version>${ratis.version}</version>
             </dependency>
             <dependency>
-                <groupId>com.timecho.ratis</groupId>
+                <groupId>org.apache.ratis</groupId>
                 <artifactId>ratis-metrics-api</artifactId>
                 <version>${ratis.version}</version>
             </dependency>


(iotdb) 40/45: Avoid connection reset error log printed (#16797)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit e54b8a90ce3ebeae36ccccee4b2dfff2ebf2fa73
Author: Haonan <hh...@outlook.com>
AuthorDate: Tue Nov 25 15:45:26 2025 +0800

    Avoid connection reset error log printed (#16797)
    
    (cherry picked from commit fbcb8a2c6ed44c635d3054adb9c7c3bf8448c418)
---
 .../src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java
index cd5eea30993..31e0f0b6960 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java
@@ -31,6 +31,7 @@ import javax.net.ssl.SSLHandshakeException;
 
 import java.io.EOFException;
 import java.net.SocketAddress;
+import java.net.SocketException;
 import java.net.SocketTimeoutException;
 
 // https://github.com/apache/thrift/blob/master/doc/specs/thrift-rpc.md
@@ -125,6 +126,10 @@ public class TElasticFramedTransport extends TTransport {
       // Read another frame of data
       readFrame();
     } catch (TTransportException e) {
+      // Adding this workaround to avoid the Connection reset error log printed.
+      if (e.getCause() instanceof SocketException && e.getMessage().contains("Connection reset")) {
+        throw new TTransportException(TTransportException.END_OF_FILE, e.getCause());
+      }
       // There is a bug fixed in Thrift 0.15. Some unnecessary error logs may be printed.
       // See https://issues.apache.org/jira/browse/THRIFT-5411 and
       // https://github.com/apache/thrift/commit/be20ad7e08fab200391e3eab41acde9da2a4fd07


(iotdb) 39/45: Optimized the error message when the column is not tag/attribute in device related SQLs (#16750)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit ccf4346314ed05bfdccf5c264947e7e475b28c0e
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Mon Nov 24 10:46:24 2025 +0800

    Optimized the error message when the column is not tag/attribute in device related SQLs (#16750)
    
    * logic
    
    * may-fi
    
    * fix
    
    * fix
    
    * Update IoTDBDeviceIT.java
    
    * fixfix
    
    * fix
    
    * fix
    
    * h
    
    * coding
    
    (cherry picked from commit 36154e5030096afe31e985b17f53984b69d8ff27)
---
 .../iotdb/relational/it/schema/IoTDBDeviceIT.java  | 44 +++++++++++++------
 .../relational/analyzer/StatementAnalyzer.java     | 51 +++++++++++++++++++---
 2 files changed, 77 insertions(+), 18 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDeviceIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDeviceIT.java
index 44ea1e66bf7..1923210b50d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDeviceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDeviceIT.java
@@ -38,6 +38,7 @@ import java.sql.Statement;
 import java.util.Collections;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 @RunWith(IoTDBTestRunner.class)
@@ -163,20 +164,11 @@ public class IoTDBDeviceIT {
         assertEquals("550: Table 'test.table2' does not exist.", e.getMessage());
       }
 
-      try {
-        statement.executeQuery("show devices from table0 where temperature = 37.6");
-        fail("Show devices shall fail for measurement predicate");
-      } catch (final Exception e) {
-        assertEquals(
-            "701: The TIME/FIELD columns are currently not allowed in devices related operations",
-            e.getMessage());
-      }
-
       try {
         statement.executeQuery("count devices from table0 where a = 1");
         fail("Count devices shall fail for non-exist column");
       } catch (final Exception e) {
-        assertEquals("616: Column 'a' cannot be resolved", e.getMessage());
+        assertEquals("701: Column 'a' is not an attribute or tag column", e.getMessage());
       }
 
       // Test fully qualified name
@@ -224,6 +216,34 @@ public class IoTDBDeviceIT {
         assertEquals("701: Update's attribute value must be STRING, TEXT or null.", e.getMessage());
       }
 
+      try {
+        statement.execute("show devices from table0 where humidity = 1");
+        fail("Update shall fail for non-tag/attribute columns");
+      } catch (final Exception e) {
+        assertEquals("701: Column 'humidity' is not an attribute or tag column", e.getMessage());
+      }
+
+      try {
+        statement.execute("count devices from table0 where humidity = 1");
+        fail("Update shall fail for non-tag/attribute columns");
+      } catch (final Exception e) {
+        assertEquals("701: Column 'humidity' is not an attribute or tag column", e.getMessage());
+      }
+
+      try {
+        statement.execute("update table0 set model = '1' where humidity = 1");
+        fail("Update shall fail for non-tag/attribute columns");
+      } catch (final Exception e) {
+        assertEquals("701: Column 'humidity' is not an attribute or tag column", e.getMessage());
+      }
+
+      try {
+        statement.execute("update table0 set model = humidity");
+        fail("Update shall fail for non-tag/attribute columns");
+      } catch (final Exception e) {
+        assertTrue(e.getMessage().contains("Column 'humidity' is not an attribute or tag column"));
+      }
+
       // Test filter with no effect
       statement.execute("update table0 set model = null where model = 'A' and model = 'B'");
 
@@ -270,9 +290,7 @@ public class IoTDBDeviceIT {
         statement.executeQuery("delete devices from table0 where time = 1");
         fail("Delete devices shall fail when specifies non tag column");
       } catch (final Exception e) {
-        assertEquals(
-            "701: The TIME/FIELD columns are currently not allowed in devices related operations",
-            e.getMessage());
+        assertEquals("701: Column 'time' is not an attribute or tag column", e.getMessage());
       }
     }
   }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/StatementAnalyzer.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/StatementAnalyzer.java
index 01b216fe875..96f68194400 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/StatementAnalyzer.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/StatementAnalyzer.java
@@ -19,6 +19,7 @@
 
 package org.apache.iotdb.db.queryengine.plan.relational.analyzer;
 
+import org.apache.iotdb.commons.exception.IoTDBException;
 import org.apache.iotdb.commons.schema.table.TsTable;
 import org.apache.iotdb.commons.schema.table.column.TsTableColumnCategory;
 import org.apache.iotdb.commons.schema.table.column.TsTableColumnSchema;
@@ -551,9 +552,24 @@ public class StatementAnalyzer {
                       }
                       attributeNames.add((SymbolReference) parsedColumn);
 
-                      final Pair<Type, Expression> expressionPair =
-                          analyzeAndRewriteExpression(
-                              translationMap, translationMap.getScope(), assignment.getValue());
+                      final Pair<Type, Expression> expressionPair;
+                      try {
+                        expressionPair =
+                            analyzeAndRewriteExpression(
+                                translationMap, translationMap.getScope(), assignment.getValue());
+                      } catch (final Exception e) {
+                        if (e.getMessage().contains("cannot be resolved")) {
+                          throw new SemanticException(
+                              new IoTDBException(
+                                  e.getCause()
+                                      .getMessage()
+                                      .replace(
+                                          "cannot be resolved",
+                                          "is not an attribute or tag column"),
+                                  TSStatusCode.SEMANTIC_ERROR.getStatusCode()));
+                        }
+                        throw e;
+                      }
                       if (!expressionPair.getLeft().equals(StringType.STRING)
                           && !expressionPair.getLeft().equals(BinaryType.TEXT)
                           && !expressionPair.getLeft().equals(UnknownType.UNKNOWN)) {
@@ -4546,11 +4562,24 @@ public class StatementAnalyzer {
 
         final TableSchema originalSchema = tableSchema.get();
         final ImmutableList.Builder<Field> fields = ImmutableList.builder();
+        // We only leave attribute & tag here because the others are not allowed in device related
+        // SQLs
         fields.addAll(
             analyzeTableOutputFields(
                 node.getTable(),
                 name,
-                new TableSchema(originalSchema.getTableName(), originalSchema.getColumns())));
+                new TableSchema(
+                    originalSchema.getTableName(),
+                    originalSchema.getColumns().stream()
+                        .filter(
+                            columnSchema ->
+                                columnSchema
+                                        .getColumnCategory()
+                                        .equals(TsTableColumnCategory.ATTRIBUTE)
+                                    || columnSchema
+                                        .getColumnCategory()
+                                        .equals(TsTableColumnCategory.TAG))
+                        .collect(Collectors.toList()))));
         final List<Field> fieldList = fields.build();
         final Scope scope = createAndAssignScope(node, context, fieldList);
         translationMap =
@@ -4564,7 +4593,19 @@ public class StatementAnalyzer {
                 new PlannerContext(metadata, null));
 
         if (node.getWhere().isPresent()) {
-          analyzeWhere(node, translationMap.getScope(), node.getWhere().get());
+          try {
+            analyzeWhere(node, translationMap.getScope(), node.getWhere().get());
+          } catch (final Throwable e) {
+            if (e instanceof SemanticException && e.getMessage().contains("cannot be resolved")) {
+              throw new SemanticException(
+                  new IoTDBException(
+                      e.getCause()
+                          .getMessage()
+                          .replace("cannot be resolved", "is not an attribute or tag column"),
+                      TSStatusCode.SEMANTIC_ERROR.getStatusCode()));
+            }
+            throw e;
+          }
           node.setWhere(translationMap.rewrite(analysis.getWhere(node)));
         }
       }


(iotdb) 22/45: feat: encode load attributes in active load directories (#16722)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit b396766f4f26e3bd59bc30d5e3fd79d790c5a3ec
Author: Zhenyu Luo <zh...@apache.org>
AuthorDate: Fri Nov 14 15:14:37 2025 +0800

    feat: encode load attributes in active load directories (#16722)
    
    * feat: encode load attributes in active load directories
    
    * spotless
    
    * fix
    
    * fix
    
    * fix
    
    * fix
    
    * fix
    
    * update it
    
    * update it
    
    * fix
    
    * update
    
    * update
    
    (cherry picked from commit 91e48f07f63a1161b46487a281858eb1b4b63479)
---
 .../iotdb/db/it/IoTDBLoadTsFileWithModIT.java      |  60 ++++-
 .../protocol/thrift/IoTDBDataNodeReceiver.java     |  12 +-
 .../plan/analyze/load/LoadTsFileAnalyzer.java      |  13 +-
 .../plan/statement/crud/LoadTsFileStatement.java   |  16 +-
 .../load/active/ActiveLoadDirScanner.java          |  23 +-
 .../load/active/ActiveLoadPathHelper.java          | 282 +++++++++++++++++++++
 .../load/active/ActiveLoadPendingQueue.java        |  17 +-
 .../load/active/ActiveLoadTsFileLoader.java        |  36 +--
 .../storageengine/load/active/ActiveLoadUtil.java  |  37 +--
 .../load/config/LoadTsFileConfigurator.java        |  18 ++
 10 files changed, 460 insertions(+), 54 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileWithModIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileWithModIT.java
index 9d0a54f1672..5578023e4f5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileWithModIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadTsFileWithModIT.java
@@ -85,7 +85,7 @@ public class IoTDBLoadTsFileWithModIT {
     // write mods file
     resource
         .getExclusiveModFile()
-        .write(new TreeDeletionEntry(new MeasurementPath("root.test.d1.s1"), 1, 2));
+        .write(new TreeDeletionEntry(new MeasurementPath("root.test.d1.de.s1"), 1, 2));
     resource.getExclusiveModFile().close();
   }
 
@@ -93,7 +93,7 @@ public class IoTDBLoadTsFileWithModIT {
       throws IOException, DataRegionException, WriteProcessException, IllegalPathException {
     TsFileResource resource = generateFile();
     ModificationFileV1 oldModFile = ModificationFileV1.getNormalMods(resource);
-    oldModFile.write(new Deletion(new MeasurementPath("root.test.d1.s1"), Long.MAX_VALUE, 1, 2));
+    oldModFile.write(new Deletion(new MeasurementPath("root.test.d1.de.s1"), Long.MAX_VALUE, 1, 2));
     oldModFile.close();
   }
 
@@ -102,11 +102,11 @@ public class IoTDBLoadTsFileWithModIT {
     File tsfile = new File(tmpDir, "1-1-0-0.tsfile");
     try (TsFileWriter writer = new TsFileWriter(tsfile)) {
       writer.registerAlignedTimeseries(
-          "root.test.d1",
+          "root.test.d1.de",
           Collections.singletonList(new MeasurementSchema("s1", TSDataType.BOOLEAN)));
       Tablet tablet =
           new Tablet(
-              "root.test.d1",
+              "root.test.d1.de",
               Collections.singletonList(new MeasurementSchema("s1", TSDataType.BOOLEAN)));
       for (int i = 0; i < 5; i++) {
         tablet.addTimestamp(i, i);
@@ -138,13 +138,61 @@ public class IoTDBLoadTsFileWithModIT {
       statement.execute(String.format("load \'%s\'", tmpDir.getAbsolutePath()));
 
       try (final ResultSet resultSet =
-          statement.executeQuery("select count(s1) as c from root.test.d1")) {
+          statement.executeQuery("select count(s1) as c from root.test.d1.de")) {
         Assert.assertTrue(resultSet.next());
         Assert.assertEquals(3, resultSet.getLong("c"));
       }
     }
   }
 
+  @Test
+  public void testWithNewModFileAndLoadAttributes()
+      throws SQLException,
+          IOException,
+          DataRegionException,
+          WriteProcessException,
+          IllegalPathException {
+    generateFileWithNewModFile();
+    final String databaseName = "root.test.d1";
+
+    try (final Connection connection = EnvFactory.getEnv().getConnection();
+        final Statement statement = connection.createStatement()) {
+
+      statement.execute(
+          String.format(
+              "load \'%s\' with ("
+                  + "'database-name'='%s',"
+                  + "'database-level'='2',"
+                  + "'verify'='true',"
+                  + "'on-success'='none',"
+                  + "'async'='true')",
+              tmpDir.getAbsolutePath(), databaseName));
+
+      boolean databaseFound = false;
+      out:
+      for (int i = 0; i < 10; i++) {
+        try (final ResultSet resultSet = statement.executeQuery("show databases")) {
+          while (resultSet.next()) {
+            final String currentDatabase = resultSet.getString(1);
+            if (databaseName.equalsIgnoreCase(currentDatabase)) {
+              databaseFound = true;
+              break out;
+            }
+          }
+
+          try {
+            Thread.sleep(1000);
+          } catch (InterruptedException e) {
+            break;
+          }
+        }
+      }
+      Assert.assertTrue(
+          "The `database-level` parameter is not working; the generated database does not contain 'root.test.d1'.",
+          databaseFound);
+    }
+  }
+
   @Test
   public void testWithOldModFile()
       throws SQLException,
@@ -159,7 +207,7 @@ public class IoTDBLoadTsFileWithModIT {
       statement.execute(String.format("load \'%s\'", tmpDir.getAbsolutePath()));
 
       try (final ResultSet resultSet =
-          statement.executeQuery("select count(s1) as c from root.test.d1")) {
+          statement.executeQuery("select count(s1) as c from root.test.d1.de")) {
         Assert.assertTrue(resultSet.next());
         Assert.assertEquals(3, resultSet.getLong("c"));
         Assert.assertTrue(
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
index 8a9ceb61c93..652530d11b4 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
@@ -100,6 +100,7 @@ import org.apache.iotdb.db.queryengine.plan.statement.crud.InsertTabletStatement
 import org.apache.iotdb.db.queryengine.plan.statement.crud.LoadTsFileStatement;
 import org.apache.iotdb.db.queryengine.plan.statement.pipe.PipeEnrichedStatement;
 import org.apache.iotdb.db.schemaengine.table.DataNodeTableCache;
+import org.apache.iotdb.db.storageengine.load.active.ActiveLoadPathHelper;
 import org.apache.iotdb.db.storageengine.load.active.ActiveLoadUtil;
 import org.apache.iotdb.db.storageengine.rescon.disk.FolderManager;
 import org.apache.iotdb.db.storageengine.rescon.disk.strategy.DirectoryStrategyType;
@@ -570,7 +571,16 @@ public class IoTDBDataNodeReceiver extends IoTDBFileReceiver {
 
   private TSStatus loadTsFileAsync(final String dataBaseName, final List<String> absolutePaths)
       throws IOException {
-    if (!ActiveLoadUtil.loadFilesToActiveDir(dataBaseName, absolutePaths, true)) {
+    final Map<String, String> loadAttributes =
+        ActiveLoadPathHelper.buildAttributes(
+            dataBaseName,
+            null,
+            shouldConvertDataTypeOnTypeMismatch,
+            validateTsFile.get(),
+            null,
+            shouldMarkAsPipeRequest.get());
+
+    if (!ActiveLoadUtil.loadFilesToActiveDir(loadAttributes, absolutePaths, true)) {
       throw new PipeException("Load active listening pipe dir is not set.");
     }
     return new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java
index 4fe119566d7..076b529ab91 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java
@@ -42,6 +42,7 @@ import org.apache.iotdb.db.queryengine.plan.statement.crud.LoadTsFileStatement;
 import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
 import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResourceStatus;
 import org.apache.iotdb.db.storageengine.dataregion.utils.TsFileResourceUtils;
+import org.apache.iotdb.db.storageengine.load.active.ActiveLoadPathHelper;
 import org.apache.iotdb.db.storageengine.load.active.ActiveLoadUtil;
 import org.apache.iotdb.db.storageengine.load.converter.LoadTsFileDataTypeConverter;
 import org.apache.iotdb.db.storageengine.load.metrics.LoadTsFileCostMetricsSet;
@@ -281,7 +282,17 @@ public class LoadTsFileAnalyzer implements AutoCloseable {
       } else {
         databaseName = null;
       }
-      if (ActiveLoadUtil.loadTsFileAsyncToActiveDir(tsFiles, databaseName, isDeleteAfterLoad)) {
+      final Map<String, String> activeLoadAttributes =
+          ActiveLoadPathHelper.buildAttributes(
+              databaseName,
+              databaseLevel,
+              isConvertOnTypeMismatch,
+              isVerifySchema,
+              tabletConversionThresholdBytes,
+              isGeneratedByPipe);
+
+      if (ActiveLoadUtil.loadTsFileAsyncToActiveDir(
+          tsFiles, activeLoadAttributes, isDeleteAfterLoad)) {
         analysis.setFinishQueryAfterAnalyze(true);
         setRealStatement(analysis);
         return true;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/LoadTsFileStatement.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/LoadTsFileStatement.java
index dbc4cb7b64d..2d74925971c 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/LoadTsFileStatement.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/LoadTsFileStatement.java
@@ -48,6 +48,7 @@ import static org.apache.iotdb.db.storageengine.load.config.LoadTsFileConfigurat
 import static org.apache.iotdb.db.storageengine.load.config.LoadTsFileConfigurator.ON_SUCCESS_DELETE_VALUE;
 import static org.apache.iotdb.db.storageengine.load.config.LoadTsFileConfigurator.ON_SUCCESS_KEY;
 import static org.apache.iotdb.db.storageengine.load.config.LoadTsFileConfigurator.ON_SUCCESS_NONE_VALUE;
+import static org.apache.iotdb.db.storageengine.load.config.LoadTsFileConfigurator.PIPE_GENERATED_KEY;
 import static org.apache.iotdb.db.storageengine.load.config.LoadTsFileConfigurator.TABLET_CONVERSION_THRESHOLD_KEY;
 
 public class LoadTsFileStatement extends Statement {
@@ -63,8 +64,6 @@ public class LoadTsFileStatement extends Statement {
   private boolean isGeneratedByPipe = false;
   private boolean isAsyncLoad = false;
 
-  private Map<String, String> loadAttributes;
-
   private List<File> tsFiles;
   private List<Boolean> isTableModel;
   private List<TsFileResource> resources;
@@ -245,15 +244,14 @@ public class LoadTsFileStatement extends Statement {
   }
 
   public void setLoadAttributes(final Map<String, String> loadAttributes) {
-    this.loadAttributes = loadAttributes;
-    initAttributes();
+    initAttributes(loadAttributes);
   }
 
   public boolean isAsyncLoad() {
     return isAsyncLoad;
   }
 
-  private void initAttributes() {
+  private void initAttributes(final Map<String, String> loadAttributes) {
     this.databaseLevel = LoadTsFileConfigurator.parseOrGetDefaultDatabaseLevel(loadAttributes);
     this.database = LoadTsFileConfigurator.parseDatabaseName(loadAttributes);
     this.deleteAfterLoad = LoadTsFileConfigurator.parseOrGetDefaultOnSuccess(loadAttributes);
@@ -263,6 +261,9 @@ public class LoadTsFileStatement extends Statement {
         LoadTsFileConfigurator.parseOrGetDefaultTabletConversionThresholdBytes(loadAttributes);
     this.verifySchema = LoadTsFileConfigurator.parseOrGetDefaultVerify(loadAttributes);
     this.isAsyncLoad = LoadTsFileConfigurator.parseOrGetDefaultAsyncLoad(loadAttributes);
+    if (LoadTsFileConfigurator.parseOrGetDefaultPipeGenerated(loadAttributes)) {
+      markIsGeneratedByPipe();
+    }
   }
 
   public boolean reconstructStatementIfMiniFileConverted(final List<Boolean> isMiniTsFile) {
@@ -314,7 +315,7 @@ public class LoadTsFileStatement extends Statement {
   @Override
   public org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Statement toRelationalStatement(
       MPPQueryContext context) {
-    loadAttributes = new HashMap<>();
+    final Map<String, String> loadAttributes = new HashMap<>();
 
     loadAttributes.put(DATABASE_LEVEL_KEY, String.valueOf(databaseLevel));
     if (database != null) {
@@ -326,6 +327,9 @@ public class LoadTsFileStatement extends Statement {
     loadAttributes.put(
         TABLET_CONVERSION_THRESHOLD_KEY, String.valueOf(tabletConversionThresholdBytes));
     loadAttributes.put(ASYNC_LOAD_KEY, String.valueOf(isAsyncLoad));
+    if (isGeneratedByPipe) {
+      loadAttributes.put(PIPE_GENERATED_KEY, String.valueOf(true));
+    }
 
     return new LoadTsFile(null, file.getAbsolutePath(), loadAttributes);
   }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java
index 5ac33dfbdd4..470cf702b22 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java
@@ -39,6 +39,7 @@ import java.nio.file.Path;
 import java.nio.file.SimpleFileVisitor;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.util.Arrays;
+import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.CopyOnWriteArraySet;
@@ -117,13 +118,23 @@ public class ActiveLoadDirScanner extends ActiveLoadScheduledExecutorService {
               .filter(this::isTsFileCompleted)
               .limit(currentAllowedPendingSize)
               .forEach(
-                  file -> {
-                    final File parentFile = new File(file).getParentFile();
+                  filePath -> {
+                    final File tsFile = new File(filePath);
+                    final Map<String, String> attributes =
+                        ActiveLoadPathHelper.parseAttributes(tsFile, listeningDirFile);
+
+                    final File parentFile = tsFile.getParentFile();
+                    final boolean isTableModel =
+                        ActiveLoadPathHelper.containsDatabaseName(attributes)
+                            || (parentFile != null
+                                && !Objects.equals(
+                                    parentFile.getAbsoluteFile(),
+                                    listeningDirFile.getAbsoluteFile()));
+
                     activeLoadTsFileLoader.tryTriggerTsFileLoad(
-                        file,
-                        parentFile != null
-                            && !Objects.equals(
-                                parentFile.getAbsoluteFile(), listeningDirFile.getAbsoluteFile()),
+                        tsFile.getAbsolutePath(),
+                        listeningDirFile.getAbsolutePath(),
+                        isTableModel,
                         isGeneratedByPipe);
                   });
         } catch (UncheckedIOException e) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPathHelper.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPathHelper.java
new file mode 100644
index 00000000000..7c83f20f369
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPathHelper.java
@@ -0,0 +1,282 @@
+/*
+ * 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.storageengine.load.active;
+
+import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.sql.SemanticException;
+import org.apache.iotdb.db.queryengine.plan.statement.crud.LoadTsFileStatement;
+import org.apache.iotdb.db.storageengine.load.config.LoadTsFileConfigurator;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+/** Utility methods for encoding and decoding load attributes into directory structures. */
+public final class ActiveLoadPathHelper {
+
+  private static final String SEGMENT_SEPARATOR = "-";
+
+  private static final List<String> KEY_ORDER =
+      Collections.unmodifiableList(
+          Arrays.asList(
+              LoadTsFileConfigurator.DATABASE_NAME_KEY,
+              LoadTsFileConfigurator.DATABASE_LEVEL_KEY,
+              LoadTsFileConfigurator.CONVERT_ON_TYPE_MISMATCH_KEY,
+              LoadTsFileConfigurator.TABLET_CONVERSION_THRESHOLD_KEY,
+              LoadTsFileConfigurator.VERIFY_KEY,
+              LoadTsFileConfigurator.DATABASE_KEY,
+              LoadTsFileConfigurator.PIPE_GENERATED_KEY));
+
+  private ActiveLoadPathHelper() {
+    throw new IllegalStateException("Utility class");
+  }
+
+  public static Map<String, String> buildAttributes(
+      final String databaseName,
+      final Integer databaseLevel,
+      final Boolean convertOnTypeMismatch,
+      final Boolean verify,
+      final Long tabletConversionThresholdBytes,
+      final Boolean pipeGenerated) {
+    final Map<String, String> attributes = new LinkedHashMap<>();
+    if (Objects.nonNull(databaseName) && !databaseName.isEmpty()) {
+      attributes.put(LoadTsFileConfigurator.DATABASE_NAME_KEY, databaseName);
+    }
+
+    if (Objects.nonNull(databaseLevel)) {
+      attributes.put(LoadTsFileConfigurator.DATABASE_LEVEL_KEY, databaseLevel.toString());
+    }
+
+    if (Objects.nonNull(convertOnTypeMismatch)) {
+      attributes.put(
+          LoadTsFileConfigurator.CONVERT_ON_TYPE_MISMATCH_KEY,
+          Boolean.toString(convertOnTypeMismatch));
+    }
+
+    if (Objects.nonNull(tabletConversionThresholdBytes)) {
+      attributes.put(
+          LoadTsFileConfigurator.TABLET_CONVERSION_THRESHOLD_KEY,
+          tabletConversionThresholdBytes.toString());
+    }
+
+    if (Objects.nonNull(verify)) {
+      attributes.put(LoadTsFileConfigurator.VERIFY_KEY, Boolean.toString(verify));
+    }
+
+    if (Objects.nonNull(pipeGenerated) && pipeGenerated) {
+      attributes.put(LoadTsFileConfigurator.PIPE_GENERATED_KEY, Boolean.TRUE.toString());
+    }
+    return attributes;
+  }
+
+  public static File resolveTargetDir(final File baseDir, final Map<String, String> attributes) {
+    File current = baseDir;
+    for (final String key : KEY_ORDER) {
+      final String value = attributes.get(key);
+      if (value == null) {
+        continue;
+      }
+      current = new File(current, formatSegment(key, value));
+    }
+    return current;
+  }
+
+  public static Map<String, String> parseAttributes(final File file, final File pendingDir) {
+    if (file == null) {
+      return Collections.emptyMap();
+    }
+
+    final Map<String, String> attributes = new HashMap<>();
+    File current = file.getParentFile();
+    while (current != null) {
+      final String dirName = current.getName();
+      if (pendingDir != null && current.equals(pendingDir)) {
+        break;
+      }
+      for (final String key : KEY_ORDER) {
+        final String prefix = key + SEGMENT_SEPARATOR;
+        if (dirName.startsWith(prefix)) {
+          extractAndValidateAttributeValue(key, dirName, prefix.length())
+              .ifPresent(value -> attributes.putIfAbsent(key, value));
+          break;
+        }
+      }
+      current = current.getParentFile();
+    }
+    return attributes;
+  }
+
+  public static File findPendingDirectory(final File file) {
+    if (file == null) {
+      return null;
+    }
+    String[] dirs = IoTDBDescriptor.getInstance().getConfig().getLoadActiveListeningDirs();
+    File current = file;
+    while (current != null) {
+      for (final String dir : dirs) {
+        if (current.isDirectory() && current.getAbsolutePath().equals(dir)) {
+          return current;
+        }
+      }
+      current = current.getParentFile();
+    }
+    return null;
+  }
+
+  public static void applyAttributesToStatement(
+      final Map<String, String> attributes,
+      final LoadTsFileStatement statement,
+      final boolean defaultVerify) {
+
+    Optional.ofNullable(attributes.get(LoadTsFileConfigurator.DATABASE_NAME_KEY))
+        .filter(name -> !name.isEmpty())
+        .ifPresent(statement::setDatabase);
+
+    if (statement.getDatabase() == null || statement.getDatabase().isEmpty()) {
+      Optional.ofNullable(attributes.get(LoadTsFileConfigurator.DATABASE_KEY))
+          .filter(name -> !name.isEmpty())
+          .ifPresent(statement::setDatabase);
+    }
+
+    Optional.ofNullable(attributes.get(LoadTsFileConfigurator.DATABASE_LEVEL_KEY))
+        .ifPresent(
+            level -> {
+              try {
+                statement.setDatabaseLevel(Integer.parseInt(level));
+              } catch (final NumberFormatException ignored) {
+                // keep the default when parsing fails
+              }
+            });
+
+    Optional.ofNullable(attributes.get(LoadTsFileConfigurator.CONVERT_ON_TYPE_MISMATCH_KEY))
+        .ifPresent(value -> statement.setConvertOnTypeMismatch(Boolean.parseBoolean(value)));
+
+    Optional.ofNullable(attributes.get(LoadTsFileConfigurator.TABLET_CONVERSION_THRESHOLD_KEY))
+        .ifPresent(
+            threshold -> {
+              try {
+                statement.setTabletConversionThresholdBytes(Long.parseLong(threshold));
+              } catch (final NumberFormatException ignored) {
+                // keep the default when parsing fails
+              }
+            });
+
+    if (attributes.containsKey(LoadTsFileConfigurator.VERIFY_KEY)) {
+      statement.setVerifySchema(
+          Boolean.parseBoolean(attributes.get(LoadTsFileConfigurator.VERIFY_KEY)));
+    } else {
+      statement.setVerifySchema(defaultVerify);
+    }
+
+    if (attributes.containsKey(LoadTsFileConfigurator.PIPE_GENERATED_KEY)
+        && Boolean.parseBoolean(attributes.get(LoadTsFileConfigurator.PIPE_GENERATED_KEY))) {
+      statement.markIsGeneratedByPipe();
+    }
+  }
+
+  public static boolean containsDatabaseName(final Map<String, String> attributes) {
+    return attributes.containsKey(LoadTsFileConfigurator.DATABASE_NAME_KEY)
+        || attributes.containsKey(LoadTsFileConfigurator.DATABASE_KEY);
+  }
+
+  private static String formatSegment(final String key, final String value) {
+    return key + SEGMENT_SEPARATOR + encodeValue(value);
+  }
+
+  private static String encodeValue(final String value) {
+    try {
+      return URLEncoder.encode(value, StandardCharsets.UTF_8.toString());
+    } catch (final UnsupportedEncodingException e) {
+      // UTF-8 should always be supported; fallback to raw value when unexpected
+      return value;
+    }
+  }
+
+  private static Optional<String> extractAndValidateAttributeValue(
+      final String key, final String dirName, final int prefixLength) {
+    if (dirName.length() <= prefixLength) {
+      return Optional.empty();
+    }
+
+    final String encodedValue = dirName.substring(prefixLength);
+    final String decodedValue = decodeValue(encodedValue);
+    try {
+      validateAttributeValue(key, decodedValue);
+      return Optional.of(decodedValue);
+    } catch (final SemanticException e) {
+      return Optional.empty();
+    }
+  }
+
+  private static void validateAttributeValue(final String key, final String value) {
+    switch (key) {
+      case LoadTsFileConfigurator.DATABASE_NAME_KEY:
+        if (value == null || value.isEmpty()) {
+          throw new SemanticException("Database name must not be empty.");
+        }
+        break;
+      case LoadTsFileConfigurator.DATABASE_LEVEL_KEY:
+        LoadTsFileConfigurator.validateDatabaseLevelParam(value);
+        break;
+      case LoadTsFileConfigurator.CONVERT_ON_TYPE_MISMATCH_KEY:
+        LoadTsFileConfigurator.validateConvertOnTypeMismatchParam(value);
+        break;
+      case LoadTsFileConfigurator.TABLET_CONVERSION_THRESHOLD_KEY:
+        validateTabletConversionThreshold(value);
+        break;
+      case LoadTsFileConfigurator.VERIFY_KEY:
+        LoadTsFileConfigurator.validateVerifyParam(value);
+        break;
+      default:
+        LoadTsFileConfigurator.validateParameters(key, value);
+    }
+  }
+
+  private static void validateTabletConversionThreshold(final String value) {
+    try {
+      final long threshold = Long.parseLong(value);
+      if (threshold < 0) {
+        throw new SemanticException(
+            "Tablet conversion threshold must be a non-negative long value.");
+      }
+    } catch (final NumberFormatException e) {
+      throw new SemanticException(
+          String.format("Tablet conversion threshold '%s' is not a valid long value.", value));
+    }
+  }
+
+  private static String decodeValue(final String value) {
+    try {
+      return URLDecoder.decode(value, StandardCharsets.UTF_8.toString());
+    } catch (final UnsupportedEncodingException e) {
+      return value;
+    }
+  }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPendingQueue.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPendingQueue.java
index 3ec283cd2e0..7b5f7166197 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPendingQueue.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPendingQueue.java
@@ -34,9 +34,13 @@ public class ActiveLoadPendingQueue {
   private final Set<String> loadingFileSet = new HashSet<>();
 
   public synchronized boolean enqueue(
-      final String file, final boolean isGeneratedByPipe, final boolean isTableModel) {
+      final String file,
+      final String pendingDir,
+      final boolean isGeneratedByPipe,
+      final boolean isTableModel) {
     if (!loadingFileSet.contains(file) && pendingFileSet.add(file)) {
-      pendingFileQueue.offer(new ActiveLoadEntry(file, isGeneratedByPipe, isTableModel));
+      pendingFileQueue.offer(
+          new ActiveLoadEntry(file, pendingDir, isGeneratedByPipe, isTableModel));
 
       ActiveLoadingFilesNumberMetricsSet.getInstance().increaseQueuingFileCounter(1);
       return true;
@@ -76,11 +80,14 @@ public class ActiveLoadPendingQueue {
 
   public static class ActiveLoadEntry {
     private final String file;
+    private final String pendingDir;
     private final boolean isGeneratedByPipe;
     private final boolean isTableModel;
 
-    public ActiveLoadEntry(String file, boolean isGeneratedByPipe, boolean isTableModel) {
+    public ActiveLoadEntry(
+        String file, String pendingDir, boolean isGeneratedByPipe, boolean isTableModel) {
       this.file = file;
+      this.pendingDir = pendingDir;
       this.isGeneratedByPipe = isGeneratedByPipe;
       this.isTableModel = isTableModel;
     }
@@ -89,6 +96,10 @@ public class ActiveLoadPendingQueue {
       return file;
     }
 
+    public String getPendingDir() {
+      return pendingDir;
+    }
+
     public boolean isGeneratedByPipe() {
       return isGeneratedByPipe;
     }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java
index 62feb562be7..20817c94146 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java
@@ -56,6 +56,7 @@ import java.nio.file.SimpleFileVisitor;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.time.ZoneId;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.LinkedBlockingQueue;
@@ -84,12 +85,12 @@ public class ActiveLoadTsFileLoader {
   }
 
   public void tryTriggerTsFileLoad(
-      String absolutePath, boolean isTabletMode, boolean isGeneratedByPipe) {
+      String absolutePath, String pendingDir, boolean isTabletMode, boolean isGeneratedByPipe) {
     if (CommonDescriptor.getInstance().getConfig().isReadOnly()) {
       return;
     }
 
-    if (pendingQueue.enqueue(absolutePath, isGeneratedByPipe, isTabletMode)) {
+    if (pendingQueue.enqueue(absolutePath, pendingDir, isGeneratedByPipe, isTabletMode)) {
       initFailDirIfNecessary();
       adjustExecutorIfNecessary();
     }
@@ -216,24 +217,29 @@ public class ActiveLoadTsFileLoader {
   private TSStatus loadTsFile(
       final ActiveLoadPendingQueue.ActiveLoadEntry entry, final IClientSession session)
       throws FileNotFoundException {
-    final LoadTsFileStatement statement = new LoadTsFileStatement(entry.getFile());
+    final File tsFile = new File(entry.getFile());
+    final LoadTsFileStatement statement = new LoadTsFileStatement(tsFile.getAbsolutePath());
     final List<File> files = statement.getTsFiles();
 
-    // It should be noted here that the instructions in this code block do not need to use the
-    // DataBase, so the DataBase is assigned a value of null. If the DataBase is used later, an
-    // exception will be thrown.
-    final File parentFile;
-    statement.setDatabase(
-        files.isEmpty()
-                || !entry.isTableModel()
-                || (parentFile = files.get(0).getParentFile()) == null
-            ? null
-            : parentFile.getName());
     statement.setDeleteAfterLoad(true);
-    statement.setConvertOnTypeMismatch(true);
-    statement.setVerifySchema(isVerify);
     statement.setAutoCreateDatabase(
         IoTDBDescriptor.getInstance().getConfig().isAutoCreateSchemaEnabled());
+
+    final File pendingDir =
+        entry.getPendingDir() == null
+            ? ActiveLoadPathHelper.findPendingDirectory(tsFile)
+            : new File(entry.getPendingDir());
+    final Map<String, String> attributes = ActiveLoadPathHelper.parseAttributes(tsFile, pendingDir);
+    ActiveLoadPathHelper.applyAttributesToStatement(attributes, statement, isVerify);
+
+    final File parentFile;
+    if (statement.getDatabase() == null && entry.isTableModel()) {
+      statement.setDatabase(
+          files.isEmpty() || (parentFile = files.get(0).getParentFile()) == null
+              ? null
+              : parentFile.getName());
+    }
+
     return executeStatement(
         entry.isGeneratedByPipe() ? new PipeEnrichedStatement(statement) : statement, session);
   }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java
index 669013ec450..e3dbe43507d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java
@@ -32,7 +32,9 @@ import org.slf4j.LoggerFactory;
 import java.io.File;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 
 import static org.apache.iotdb.commons.utils.FileUtils.copyFileWithMD5Check;
@@ -45,14 +47,16 @@ public class ActiveLoadUtil {
   private static volatile ILoadDiskSelector loadDiskSelector = updateLoadDiskSelector();
 
   public static boolean loadTsFileAsyncToActiveDir(
-      final List<File> tsFiles, final String dataBaseName, final boolean isDeleteAfterLoad) {
+      final List<File> tsFiles,
+      final Map<String, String> loadAttributes,
+      final boolean isDeleteAfterLoad) {
     if (tsFiles == null || tsFiles.isEmpty()) {
       return true;
     }
 
     try {
       for (File file : tsFiles) {
-        if (!loadTsFilesToActiveDir(dataBaseName, file, isDeleteAfterLoad)) {
+        if (!loadTsFilesToActiveDir(loadAttributes, file, isDeleteAfterLoad)) {
           return false;
         }
       }
@@ -65,7 +69,7 @@ public class ActiveLoadUtil {
   }
 
   private static boolean loadTsFilesToActiveDir(
-      final String dataBaseName, final File file, final boolean isDeleteAfterLoad)
+      final Map<String, String> loadAttributes, final File file, final boolean isDeleteAfterLoad)
       throws IOException {
     if (file == null) {
       return true;
@@ -84,12 +88,9 @@ public class ActiveLoadUtil {
       LOGGER.warn("Load active listening dir is not set.");
       return false;
     }
-    final File targetDir;
-    if (Objects.nonNull(dataBaseName)) {
-      targetDir = new File(targetFilePath, dataBaseName);
-    } else {
-      targetDir = targetFilePath;
-    }
+    final Map<String, String> attributes =
+        Objects.nonNull(loadAttributes) ? loadAttributes : Collections.emptyMap();
+    final File targetDir = ActiveLoadPathHelper.resolveTargetDir(targetFilePath, attributes);
 
     loadTsFileAsyncToTargetDir(
         targetDir, new File(file.getAbsolutePath() + ".resource"), isDeleteAfterLoad);
@@ -100,7 +101,9 @@ public class ActiveLoadUtil {
   }
 
   public static boolean loadFilesToActiveDir(
-      final String dataBaseName, final List<String> files, final boolean isDeleteAfterLoad)
+      final Map<String, String> loadAttributes,
+      final List<String> files,
+      final boolean isDeleteAfterLoad)
       throws IOException {
     if (files == null || files.isEmpty()) {
       return true;
@@ -120,12 +123,9 @@ public class ActiveLoadUtil {
       LOGGER.warn("Load active listening dir is not set.");
       return false;
     }
-    final File targetDir;
-    if (Objects.nonNull(dataBaseName)) {
-      targetDir = new File(targetFilePath, dataBaseName);
-    } else {
-      targetDir = targetFilePath;
-    }
+    final Map<String, String> attributes =
+        Objects.nonNull(loadAttributes) ? loadAttributes : Collections.emptyMap();
+    final File targetDir = ActiveLoadPathHelper.resolveTargetDir(targetFilePath, attributes);
 
     for (final String file : files) {
       loadTsFileAsyncToTargetDir(targetDir, new File(file), isDeleteAfterLoad);
@@ -138,6 +138,11 @@ public class ActiveLoadUtil {
     if (!file.exists()) {
       return;
     }
+    if (!targetDir.exists() && !targetDir.mkdirs()) {
+      if (!targetDir.exists()) {
+        throw new IOException("Failed to create target directory " + targetDir.getAbsolutePath());
+      }
+    }
     RetryUtils.retryOnException(
         () -> {
           if (isDeleteAfterLoad) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/config/LoadTsFileConfigurator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/config/LoadTsFileConfigurator.java
index da94de532d1..8478486781b 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/config/LoadTsFileConfigurator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/config/LoadTsFileConfigurator.java
@@ -54,6 +54,9 @@ public class LoadTsFileConfigurator {
       case VERIFY_KEY:
         validateVerifyParam(value);
         break;
+      case PIPE_GENERATED_KEY:
+        validatePipeGeneratedParam(value);
+        break;
       case ASYNC_LOAD_KEY:
         validateAsyncLoadParam(value);
         break;
@@ -183,6 +186,21 @@ public class LoadTsFileConfigurator {
         loadAttributes.getOrDefault(VERIFY_KEY, String.valueOf(VERIFY_DEFAULT_VALUE)));
   }
 
+  public static final String PIPE_GENERATED_KEY = "pipe-generated";
+
+  public static void validatePipeGeneratedParam(final String pipeGenerated) {
+    if (!"true".equalsIgnoreCase(pipeGenerated) && !"false".equalsIgnoreCase(pipeGenerated)) {
+      throw new SemanticException(
+          String.format(
+              "Given %s value '%s' is not supported, please input a valid boolean value.",
+              PIPE_GENERATED_KEY, pipeGenerated));
+    }
+  }
+
+  public static boolean parseOrGetDefaultPipeGenerated(final Map<String, String> loadAttributes) {
+    return Boolean.parseBoolean(loadAttributes.getOrDefault(PIPE_GENERATED_KEY, "false"));
+  }
+
   public static final String ASYNC_LOAD_KEY = "async";
   private static final boolean ASYNC_LOAD_DEFAULT_VALUE = false;
 


(iotdb) 04/45: Optimize the configuration logic of dn_thrift_max_frame_size (#16724)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit ce054e88e2f473d21c40616076cec18621cdc90b
Author: Haonan <hh...@outlook.com>
AuthorDate: Mon Nov 10 18:15:48 2025 +0800

    Optimize the configuration logic of dn_thrift_max_frame_size (#16724)
    
    * Add thrift max frame size calculate logic
    
    * Add thrift max frame size calculate logic
    
    * fix review
    
    (cherry picked from commit ffa9c562c4eef4ee7f695fb4ef3311c50634a181)
---
 .../rpc/TCompressedElasticFramedTransport.java     |  8 +-
 .../apache/iotdb/rpc/TElasticFramedTransport.java  | 99 +++++++++++++---------
 .../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 10 ++-
 .../org/apache/iotdb/db/conf/IoTDBDescriptor.java  |  4 -
 .../conf/iotdb-system.properties.template          |  4 +-
 .../apache/iotdb/commons/conf/IoTDBConstant.java   |  1 -
 6 files changed, 69 insertions(+), 57 deletions(-)

diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TCompressedElasticFramedTransport.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TCompressedElasticFramedTransport.java
index a3b4f38064a..5b9c81ec58b 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TCompressedElasticFramedTransport.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TCompressedElasticFramedTransport.java
@@ -44,13 +44,7 @@ public abstract class TCompressedElasticFramedTransport extends TElasticFramedTr
   protected void readFrame() throws TTransportException {
     underlying.readAll(i32buf, 0, 4);
     int size = TFramedTransport.decodeFrameSize(i32buf);
-
-    if (size < 0) {
-      close();
-      throw new TTransportException(
-          TTransportException.CORRUPTED_DATA, "Read a negative frame size (" + size + ")!");
-    }
-
+    checkFrameSize(size);
     readBuffer.fill(underlying, size);
     RpcStat.readCompressedBytes.addAndGet(size);
     try {
diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java
index 6008988a809..cd5eea30993 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java
@@ -169,54 +169,71 @@ public class TElasticFramedTransport extends TTransport {
   protected void readFrame() throws TTransportException {
     underlying.readAll(i32buf, 0, 4);
     int size = TFramedTransport.decodeFrameSize(i32buf);
+    checkFrameSize(size);
+    readBuffer.fill(underlying, size);
+  }
 
-    if (size < 0) {
-      close();
-      throw new TTransportException(
-          TTransportException.CORRUPTED_DATA, "Read a negative frame size (" + size + ")!");
+  protected void checkFrameSize(int size) throws TTransportException {
+    final int HTTP_GET_SIGNATURE = 0x47455420; // "GET "
+    final int HTTP_POST_SIGNATURE = 0x504F5354; // "POST"
+    final int TLS_MIN_VERSION = 0x160300;
+    final int TLS_MAX_VERSION = 0x160303;
+    final int TLS_LENGTH_HIGH_MAX = 0x02;
+
+    FrameError error = null;
+    if (size == HTTP_GET_SIGNATURE || size == HTTP_POST_SIGNATURE) {
+      error = FrameError.HTTP_REQUEST;
+    } else {
+      int high24 = size >>> 8;
+      if (high24 >= TLS_MIN_VERSION
+          && high24 <= TLS_MAX_VERSION
+          && (i32buf[3] & 0xFF) <= TLS_LENGTH_HIGH_MAX) {
+        error = FrameError.TLS_REQUEST;
+      } else if (size < 0) {
+        error = FrameError.NEGATIVE_FRAME_SIZE;
+      } else if (size > thriftMaxFrameSize) {
+        error = FrameError.FRAME_SIZE_EXCEEDED;
+      }
     }
 
-    if (size > thriftMaxFrameSize) {
-      SocketAddress remoteAddress = null;
-      if (underlying instanceof TSocket) {
-        remoteAddress = ((TSocket) underlying).getSocket().getRemoteSocketAddress();
-      }
-      close();
-      if (size == 1195725856L || size == 1347375956L) {
-        // if someone sends HTTP GET/POST to this port, the size will be read as the following
-        throw new TTransportException(
-            TTransportException.CORRUPTED_DATA,
-            String.format(
-                "Singular frame size (%d) detected, you may be sending HTTP GET/POST"
-                    + "%s requests to the Thrift-RPC port, "
-                    + "please confirm that you are using the right port",
-                size, remoteAddress == null ? "" : " from " + remoteAddress));
-      } else {
-        throw new TTransportException(
-            TTransportException.CORRUPTED_DATA,
-            "Frame size (" + size + ") larger than protect max size (" + thriftMaxFrameSize + ")!");
-      }
+    if (error == null) {
+      return;
     }
 
-    int high24 = size >>> 8;
-    if (high24 >= 0x160300 && high24 <= 0x160303 && (i32buf[3] & 0xFF) <= 0x02) {
-      // The typical TLS ClientHello requests start with 0x160300 ~ 0x160303
-      // The 4th byte is typically in [0x00, 0x01, 0x02].
-      SocketAddress remoteAddress = null;
-      if (underlying instanceof TSocket) {
-        remoteAddress = ((TSocket) underlying).getSocket().getRemoteSocketAddress();
-      }
-      close();
-      throw new TTransportException(
-          TTransportException.CORRUPTED_DATA,
-          String.format(
-              "Singular frame size (%d) detected, you may be sending TLS ClientHello requests"
-                  + "%s to the Non-SSL Thrift-RPC"
-                  + " port, please confirm that you are using the right configuration",
-              size, remoteAddress == null ? "" : " from " + remoteAddress));
+    SocketAddress remoteAddress = null;
+    if (underlying instanceof TSocket) {
+      remoteAddress = ((TSocket) underlying).getSocket().getRemoteSocketAddress();
     }
+    String remoteInfo = (remoteAddress == null) ? "" : " from " + remoteAddress;
+    close();
 
-    readBuffer.fill(underlying, size);
+    error.throwException(size, remoteInfo, thriftMaxFrameSize);
+  }
+
+  private enum FrameError {
+    HTTP_REQUEST(
+        "Singular frame size (%d) detected, you may be sending HTTP GET/POST%s "
+            + "requests to the Thrift-RPC port, please confirm that you are using the right port"),
+    TLS_REQUEST(
+        "Singular frame size (%d) detected, you may be sending TLS ClientHello "
+            + "requests%s to the Non-SSL Thrift-RPC port, please confirm that you are using "
+            + "the right configuration"),
+    NEGATIVE_FRAME_SIZE("Read a negative frame size (%d)%s!"),
+    FRAME_SIZE_EXCEEDED("Frame size (%d) larger than protect max size (%d)%s!");
+
+    private final String messageFormat;
+
+    FrameError(String messageFormat) {
+      this.messageFormat = messageFormat;
+    }
+
+    void throwException(int size, String remoteInfo, int maxSize) throws TTransportException {
+      String message =
+          (this == FRAME_SIZE_EXCEEDED)
+              ? String.format(messageFormat, size, maxSize, remoteInfo)
+              : String.format(messageFormat, size, remoteInfo);
+      throw new TTransportException(TTransportException.CORRUPTED_DATA, message);
+    }
   }
 
   @Override
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index bb62d241cc9..36a148430cb 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -807,7 +807,7 @@ public class IoTDBConfig {
   private float udfCollectorMemoryBudgetInMB = (float) (1.0 / 3 * udfMemoryBudgetInMB);
 
   /** Unit: byte */
-  private int thriftMaxFrameSize = 536870912;
+  private int thriftMaxFrameSize = getDefaultThriftMaxFrameSize();
 
   private int thriftDefaultBufferSize = RpcUtils.THRIFT_DEFAULT_BUF_CAPACITY;
 
@@ -2572,10 +2572,16 @@ public class IoTDBConfig {
   }
 
   public void setThriftMaxFrameSize(int thriftMaxFrameSize) {
-    this.thriftMaxFrameSize = thriftMaxFrameSize;
+    this.thriftMaxFrameSize =
+        thriftMaxFrameSize <= 0 ? getDefaultThriftMaxFrameSize() : thriftMaxFrameSize;
     BaseRpcTransportFactory.setThriftMaxFrameSize(this.thriftMaxFrameSize);
   }
 
+  private static int getDefaultThriftMaxFrameSize() {
+    return Math.min(
+        64 * 1024 * 1024, (int) Math.min(Runtime.getRuntime().maxMemory() / 64, Integer.MAX_VALUE));
+  }
+
   public int getThriftDefaultBufferSize() {
     return thriftDefaultBufferSize;
   }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
index 7e903948c19..6ee056d0685 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
@@ -803,10 +803,6 @@ public class IoTDBDescriptor {
             properties.getProperty(
                 "dn_thrift_max_frame_size", String.valueOf(conf.getThriftMaxFrameSize()))));
 
-    if (conf.getThriftMaxFrameSize() < IoTDBConstant.LEFT_SIZE_IN_REQUEST * 2) {
-      conf.setThriftMaxFrameSize(IoTDBConstant.LEFT_SIZE_IN_REQUEST * 2);
-    }
-
     conf.setThriftDefaultBufferSize(
         Integer.parseInt(
             properties.getProperty(
diff --git a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
index e4d6b56895a..5a32d6a1231 100644
--- a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
+++ b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template
@@ -533,10 +533,10 @@ dn_rpc_selector_thread_count=1
 # Datatype: int
 dn_rpc_max_concurrent_client_num=1000
 
-# thrift max frame size, 512MB by default
+# thrift max frame size in bytes. When set to 0, use min(64MB, datanode heap memory / 64)
 # effectiveMode: restart
 # Datatype: int
-dn_thrift_max_frame_size=536870912
+dn_thrift_max_frame_size=0
 
 # thrift init buffer size
 # effectiveMode: restart
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/IoTDBConstant.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/IoTDBConstant.java
index 8b4352cb95a..adf72842797 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/IoTDBConstant.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/IoTDBConstant.java
@@ -285,7 +285,6 @@ public class IoTDBConstant {
   public static final String MQTT_MAX_MESSAGE_SIZE = "mqtt_max_message_size";
 
   // thrift
-  public static final int LEFT_SIZE_IN_REQUEST = 4 * 1024 * 1024;
   public static final int DEFAULT_FETCH_SIZE = 5000;
   public static final int DEFAULT_CONNECTION_TIMEOUT_MS = 0;
 


(iotdb) 01/45: Active Load: Ignore java.io.UncheckedIOException exceptions thrown during the file scanning process. (#16705)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit cbe57655b1e518b8f6904c5c7f8c2de5b5098e3d
Author: Zhenyu Luo <zh...@apache.org>
AuthorDate: Mon Nov 10 15:55:59 2025 +0800

    Active Load: Ignore java.io.UncheckedIOException exceptions thrown during the file scanning process. (#16705)
    
    * Active Load: Ignore java.io.UncheckedIOException exceptions thrown during the file scanning process.
    
    * update
    
    (cherry picked from commit 2de3bb6f534bb94f816f893c9091b0c95fb1d2a8)
---
 .../iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java       | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java
index 8abfa618708..5ac33dfbdd4 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java
@@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.nio.file.FileVisitResult;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -125,6 +126,8 @@ public class ActiveLoadDirScanner extends ActiveLoadScheduledExecutorService {
                                 parentFile.getAbsoluteFile(), listeningDirFile.getAbsoluteFile()),
                         isGeneratedByPipe);
                   });
+        } catch (UncheckedIOException e) {
+          LOGGER.debug("The file has been deleted. Ignore this exception.");
         } catch (final Exception e) {
           LOGGER.warn("Exception occurred during scanning dir: {}", listeningDir, e);
         }


(iotdb) 34/45: Load: Fixed parameter passing error in MoveFile function (#16748)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit e72ee9a247a3e72b8baf3cff579bfc4829017997
Author: Zhenyu Luo <zh...@apache.org>
AuthorDate: Thu Nov 20 19:02:45 2025 +0800

    Load: Fixed parameter passing error in MoveFile function (#16748)
    
    * Load: Fixed parameter passing error in MoveFile function
    
    * update
    
    * add ut
    
    * update
    
    (cherry picked from commit b3509d6d6bf16203137bca4cb4b204e7cbd14654)
---
 .../org/apache/iotdb/commons/utils/FileUtils.java  | 92 +++++++++++++---------
 .../apache/iotdb/commons/utils/FileUtilsTest.java  | 79 +++++++++++++++++++
 2 files changed, 132 insertions(+), 39 deletions(-)

diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
index 5775eb65853..baed8bcd537 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java
@@ -418,7 +418,7 @@ public class FileUtils {
     final String sourceFileName = sourceFile.getName();
     final File targetFile = new File(targetDir, sourceFileName);
     if (targetFile.exists()) {
-      moveFile(sourceFile, targetFile);
+      moveFile(sourceFile, targetDir);
     } else {
       org.apache.tsfile.external.commons.io.FileUtils.moveFileToDirectory(
           sourceFile, targetDir, true);
@@ -428,31 +428,37 @@ public class FileUtils {
   private static void moveFile(File sourceFile, File targetDir) throws IOException {
     String sourceFileName = sourceFile.getName();
     final File exitsFile = new File(targetDir, sourceFileName);
-    try (final FileInputStream is1 = new FileInputStream(sourceFile);
-        final FileInputStream is2 = new FileInputStream(exitsFile); ) {
-      long sourceFileSize = is1.getChannel().size();
-      long exitsFileSize = is2.getChannel().size();
-      if (sourceFileSize != exitsFileSize) {
-        File file = renameWithSize(sourceFile, sourceFileSize, targetDir);
-        if (!file.exists()) {
-          moveFileRename(sourceFile, file);
-          return;
-        }
-      }
 
-      String sourceFileMD5 = DigestUtils.md5Hex(is1);
-      String exitsFileMD5 = DigestUtils.md5Hex(is2);
+    // First check file sizes
+    long sourceFileSize = sourceFile.length();
+    long existsFileSize = exitsFile.length();
 
-      if (sourceFileMD5.equals(exitsFileMD5)) {
-        org.apache.tsfile.external.commons.io.FileUtils.forceDelete(sourceFile);
-        LOGGER.info(
-            "Deleted the file {} because it already exists in the target directory: {}",
-            sourceFile.getName(),
-            targetDir.getAbsolutePath());
-      } else {
-        File file = renameWithMD5(sourceFile, sourceFileMD5, targetDir);
+    if (sourceFileSize != existsFileSize) {
+      File file = renameWithSize(sourceFile, sourceFileSize, targetDir);
+      if (!file.exists()) {
         moveFileRename(sourceFile, file);
       }
+      return;
+    }
+
+    // If sizes are equal, check MD5
+    String sourceFileMD5;
+    String existsFileMD5;
+    try (final FileInputStream is1 = new FileInputStream(sourceFile);
+        final FileInputStream is2 = new FileInputStream(exitsFile); ) {
+      sourceFileMD5 = DigestUtils.md5Hex(is1);
+      existsFileMD5 = DigestUtils.md5Hex(is2);
+    }
+
+    if (sourceFileMD5.equals(existsFileMD5)) {
+      org.apache.tsfile.external.commons.io.FileUtils.forceDelete(sourceFile);
+      LOGGER.info(
+          "Deleted the file {} because it already exists in the target directory: {}",
+          sourceFile.getName(),
+          targetDir.getAbsolutePath());
+    } else {
+      File file = renameWithMD5(sourceFile, sourceFileMD5, targetDir);
+      moveFileRename(sourceFile, file);
     }
   }
 
@@ -492,27 +498,35 @@ public class FileUtils {
       throws IOException {
     String sourceFileName = sourceFile.getName();
     final File exitsFile = new File(targetDir, sourceFileName);
-    try (final FileInputStream is1 = new FileInputStream(sourceFile);
-        final FileInputStream is2 = new FileInputStream(exitsFile); ) {
-      long sourceFileSize = is1.getChannel().size();
-      long exitsFileSize = is2.getChannel().size();
-      if (sourceFileSize != exitsFileSize) {
-        File file = renameWithSize(sourceFile, sourceFileSize, targetDir);
-        if (!file.exists()) {
-          copyFileRename(sourceFile, file);
-          return;
-        }
-      }
-      String sourceFileMD5 = DigestUtils.md5Hex(is1);
-      String exitsFileMD5 = DigestUtils.md5Hex(is2);
-      if (sourceFileMD5.equals(exitsFileMD5)) {
-        return;
-      }
 
-      File file = renameWithMD5(sourceFile, sourceFileMD5, targetDir);
+    // First check file sizes
+    long sourceFileSize = sourceFile.length();
+    long exitsFileSize = exitsFile.length();
+
+    if (sourceFileSize != exitsFileSize) {
+      File file = renameWithSize(sourceFile, sourceFileSize, targetDir);
       if (!file.exists()) {
         copyFileRename(sourceFile, file);
       }
+      return;
+    }
+
+    // If sizes are equal, check MD5
+    String sourceFileMD5;
+    String exitsFileMD5;
+    try (final FileInputStream is1 = new FileInputStream(sourceFile);
+        final FileInputStream is2 = new FileInputStream(exitsFile); ) {
+      sourceFileMD5 = DigestUtils.md5Hex(is1);
+      exitsFileMD5 = DigestUtils.md5Hex(is2);
+    }
+
+    if (sourceFileMD5.equals(exitsFileMD5)) {
+      return;
+    }
+
+    File file = renameWithMD5(sourceFile, sourceFileMD5, targetDir);
+    if (!file.exists()) {
+      copyFileRename(sourceFile, file);
     }
   }
 
diff --git a/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/utils/FileUtilsTest.java b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/utils/FileUtilsTest.java
new file mode 100644
index 00000000000..e25755f4c17
--- /dev/null
+++ b/iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/utils/FileUtilsTest.java
@@ -0,0 +1,79 @@
+/*
+ * 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.utils;
+
+import org.apache.tsfile.enums.TSDataType;
+import org.apache.tsfile.exception.write.WriteProcessException;
+import org.apache.tsfile.write.TsFileWriter;
+import org.apache.tsfile.write.record.Tablet;
+import org.apache.tsfile.write.schema.MeasurementSchema;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.Collections;
+
+public class FileUtilsTest {
+  private File tmpDir;
+  private File targetDir;
+
+  @Before
+  public void setUp() throws Exception {
+    tmpDir = new File(Files.createTempDirectory("load").toUri());
+    targetDir = new File(Files.createTempDirectory("target").toUri());
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    tmpDir.delete();
+    targetDir.delete();
+  }
+
+  @Test
+  public void testFileUtils() throws WriteProcessException, IOException {
+    File tstFile = new File(tmpDir, "1-1-0-0.tsfile");
+    File tstFile2 = new File(tmpDir, "2-1-0-0.tsfile");
+    generateFile(tstFile);
+    FileUtils.copyFile(tstFile, tstFile2);
+    FileUtils.moveFileWithMD5Check(tstFile, targetDir);
+    tstFile2.renameTo(tstFile);
+    FileUtils.moveFileWithMD5Check(tstFile, targetDir);
+  }
+
+  private void generateFile(File tsfile) throws WriteProcessException, IOException {
+    try (TsFileWriter writer = new TsFileWriter(tsfile)) {
+      writer.registerAlignedTimeseries(
+          "root.test.d1",
+          Collections.singletonList(new MeasurementSchema("s1", TSDataType.BOOLEAN)));
+      Tablet tablet =
+          new Tablet(
+              "root.test.d1",
+              Collections.singletonList(new MeasurementSchema("s1", TSDataType.BOOLEAN)));
+      for (int i = 0; i < 5; i++) {
+        tablet.addTimestamp(i, i);
+        tablet.addValue(i, 0, true);
+      }
+      writer.writeTree(tablet);
+    }
+  }
+}


(iotdb) 25/45: reduce error log when compaction service is stopped & fix bugs (#16756)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 104bcf1eb4fb77ce703e57f13397ce5183f4475c
Author: shuwenwei <55...@users.noreply.github.com>
AuthorDate: Mon Nov 17 11:42:43 2025 +0800

    reduce error log when compaction service is stopped & fix bugs (#16756)
    
    * reduce error log when compaction service is stopped
    
    * fix writer for compaction tests
    
    * fix npe
    
    (cherry picked from commit a7f1527d04cd29846987e5cc6df557e2050bd5cc)
---
 .../compaction/execute/task/AbstractCompactionTask.java    |  3 ++-
 .../compaction/execute/task/InnerSpaceCompactionTask.java  | 14 +++++++-------
 .../compaction/utils/CompactionTestFileWriter.java         |  6 +++++-
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/AbstractCompactionTask.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/AbstractCompactionTask.java
index cf59a19552b..dd37f626d70 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/AbstractCompactionTask.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/AbstractCompactionTask.java
@@ -164,7 +164,8 @@ public abstract class AbstractCompactionTask {
     } else if (e instanceof InterruptedException
         || Thread.interrupted()
         || e instanceof StopReadTsFileByInterruptException
-        || !tsFileManager.isAllowCompaction()) {
+        || !tsFileManager.isAllowCompaction()
+        || CompactionTaskManager.getInstance().isStopAllCompactionWorker()) {
       logger.warn(
           "{}-{} [Compaction] {} task interrupted",
           storageGroupName,
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/InnerSpaceCompactionTask.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/InnerSpaceCompactionTask.java
index 9c7fcc5424f..9bc91bf6bf1 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/InnerSpaceCompactionTask.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/InnerSpaceCompactionTask.java
@@ -117,14 +117,14 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
   }
 
   protected static class InnerCompactionTaskFilesView {
-    protected List<TsFileResource> sortedAllSourceFilesInTask;
-    protected List<TsFileResource> sourceFilesInCompactionPerformer;
-    protected List<TsFileResource> skippedSourceFiles;
+    protected List<TsFileResource> sortedAllSourceFilesInTask = Collections.emptyList();
+    protected List<TsFileResource> sourceFilesInCompactionPerformer = Collections.emptyList();
+    protected List<TsFileResource> skippedSourceFiles = Collections.emptyList();
     protected boolean sequence;
-    protected List<TsFileResource> sourceFilesInLog;
-    protected List<TsFileResource> targetFilesInLog;
-    protected List<TsFileResource> targetFilesInPerformer;
-    protected List<TsFileResource> renamedTargetFiles;
+    protected List<TsFileResource> sourceFilesInLog = Collections.emptyList();
+    protected List<TsFileResource> targetFilesInLog = Collections.emptyList();
+    protected List<TsFileResource> targetFilesInPerformer = Collections.emptyList();
+    protected List<TsFileResource> renamedTargetFiles = Collections.emptyList();
 
     protected long selectedFileSize;
     protected int sumOfCompactionCount;
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionTestFileWriter.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionTestFileWriter.java
index fe88adfac68..42254428ef8 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionTestFileWriter.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/utils/CompactionTestFileWriter.java
@@ -19,6 +19,8 @@
 
 package org.apache.iotdb.db.storageengine.dataregion.compaction.utils;
 
+import org.apache.iotdb.db.storageengine.dataregion.compaction.io.CompactionTsFileWriter;
+import org.apache.iotdb.db.storageengine.dataregion.compaction.schedule.constant.CompactionType;
 import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
 
 import org.apache.tsfile.enums.TSDataType;
@@ -49,7 +51,9 @@ public class CompactionTestFileWriter implements Closeable {
 
   public CompactionTestFileWriter(TsFileResource emptyFile) throws IOException {
     this.resource = emptyFile;
-    fileWriter = new TsFileIOWriter(emptyFile.getTsFile());
+    fileWriter =
+        new CompactionTsFileWriter(
+            emptyFile.getTsFile(), 1024 * 1024 * 1024, CompactionType.INNER_SEQ_COMPACTION);
   }
 
   public IDeviceID startChunkGroup(String deviceNameWithoutParentPath) throws IOException {


(iotdb) 13/45: [AINode] Package AINode via PyInstaller (#16707)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit ff6f7a26ccf36b6bdf6bac53dcd5f1f5edcf9ee4
Author: Yongzao <yo...@apache.org>
AuthorDate: Wed Nov 12 16:41:41 2025 +0800

    [AINode] Package AINode via PyInstaller (#16707)
    
    (cherry picked from commit 49c625bb83ec28f1c11303504766416f59381a45)
---
 .github/workflows/cluster-it-1c1d1a.yml            |   2 +-
 integration-test/src/assembly/mpp-test.xml         |   2 +-
 .../iotdb/it/env/cluster/node/AINodeWrapper.java   |  25 +-
 .../ainode/it/AINodeConcurrentInferenceIT.java     |  62 +--
 iotdb-core/ainode/.gitignore                       |   6 +-
 iotdb-core/ainode/ainode.spec                      | 199 +++++++
 iotdb-core/ainode/ainode.xml                       |  17 +-
 iotdb-core/ainode/build_binary.py                  | 596 +++++++++++++++++++++
 iotdb-core/ainode/iotdb/ainode/core/config.py      |  28 +-
 iotdb-core/ainode/iotdb/ainode/core/constant.py    |  18 +-
 .../iotdb/ainode/core/inference/pool_controller.py |  47 +-
 .../pool_scheduler/basic_pool_scheduler.py         |   7 +-
 iotdb-core/ainode/iotdb/ainode/core/log.py         |   4 +-
 iotdb-core/ainode/iotdb/ainode/core/script.py      |  80 +--
 iotdb-core/ainode/poetry.lock                      | 111 +++-
 iotdb-core/ainode/pom.xml                          |  92 +---
 iotdb-core/ainode/pyproject.toml                   |  29 +-
 .../ainode/resources/syncPythonVersion.groovy      |  33 --
 scripts/conf/ainode-env.sh                         | 138 -----
 scripts/conf/windows/ainode-env.bat                | 129 -----
 scripts/sbin/start-ainode.sh                       |  41 +-
 scripts/sbin/windows/start-ainode.bat              |  48 +-
 22 files changed, 1028 insertions(+), 686 deletions(-)

diff --git a/.github/workflows/cluster-it-1c1d1a.yml b/.github/workflows/cluster-it-1c1d1a.yml
index f1b583f8efe..d4c40fa7ad8 100644
--- a/.github/workflows/cluster-it-1c1d1a.yml
+++ b/.github/workflows/cluster-it-1c1d1a.yml
@@ -59,5 +59,5 @@ jobs:
         uses: actions/upload-artifact@v4
         with:
           name: cluster-log-ainode-${{ matrix.os }}
-          path: integration-test/target/ainode-logs
+          path: integration-test/target/*-logs
           retention-days: 30
diff --git a/integration-test/src/assembly/mpp-test.xml b/integration-test/src/assembly/mpp-test.xml
index 4bcd32c7ee0..3915c4593a9 100644
--- a/integration-test/src/assembly/mpp-test.xml
+++ b/integration-test/src/assembly/mpp-test.xml
@@ -63,7 +63,7 @@
         </fileSet>
         <fileSet>
             <outputDirectory>lib</outputDirectory>
-            <directory>${project.basedir}/../iotdb-core/ainode/dist/</directory>
+            <directory>${project.basedir}/../iotdb-core/ainode/dist/ainode/</directory>
             <fileMode>0755</fileMode>
         </fileSet>
     </fileSets>
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AINodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AINodeWrapper.java
index 20c31f46146..e118d6c3a98 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AINodeWrapper.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AINodeWrapper.java
@@ -25,9 +25,9 @@ import org.apache.iotdb.it.framework.IoTDBTestLogger;
 import org.apache.tsfile.external.commons.io.file.PathUtils;
 import org.slf4j.Logger;
 
-import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileWriter;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.LinkOption;
@@ -37,6 +37,7 @@ import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Properties;
 import java.util.stream.Stream;
 
 import static org.apache.iotdb.it.env.cluster.ClusterConstant.AI_NODE_NAME;
@@ -62,15 +63,19 @@ public class AINodeWrapper extends AbstractNodeWrapper {
   public static final String CACHE_BUILT_IN_MODEL_PATH = "/data/ainode/models/weights";
 
   private void replaceAttribute(String[] keys, String[] values, String filePath) {
-    try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath, true))) {
-      for (int i = 0; i < keys.length; i++) {
-        String line = keys[i] + "=" + values[i];
-        writer.newLine();
-        writer.write(line);
-      }
+    Properties props = new Properties();
+    try (FileInputStream in = new FileInputStream(filePath)) {
+      props.load(in);
+    } catch (IOException e) {
+      logger.warn("Failed to load existing AINode properties from {}, because: ", filePath, e);
+    }
+    for (int i = 0; i < keys.length; i++) {
+      props.setProperty(keys[i], values[i]);
+    }
+    try (FileOutputStream out = new FileOutputStream(filePath)) {
+      props.store(out, "Updated by AINode integration-test env");
     } catch (IOException e) {
-      logger.error(
-          "Failed to set attribute for AINode in file: {} because {}", filePath, e.getMessage());
+      logger.error("Failed to save properties to {}, because:", filePath, e);
     }
   }
 
diff --git a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentInferenceIT.java b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentInferenceIT.java
index 42fcf1d30d6..a08990d472f 100644
--- a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentInferenceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentInferenceIT.java
@@ -90,33 +90,6 @@ public class AINodeConcurrentInferenceIT {
     }
   }
 
-  //  @Test
-  public void concurrentCPUCallInferenceTest() throws SQLException, InterruptedException {
-    concurrentCPUCallInferenceTest("timer_xl");
-    concurrentCPUCallInferenceTest("sundial");
-  }
-
-  private void concurrentCPUCallInferenceTest(String modelId)
-      throws SQLException, InterruptedException {
-    try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TREE_SQL_DIALECT);
-        Statement statement = connection.createStatement()) {
-      final int threadCnt = 4;
-      final int loop = 10;
-      final int predictLength = 96;
-      statement.execute(String.format("LOAD MODEL %s TO DEVICES 'cpu'", modelId));
-      checkModelOnSpecifiedDevice(statement, modelId, "cpu");
-      concurrentInference(
-          statement,
-          String.format(
-              "CALL INFERENCE(%s, 'SELECT s FROM root.AI', predict_length=%d)",
-              modelId, predictLength),
-          threadCnt,
-          loop,
-          predictLength);
-      statement.execute(String.format("UNLOAD MODEL %s FROM DEVICES 'cpu'", modelId));
-    }
-  }
-
   //  @Test
   public void concurrentGPUCallInferenceTest() throws SQLException, InterruptedException {
     concurrentGPUCallInferenceTest("timer_xl");
@@ -150,39 +123,6 @@ public class AINodeConcurrentInferenceIT {
   String forecastUDTFSql =
       "SELECT forecast(s, 'MODEL_ID'='%s', 'PREDICT_LENGTH'='%d') FROM root.AI";
 
-  @Test
-  public void concurrentCPUForecastTest() throws SQLException, InterruptedException {
-    concurrentCPUForecastTest("timer_xl", forecastUDTFSql);
-    concurrentCPUForecastTest("sundial", forecastUDTFSql);
-    concurrentCPUForecastTest("timer_xl", forecastTableFunctionSql);
-    concurrentCPUForecastTest("sundial", forecastTableFunctionSql);
-  }
-
-  private void concurrentCPUForecastTest(String modelId, String selectSQL)
-      throws SQLException, InterruptedException {
-    try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
-        Statement statement = connection.createStatement()) {
-      final int threadCnt = 4;
-      final int loop = 10;
-      final int predictLength = 96;
-      statement.execute(String.format("LOAD MODEL %s TO DEVICES 'cpu'", modelId));
-      checkModelOnSpecifiedDevice(statement, modelId, "cpu");
-      long startTime = System.currentTimeMillis();
-      concurrentInference(
-          statement,
-          String.format(selectSQL, modelId, predictLength),
-          threadCnt,
-          loop,
-          predictLength);
-      long endTime = System.currentTimeMillis();
-      LOGGER.info(
-          String.format(
-              "Model %s concurrent inference %d reqs (%d threads, %d loops) in CPU takes time: %dms",
-              modelId, threadCnt * loop, threadCnt, loop, endTime - startTime));
-      statement.execute(String.format("UNLOAD MODEL %s FROM DEVICES 'cpu'", modelId));
-    }
-  }
-
   @Test
   public void concurrentGPUForecastTest() throws SQLException, InterruptedException {
     concurrentGPUForecastTest("timer_xl", forecastUDTFSql);
@@ -221,7 +161,7 @@ public class AINodeConcurrentInferenceIT {
       throws SQLException, InterruptedException {
     Set<String> targetDevices = ImmutableSet.copyOf(device.split(","));
     LOGGER.info("Checking model: {} on target devices: {}", modelId, targetDevices);
-    for (int retry = 0; retry < 20; retry++) {
+    for (int retry = 0; retry < 200; retry++) {
       Set<String> foundDevices = new HashSet<>();
       try (final ResultSet resultSet =
           statement.executeQuery(String.format("SHOW LOADED MODELS '%s'", device))) {
diff --git a/iotdb-core/ainode/.gitignore b/iotdb-core/ainode/.gitignore
index 8cc2098c3fd..bdb2698ec78 100644
--- a/iotdb-core/ainode/.gitignore
+++ b/iotdb-core/ainode/.gitignore
@@ -14,8 +14,6 @@
 # generated by maven
 /iotdb/ainode/conf/
 
-# .whl of ainode, generated by Poetry
+# generated by pyinstaller
 /dist/
-
-# the config to build ainode, it will be generated automatically
-pyproject.toml
+/build/
diff --git a/iotdb-core/ainode/ainode.spec b/iotdb-core/ainode/ainode.spec
new file mode 100644
index 00000000000..a131b2bcff2
--- /dev/null
+++ b/iotdb-core/ainode/ainode.spec
@@ -0,0 +1,199 @@
+# -*- mode: python ; coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under this 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.
+#
+
+from pathlib import Path
+
+# Get project root directory
+project_root = Path(SPECPATH).parent
+
+block_cipher = None
+
+# Auto-collect all submodules of large dependency libraries
+# Using collect_all automatically includes all dependencies and avoids manual maintenance of hiddenimports
+from PyInstaller.utils.hooks import collect_all, collect_submodules, collect_data_files
+
+# Collect only essential data files and binaries for large libraries
+# Using collect_all for all submodules slows down startup significantly.
+# However, for certain libraries with many dynamic imports (e.g., torch, transformers, safetensors),
+# collect_all is necessary to ensure all required modules are included.
+# For other libraries, we use lighter-weight collection methods to improve startup time.
+all_datas = []
+all_binaries = []
+all_hiddenimports = []
+
+# Only collect essential data files and binaries for critical libraries
+# This reduces startup time by avoiding unnecessary module imports
+essential_libraries = {
+    'torch': True,  # Keep collect_all for torch as it has many dynamic imports
+    'transformers': True,  # Keep collect_all for transformers
+    'safetensors': True,  # Keep collect_all for safetensors
+}
+
+# For other libraries, use selective collection to speed up startup
+other_libraries = ['sktime', 'scipy', 'pandas', 'sklearn', 'statsmodels', 'optuna']
+
+for lib in essential_libraries:
+    try:
+        lib_datas, lib_binaries, lib_hiddenimports = collect_all(lib)
+        all_datas.extend(lib_datas)
+        all_binaries.extend(lib_binaries)
+        all_hiddenimports.extend(lib_hiddenimports)
+    except Exception:
+        pass
+
+# For other libraries, only collect submodules (lighter weight)
+# This relies on PyInstaller's dependency analysis to include what's actually used
+for lib in other_libraries:
+    try:
+        submodules = collect_submodules(lib)
+        all_hiddenimports.extend(submodules)
+        # Only collect essential data files and binaries, not all submodules
+        # This significantly reduces startup time
+        try:
+            lib_datas, lib_binaries, _ = collect_all(lib)
+            all_datas.extend(lib_datas)
+            all_binaries.extend(lib_binaries)
+        except Exception:
+            # If collect_all fails, try collect_data_files for essential data only
+            try:
+                lib_datas = collect_data_files(lib)
+                all_datas.extend(lib_datas)
+            except Exception:
+                pass
+    except Exception:
+        pass
+
+# Project-specific packages that need their submodules collected
+# Only list top-level packages - collect_submodules will recursively collect all submodules
+TOP_LEVEL_PACKAGES = [
+    'iotdb.ainode.core',  # This will include all sub-packages: manager, model, inference, etc.
+    'iotdb.thrift',        # This will include all thrift sub-packages
+]
+
+# Collect all submodules for project packages automatically
+# Using top-level packages avoids duplicate collection
+for package in TOP_LEVEL_PACKAGES:
+    try:
+        submodules = collect_submodules(package)
+        all_hiddenimports.extend(submodules)
+    except Exception:
+        # If package doesn't exist or collection fails, add the package itself
+        all_hiddenimports.append(package)
+
+# Add parent packages to ensure they are included
+all_hiddenimports.extend(['iotdb', 'iotdb.ainode'])
+
+# Multiprocessing support for PyInstaller
+# When using multiprocessing with PyInstaller, we need to ensure proper handling
+multiprocessing_modules = [
+    'multiprocessing',
+    'multiprocessing.spawn',
+    'multiprocessing.popen_spawn_posix',
+    'multiprocessing.popen_spawn_win32',
+    'multiprocessing.popen_fork',
+    'multiprocessing.popen_forkserver',
+    'multiprocessing.context',
+    'multiprocessing.reduction',
+    'multiprocessing.util',
+    'torch.multiprocessing',
+    'torch.multiprocessing.spawn',
+]
+
+# Additional dependencies that may need explicit import
+# These are external libraries that might use dynamic imports
+external_dependencies = [
+    'huggingface_hub',
+    'tokenizers',
+    'hf_xet',
+    'einops',
+    'dynaconf',
+    'tzlocal',
+    'thrift',
+    'psutil',
+    'requests',
+]
+
+all_hiddenimports.extend(multiprocessing_modules)
+all_hiddenimports.extend(external_dependencies)
+
+# Analyze main entry file
+# Note: Do NOT add virtual environment site-packages to pathex manually.
+# When PyInstaller is run from the virtual environment's Python, it automatically
+# detects and uses the virtual environment's site-packages.
+a = Analysis(
+    ['iotdb/ainode/core/script.py'],
+    pathex=[str(project_root)],
+    binaries=all_binaries,
+    datas=all_datas,
+    hiddenimports=all_hiddenimports,
+    hookspath=[],
+    hooksconfig={},
+    runtime_hooks=[],
+    excludes=[
+        # Exclude unnecessary modules to reduce size and improve startup time
+        # Note: Do not exclude unittest, as torch and other libraries require it
+        # Only exclude modules that are definitely not used and not required by dependencies
+        'matplotlib',
+        'IPython',
+        'jupyter',
+        'notebook',
+        'pytest',
+        'test',
+        'tests'
+    ],
+    win_no_prefer_redirects=False,
+    win_private_assemblies=False,
+    cipher=block_cipher,
+    noarchive=True,  # Set to True to speed up startup - files are not archived into PYZ
+)
+
+# Package all PYZ files
+pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
+
+# Create executable (onedir mode for faster startup)
+exe = EXE(
+    pyz,
+    a.scripts,
+    [],
+    exclude_binaries=True,
+    name='ainode',
+    debug=False,
+    bootloader_ignore_signals=False,
+    strip=False,
+    upx=True,
+    console=True,
+    disable_windowed_traceback=False,
+    argv_emulation=False,
+    target_arch=None,
+    codesign_identity=None,
+    entitlements_file=None,
+)
+
+# Collect all files into a directory (onedir mode)
+coll = COLLECT(
+    exe,
+    a.binaries,
+    a.zipfiles,
+    a.datas,
+    strip=False,
+    upx=True,
+    upx_exclude=[],
+    name='ainode',
+)
\ No newline at end of file
diff --git a/iotdb-core/ainode/ainode.xml b/iotdb-core/ainode/ainode.xml
index beab4b69c01..6de635c1338 100644
--- a/iotdb-core/ainode/ainode.xml
+++ b/iotdb-core/ainode/ainode.xml
@@ -42,6 +42,10 @@
         </file>
     </files>
     <fileSets>
+        <fileSet>
+            <directory>iotdb/ainode/conf</directory>
+            <outputDirectory>conf</outputDirectory>
+        </fileSet>
         <fileSet>
             <directory>resources/conf</directory>
             <outputDirectory>conf</outputDirectory>
@@ -52,19 +56,8 @@
             <fileMode>0755</fileMode>
         </fileSet>
         <fileSet>
-            <directory>dist</directory>
+            <directory>dist/ainode</directory>
             <outputDirectory>lib</outputDirectory>
-            <includes>
-                <include>*.whl</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/../../scripts/conf</directory>
-            <outputDirectory>conf</outputDirectory>
-            <includes>
-                <include>ainode-env.*</include>
-                <include>**/ainode-env.*</include>
-            </includes>
             <fileMode>0755</fileMode>
         </fileSet>
         <fileSet>
diff --git a/iotdb-core/ainode/build_binary.py b/iotdb-core/ainode/build_binary.py
new file mode 100644
index 00000000000..1b5f99da214
--- /dev/null
+++ b/iotdb-core/ainode/build_binary.py
@@ -0,0 +1,596 @@
+# 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.
+#
+
+
+"""
+PyInstaller build script (Python version)
+"""
+
+import os
+import shutil
+import subprocess
+import sys
+from pathlib import Path
+
+
+def get_venv_base_dir():
+    """
+    Get the base directory for virtual environments outside the project.
+    
+    Returns:
+        Path: Base directory path
+        - Linux/macOS: ~/.cache/iotdb-ainode-build/
+        - Windows: %LOCALAPPDATA%\\iotdb-ainode-build\\
+    """
+    if sys.platform == "win32":
+        localappdata = os.environ.get("LOCALAPPDATA") or os.environ.get(
+            "APPDATA", os.path.expanduser("~")
+        )
+        base_dir = Path(localappdata) / "iotdb-ainode-build"
+    else:
+        base_dir = Path.home() / ".cache" / "iotdb-ainode-build"
+
+    return base_dir
+
+
+def setup_venv():
+    """
+    Create virtual environment outside the project directory.
+    
+    The virtual environment is created in a platform-specific location:
+    - Linux/macOS: ~/.cache/iotdb-ainode-build/<project-name>/
+    - Windows: %LOCALAPPDATA%\\iotdb-ainode-build\\<project-name>\\
+    
+    The same venv is reused across multiple builds of the same project.
+    
+    Returns:
+        Path: Path to the virtual environment directory
+    """
+    script_dir = Path(__file__).parent
+    venv_base_dir = get_venv_base_dir()
+    venv_dir = venv_base_dir / script_dir.name
+
+    if venv_dir.exists():
+        print(f"Virtual environment already exists at: {venv_dir}")
+        return venv_dir
+
+    venv_base_dir.mkdir(parents=True, exist_ok=True)
+    print(f"Creating virtual environment at: {venv_dir}")
+    subprocess.run([sys.executable, "-m", "venv", str(venv_dir)], check=True)
+    print("Virtual environment created successfully")
+    return venv_dir
+
+
+def get_venv_python(venv_dir):
+    """Get Python executable path in virtual environment"""
+    if sys.platform == "win32":
+        return venv_dir / "Scripts" / "python.exe"
+    else:
+        return venv_dir / "bin" / "python"
+
+
+def update_pip(venv_python):
+    """Update pip in the virtual environment to the latest version."""
+    print("Updating pip...")
+    subprocess.run(
+        [str(venv_python), "-m", "pip", "install", "--upgrade", "pip"], check=True
+    )
+    print("pip updated successfully")
+
+
+def install_poetry(venv_python):
+    """Install poetry 2.2.1 in the virtual environment."""
+    print("Installing poetry 2.2.1...")
+    subprocess.run(
+        [
+            str(venv_python),
+            "-m",
+            "pip",
+            "install",
+            "poetry==2.2.1",
+        ],
+        check=True,
+    )
+    # Get installed version
+    version_result = subprocess.run(
+        [str(venv_python), "-m", "poetry", "--version"],
+        capture_output=True,
+        text=True,
+        check=True,
+    )
+    print(f"Poetry installed: {version_result.stdout.strip()}")
+
+
+def get_venv_env(venv_dir):
+    """
+    Get environment variables configured for the virtual environment.
+
+    Sets VIRTUAL_ENV and prepends the venv's bin/Scripts directory to PATH
+    so that tools installed in the venv take precedence.
+    Also sets POETRY_VIRTUALENVS_PATH to force poetry to use our venv.
+
+    Returns:
+        dict: Environment variables dictionary
+    """
+    env = os.environ.copy()
+    env["VIRTUAL_ENV"] = str(venv_dir.absolute())
+
+    venv_bin = str(venv_dir / ("Scripts" if sys.platform == "win32" else "bin"))
+    env["PATH"] = f"{venv_bin}{os.pathsep}{env.get('PATH', '')}"
+
+    # Force poetry to use our virtual environment by setting POETRY_VIRTUALENVS_PATH
+    # This tells poetry where to look for/create virtual environments
+    env["POETRY_VIRTUALENVS_PATH"] = str(venv_dir.parent.absolute())
+
+    return env
+
+
+def get_poetry_executable(venv_dir):
+    """Get poetry executable path in the virtual environment."""
+    if sys.platform == "win32":
+        return venv_dir / "Scripts" / "poetry.exe"
+    else:
+        return venv_dir / "bin" / "poetry"
+
+
+def install_dependencies(venv_python, venv_dir, script_dir):
+    """
+    Install project dependencies using poetry.
+
+    Configures poetry to use the external virtual environment and installs
+    all dependencies from pyproject.toml.
+    """
+    print("Installing dependencies with poetry...")
+    venv_env = get_venv_env(venv_dir)
+    poetry_exe = get_poetry_executable(venv_dir)
+
+    # Configure poetry settings
+    print("Configuring poetry settings...")
+    try:
+        # Set poetry to not create venvs in project directory
+        subprocess.run(
+            [str(poetry_exe), "config", "virtualenvs.in-project", "false"],
+            cwd=str(script_dir),
+            env=venv_env,
+            check=True,
+            capture_output=True,
+            text=True,
+        )
+        # Set poetry virtualenvs path to our venv directory's parent
+        # This forces poetry to look for/create venvs in the same location as our venv
+        subprocess.run(
+            [
+                str(poetry_exe),
+                "config",
+                "virtualenvs.path",
+                str(venv_dir.parent.absolute()),
+            ],
+            cwd=str(script_dir),
+            env=venv_env,
+            check=True,
+            capture_output=True,
+            text=True,
+        )
+        # Ensure poetry can use virtual environments
+        subprocess.run(
+            [str(poetry_exe), "config", "virtualenvs.create", "true"],
+            cwd=str(script_dir),
+            env=venv_env,
+            check=True,
+            capture_output=True,
+            text=True,
+        )
+    except Exception as e:
+        print(f"Warning: Failed to configure poetry settings: {e}")
+        # Continue anyway, as these may not be critical
+
+    # Remove any existing poetry virtual environments for this project
+    # This ensures poetry will use our specified virtual environment
+    print("Removing any existing poetry virtual environments...")
+    remove_result = subprocess.run(
+        [str(poetry_exe), "env", "remove", "--all"],
+        cwd=str(script_dir),
+        env=venv_env,
+        check=False,  # Don't fail if no venv exists
+        capture_output=True,
+        text=True,
+    )
+    if remove_result.stdout:
+        print(remove_result.stdout.strip())
+    if remove_result.stderr:
+        stderr = remove_result.stderr.strip()
+        # Ignore "No virtualenv has been activated" error
+        if "no virtualenv" not in stderr.lower():
+            print(remove_result.stderr.strip())
+
+    # Verify the virtual environment Python is valid before configuring poetry
+    print(f"Verifying virtual environment Python at: {venv_python}")
+    if not venv_python.exists():
+        print(f"ERROR: Virtual environment Python not found at: {venv_python}")
+        sys.exit(1)
+
+    python_version_result = subprocess.run(
+        [str(venv_python), "--version"],
+        capture_output=True,
+        text=True,
+        check=False,
+    )
+    if python_version_result.returncode != 0:
+        print(f"ERROR: Virtual environment Python is not executable: {venv_python}")
+        sys.exit(1)
+    print(f"  Python version: {python_version_result.stdout.strip()}")
+
+    # Instead of using poetry env use (which creates new venvs), we'll use a different approach:
+    # 1. Create a symlink from poetry's expected venv location to our venv
+    # 2. Or, directly use poetry install with VIRTUAL_ENV set (poetry should detect it)
+    #
+    # The issue is that poetry env use creates venvs with hash-based names in its cache.
+    # We need to work around this by either:
+    # - Creating a symlink from poetry's expected location to our venv
+    # - Or bypassing poetry env use entirely and using poetry install directly
+
+    # Strategy: Create a symlink from poetry's expected venv location to our venv
+    # Poetry creates venvs with names like: <project-name>-<hash>-py<python-version>
+    # We need to find out what poetry would name our venv, then create a symlink
+
+    print(f"Configuring poetry to use virtual environment at: {venv_dir}")
+
+    # Get poetry's expected venv name by checking what it would create
+    # First, let's try poetry env use, but catch if it tries to create a new venv
+    result = subprocess.run(
+        [str(poetry_exe), "env", "use", str(venv_python)],
+        cwd=str(script_dir),
+        env=venv_env,
+        check=False,
+        capture_output=True,
+        text=True,
+    )
+
+    output_text = (result.stdout or "") + (result.stderr or "")
+
+    # If poetry is creating a new venv, we need to stop it and use a different approach
+    if (
+        "Creating virtualenv" in output_text
+        or "Creating virtual environment" in output_text
+        or "Using virtualenv:" in output_text
+    ):
+        print("Poetry is attempting to create/use a new virtual environment.")
+        print(
+            "Stopping this and using alternative approach: creating symlink to our venv..."
+        )
+
+        # Extract the venv path poetry is trying to create/use
+        # Look for patterns like "Using virtualenv: /path/to/venv" or "Creating virtualenv name in /path"
+        import re
+
+        poetry_venv_path = None
+
+        # Try to extract from "Using virtualenv: /path/to/venv"
+        using_match = re.search(r"Using virtualenv:\s*([^\s\n]+)", output_text)
+        if using_match:
+            poetry_venv_path = Path(using_match.group(1))
+
+        # If not found, try to extract from "Creating virtualenv name in /path"
+        if not poetry_venv_path:
+            creating_match = re.search(
+                r"Creating virtualenv[^\n]*in\s+([^\s\n]+)", output_text
+            )
+            if creating_match:
+                venv_dir_path = Path(creating_match.group(1))
+                # Extract venv name from the output
+                name_match = re.search(r"Creating virtualenv\s+([^\s]+)", output_text)
+                if name_match:
+                    venv_name = name_match.group(1)
+                    poetry_venv_path = venv_dir_path / venv_name
+
+        # If still not found, try to find any path in pypoetry/virtualenvs
+        if not poetry_venv_path:
+            pypoetry_match = re.search(
+                r"([^\s]+pypoetry[^\s]*virtualenvs[^\s]+)", output_text
+            )
+            if pypoetry_match:
+                poetry_venv_path = Path(pypoetry_match.group(1))
+
+        if poetry_venv_path:
+            print(f"Poetry wants to create/use venv at: {poetry_venv_path}")
+
+            # Remove the venv poetry just created (if it exists)
+            if poetry_venv_path.exists() and poetry_venv_path.is_dir():
+                print(f"Removing poetry's newly created venv: {poetry_venv_path}")
+                shutil.rmtree(poetry_venv_path, ignore_errors=True)
+
+            # Create a symlink from poetry's expected location to our venv
+            print(f"Creating symlink from {poetry_venv_path} to {venv_dir}")
+            try:
+                if poetry_venv_path.exists() or poetry_venv_path.is_symlink():
+                    if poetry_venv_path.is_symlink():
+                        poetry_venv_path.unlink()
+                    elif poetry_venv_path.is_dir():
+                        shutil.rmtree(poetry_venv_path, ignore_errors=True)
+                poetry_venv_path.parent.mkdir(parents=True, exist_ok=True)
+                poetry_venv_path.symlink_to(venv_dir)
+                print(f"✓ Symlink created successfully")
+            except Exception as e:
+                print(f"WARNING: Failed to create symlink: {e}")
+                print("Will try to use poetry install directly with VIRTUAL_ENV set")
+        else:
+            print("Could not determine poetry's venv path from output")
+            print(f"Output was: {output_text}")
+    else:
+        if result.stdout:
+            print(result.stdout.strip())
+        if result.stderr:
+            stderr = result.stderr.strip()
+            if stderr:
+                print(f"Poetry output: {stderr}")
+
+    # Verify poetry is using the correct virtual environment BEFORE running lock/install
+    # This is critical - if poetry uses the wrong venv, dependencies won't be installed correctly
+    print("Verifying poetry virtual environment...")
+
+    # Wait a moment for symlink to be recognized (if we created one)
+    import time
+
+    time.sleep(0.5)
+
+    verify_result = subprocess.run(
+        [str(poetry_exe), "env", "info", "--path"],
+        cwd=str(script_dir),
+        env=venv_env,
+        check=False,  # Don't fail if poetry hasn't activated a venv yet
+        capture_output=True,
+        text=True,
+    )
+
+    expected_venv_path_resolved = str(Path(venv_dir.absolute()).resolve())
+
+    # If poetry env info fails, it might mean poetry hasn't activated the venv yet
+    if verify_result.returncode != 0:
+        print(
+            "Warning: poetry env info failed, poetry may not have activated the virtual environment yet"
+        )
+        print(
+            "This may be okay if we created a symlink - poetry should use it when running commands"
+        )
+        poetry_venv_path_resolved = None
+    else:
+        poetry_venv_path = verify_result.stdout.strip()
+
+        # Normalize paths for comparison (resolve symlinks, etc.)
+        poetry_venv_path_resolved = str(Path(poetry_venv_path).resolve())
+
+    # Only verify path if we successfully got poetry's venv path
+    if poetry_venv_path_resolved is not None:
+        if poetry_venv_path_resolved != expected_venv_path_resolved:
+            print(
+                f"ERROR: Poetry is using {poetry_venv_path}, but expected {expected_venv_path_resolved}"
+            )
+            print(
+                "Poetry must use the virtual environment we created for the build to work correctly."
+            )
+            print("The symlink approach may not have worked. Please check the symlink.")
+            sys.exit(1)
+        else:
+            print(
+                f"✓ Poetry is correctly using virtual environment: {poetry_venv_path}"
+            )
+    else:
+        print("Warning: Could not verify poetry virtual environment path")
+        print(
+            "Continuing anyway - poetry should use the venv via symlink or VIRTUAL_ENV"
+        )
+
+    # Update lock file and install dependencies
+    # Re-verify environment before each command to ensure poetry doesn't switch venvs
+    def verify_poetry_env():
+        verify_result = subprocess.run(
+            [str(poetry_exe), "env", "info", "--path"],
+            cwd=str(script_dir),
+            env=venv_env,
+            check=False,  # Don't fail if poetry env info is not available
+            capture_output=True,
+            text=True,
+        )
+        if verify_result.returncode == 0:
+            current_path = str(Path(verify_result.stdout.strip()).resolve())
+            expected_path = str(Path(venv_dir.absolute()).resolve())
+            if current_path != expected_path:
+                print(
+                    f"ERROR: Poetry switched to different virtual environment: {current_path}"
+                )
+                print(f"Expected: {expected_path}")
+                sys.exit(1)
+        # If poetry env info fails, we can't verify, but continue anyway
+        # Poetry should still use the Python we specified via env use
+        return True
+
+    print("Running poetry lock...")
+    verify_poetry_env()  # Verify before lock
+    result = subprocess.run(
+        [str(poetry_exe), "lock"],
+        cwd=str(script_dir),
+        env=venv_env,
+        check=True,
+        capture_output=True,
+        text=True,
+    )
+    if result.stdout:
+        print(result.stdout)
+    if result.stderr:
+        print(result.stderr)
+    verify_poetry_env()  # Verify after lock
+
+    print("Running poetry install...")
+    verify_poetry_env()  # Verify before install
+    result = subprocess.run(
+        [str(poetry_exe), "install"],
+        cwd=str(script_dir),
+        env=venv_env,
+        check=True,
+        capture_output=True,
+        text=True,
+    )
+    if result.stdout:
+        print(result.stdout)
+    if result.stderr:
+        print(result.stderr)
+    verify_poetry_env()  # Verify after install
+
+    # Verify installation by checking if key packages are installed
+    # This is critical - if packages aren't installed, PyInstaller won't find them
+    print("Verifying package installation...")
+    test_packages = ["torch", "transformers", "tokenizers"]
+    missing_packages = []
+    for package in test_packages:
+        test_result = subprocess.run(
+            [str(venv_python), "-c", f"import {package}; print({package}.__version__)"],
+            capture_output=True,
+            text=True,
+            check=False,
+        )
+        if test_result.returncode == 0:
+            version = test_result.stdout.strip()
+            print(f"  ✓ {package} {version} installed")
+        else:
+            error_msg = (
+                test_result.stderr.strip() if test_result.stderr else "Unknown error"
+            )
+            print(f"  ✗ {package} NOT found in virtual environment: {error_msg}")
+            missing_packages.append(package)
+
+    if missing_packages:
+        print(
+            f"\nERROR: Required packages are missing from virtual environment: {', '.join(missing_packages)}"
+        )
+        print("This indicates that poetry did not install dependencies correctly.")
+        print("Please check the poetry install output above for errors.")
+        sys.exit(1)
+
+    print("Dependencies installed successfully")
+
+
+def check_pyinstaller(venv_python):
+    """
+    Check if PyInstaller is installed.
+
+    PyInstaller should be installed via poetry install from pyproject.toml.
+    If it's missing, it means poetry install failed or didn't complete.
+    """
+    try:
+        result = subprocess.run(
+            [
+                str(venv_python),
+                "-c",
+                "import PyInstaller; print(PyInstaller.__version__)",
+            ],
+            capture_output=True,
+            text=True,
+            check=True,
+        )
+        version = result.stdout.strip()
+        print(f"PyInstaller version: {version}")
+        return True
+    except (subprocess.CalledProcessError, FileNotFoundError):
+        print("ERROR: PyInstaller is not installed in the virtual environment")
+        print("PyInstaller should be installed via poetry install from pyproject.toml")
+        print(
+            "This indicates that poetry install may have failed or didn't complete correctly."
+        )
+        return False
+
+
+def build():
+    """
+    Execute the complete build process.
+
+    Steps:
+    1. Setup virtual environment (outside project directory)
+    2. Update pip and install 2.2.1 poetry
+    3. Install project dependencies (including PyInstaller from pyproject.toml)
+    4. Build executable using PyInstaller
+    """
+    script_dir = Path(__file__).parent
+
+    venv_dir = setup_venv()
+    venv_python = get_venv_python(venv_dir)
+
+    update_pip(venv_python)
+    install_poetry(venv_python)
+    install_dependencies(venv_python, venv_dir, script_dir)
+
+    if not check_pyinstaller(venv_python):
+        sys.exit(1)
+
+    print("=" * 50)
+    print("IoTDB AINode PyInstaller Build Script")
+    print("=" * 50)
+    print()
+
+    print("Starting build...")
+    print()
+
+    spec_file = script_dir / "ainode.spec"
+    if not spec_file.exists():
+        print(f"Error: Spec file not found: {spec_file}")
+        sys.exit(1)
+
+    # Set up environment for PyInstaller
+    # When using venv_python, PyInstaller should automatically detect the virtual environment
+    # and use its site-packages. We should NOT manually add site-packages to pathex.
+    pyinstaller_env = get_venv_env(venv_dir)
+
+    # Verify we're using the correct Python
+    python_prefix_result = subprocess.run(
+        [str(venv_python), "-c", "import sys; print(sys.prefix)"],
+        capture_output=True,
+        text=True,
+        check=True,
+    )
+    python_prefix = python_prefix_result.stdout.strip()
+    print(f"Using Python from: {python_prefix}")
+
+    # Ensure PyInstaller runs from the virtual environment
+    # The venv_python should automatically set up the correct environment
+    cmd = [
+        str(venv_python),
+        "-m",
+        "PyInstaller",
+        "--noconfirm",
+        str(spec_file),
+    ]
+
+    try:
+        subprocess.run(cmd, check=True, env=pyinstaller_env)
+    except subprocess.CalledProcessError as e:
+        print(f"\nError: Build failed: {e}")
+        sys.exit(1)
+
+    print()
+    print("=" * 50)
+    print("Build completed!")
+    print("=" * 50)
+    print()
+    print("Executable location: dist/ainode/ainode")
+    print()
+    print("Usage:")
+    print("  ./dist/ainode/ainode start   # Start AINode")
+    print()
+
+
+if __name__ == "__main__":
+    build()
diff --git a/iotdb-core/ainode/iotdb/ainode/core/config.py b/iotdb-core/ainode/iotdb/ainode/core/config.py
index 328f4a5faa6..afcf0683d7d 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/config.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/config.py
@@ -16,6 +16,7 @@
 # under the License.
 #
 import os
+import re
 
 from iotdb.ainode.core.constant import (
     AINODE_BUILD_INFO,
@@ -37,8 +38,6 @@ from iotdb.ainode.core.constant import (
     AINODE_INFERENCE_MODEL_MEM_USAGE_MAP,
     AINODE_LOG_DIR,
     AINODE_MODELS_DIR,
-    AINODE_ROOT_CONF_DIRECTORY_NAME,
-    AINODE_ROOT_DIR,
     AINODE_RPC_ADDRESS,
     AINODE_RPC_PORT,
     AINODE_SYSTEM_DIR,
@@ -315,9 +314,7 @@ class AINodeDescriptor(object):
             if "ainode_id" in system_configs:
                 self._config.set_ainode_id(int(system_configs["ainode_id"]))
 
-        git_file = os.path.join(
-            AINODE_ROOT_DIR, AINODE_ROOT_CONF_DIRECTORY_NAME, AINODE_CONF_GIT_FILE_NAME
-        )
+        git_file = os.path.join(AINODE_CONF_DIRECTORY_NAME, AINODE_CONF_GIT_FILE_NAME)
         if os.path.exists(git_file):
             git_configs = load_properties(git_file)
             if "git.commit.id.abbrev" in git_configs:
@@ -327,9 +324,7 @@ class AINodeDescriptor(object):
                         build_info += "-dev"
                 self._config.set_build_info(build_info)
 
-        pom_file = os.path.join(
-            AINODE_ROOT_DIR, AINODE_ROOT_CONF_DIRECTORY_NAME, AINODE_CONF_POM_FILE_NAME
-        )
+        pom_file = os.path.join(AINODE_CONF_DIRECTORY_NAME, AINODE_CONF_POM_FILE_NAME)
         if os.path.exists(pom_file):
             pom_configs = load_properties(pom_file)
             if "version" in pom_configs:
@@ -453,18 +448,29 @@ class AINodeDescriptor(object):
         return self._config
 
 
+def unescape_java_properties(value: str) -> str:
+    """Undo Java Properties escaping rules"""
+    value = value.replace("\\t", "\t")
+    value = value.replace("\\n", "\n")
+    value = value.replace("\\r", "\r")
+    value = value.replace("\\\\", "\\")
+    value = re.sub(r"\\([:=\s])", r"\1", value)
+    return value
+
+
 def load_properties(filepath, sep="=", comment_char="#"):
     """
     Read the file passed as parameter as a properties file.
     """
     props = {}
-    with open(filepath, "rt") as f:
+    with open(filepath, "rt", encoding="utf-8") as f:
         for line in f:
             l = line.strip()
             if l and not l.startswith(comment_char):
-                key_value = l.split(sep)
+                key_value = l.split(sep, 1)
                 key = key_value[0].strip()
-                value = sep.join(key_value[1:]).strip().strip('"')
+                value = key_value[1].strip().strip('"')
+                value = unescape_java_properties(value)
                 props[key] = value
     return props
 
diff --git a/iotdb-core/ainode/iotdb/ainode/core/constant.py b/iotdb-core/ainode/iotdb/ainode/core/constant.py
index f4547e99803..b9923d3e3ee 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/constant.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/constant.py
@@ -15,7 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-import inspect
 import logging
 import os
 from enum import Enum
@@ -24,10 +23,10 @@ from typing import List
 from iotdb.ainode.core.model.model_enums import BuiltInModelType
 from iotdb.thrift.common.ttypes import TEndPoint
 
+IOTDB_AINODE_HOME = os.getenv("IOTDB_AINODE_HOME", "")
 AINODE_VERSION_INFO = "UNKNOWN"
 AINODE_BUILD_INFO = "UNKNOWN"
-AINODE_CONF_DIRECTORY_NAME = "conf"
-AINODE_ROOT_CONF_DIRECTORY_NAME = "conf"
+AINODE_CONF_DIRECTORY_NAME = os.path.join(IOTDB_AINODE_HOME, "conf")
 AINODE_CONF_FILE_NAME = "iotdb-ainode.properties"
 AINODE_CONF_GIT_FILE_NAME = "git.properties"
 AINODE_CONF_POM_FILE_NAME = "pom.properties"
@@ -62,13 +61,12 @@ AINODE_INFERENCE_EXTRA_MEMORY_RATIO = (
 )
 
 # AINode folder structure
-AINODE_ROOT_DIR = os.path.dirname(
-    os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
-)
-AINODE_MODELS_DIR = "data/ainode/models"
-AINODE_BUILTIN_MODELS_DIR = "data/ainode/models/weights"  # For built-in models, we only need to store their weights and config.
-AINODE_SYSTEM_DIR = "data/ainode/system"
-AINODE_LOG_DIR = "logs"
+AINODE_MODELS_DIR = os.path.join(IOTDB_AINODE_HOME, "data/ainode/models")
+AINODE_BUILTIN_MODELS_DIR = os.path.join(
+    IOTDB_AINODE_HOME, "data/ainode/models/weights"
+)  # For built-in models, we only need to store their weights and config.
+AINODE_SYSTEM_DIR = os.path.join(IOTDB_AINODE_HOME, "data/ainode/system")
+AINODE_LOG_DIR = os.path.join(IOTDB_AINODE_HOME, "logs")
 
 # AINode log
 LOG_FILE_TYPE = ["all", "info", "warn", "error"]
diff --git a/iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py b/iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py
index 069a6b9ced6..00bb3b5568b 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py
@@ -50,7 +50,6 @@ from iotdb.ainode.core.util.decorator import synchronized
 from iotdb.ainode.core.util.thread_name import ThreadName
 
 logger = Logger()
-MODEL_MANAGER = ModelManager()
 
 
 class PoolController:
@@ -59,6 +58,7 @@ class PoolController:
     """
 
     def __init__(self, result_queue: mp.Queue):
+        self._model_manager = ModelManager()
         # structure: {model_id: {device_id: PoolGroup}}
         self._request_pool_map: Dict[str, Dict[str, PoolGroup]] = {}
         self._new_pool_id = AtomicInt()
@@ -82,24 +82,25 @@ class PoolController:
         """
         Initialize the pools when the first request for the given model_id arrives.
         """
-        if not self.has_request_pools(model_id, device.index):
-            # TODO: choose a device based on some strategy
-            device = self.DEFAULT_DEVICE
-            actions = self._pool_scheduler.schedule(model_id, device)
-            for action in actions:
-                if action.action == ScaleActionType.SCALE_UP:
-                    # initialize the first pool
-                    self._first_pool_init(action.model_id, str(device))
-                    # start a background thread to expand pools
-                    expand_thread = threading.Thread(
-                        target=self._expand_pools_on_device,
-                        args=(action.model_id, str(device), action.amount - 1),
-                        daemon=True,
-                    )
-                    expand_thread.start()
-                elif action.action == ScaleActionType.SCALE_DOWN:
-                    # TODO: implement scale down logic
-                    pass
+        pass
+        # if not self.has_request_pools(model_id, device.index):
+        #     # TODO: choose a device based on some strategy
+        #     device = self.DEFAULT_DEVICE
+        #     actions = self._pool_scheduler.schedule(model_id, device)
+        #     for action in actions:
+        #         if action.action == ScaleActionType.SCALE_UP:
+        #             # initialize the first pool
+        #             self._first_pool_init(action.model_id, str(device))
+        #             # start a background thread to expand pools
+        #             expand_thread = threading.Thread(
+        #                 target=self._expand_pools_on_device,
+        #                 args=(action.model_id, str(device), action.amount - 1),
+        #                 daemon=True,
+        #             )
+        #             expand_thread.start()
+        #         elif action.action == ScaleActionType.SCALE_DOWN:
+        #             # TODO: implement scale down logic
+        #             pass
 
     def _first_pool_init(self, model_id: str, device_str: str):
         """
@@ -194,7 +195,7 @@ class PoolController:
         def _load_model_on_device_task(device_id: str):
             if not self.has_request_pools(model_id, device_id):
                 actions = self._pool_scheduler.schedule_load_model_to_device(
-                    MODEL_MANAGER.get_model_info(model_id), device_id
+                    self._model_manager.get_model_info(model_id), device_id
                 )
                 for action in actions:
                     if action.action == ScaleActionType.SCALE_UP:
@@ -221,7 +222,7 @@ class PoolController:
         def _unload_model_on_device_task(device_id: str):
             if self.has_request_pools(model_id, device_id):
                 actions = self._pool_scheduler.schedule_unload_model_from_device(
-                    MODEL_MANAGER.get_model_info(model_id), device_id
+                    self._model_manager.get_model_info(model_id), device_id
                 )
                 for action in actions:
                     if action.action == ScaleActionType.SCALE_DOWN:
@@ -256,7 +257,7 @@ class PoolController:
         def _expand_pool_on_device(*_):
             result_queue = mp.Queue()
             pool_id = self._new_pool_id.get_and_increment()
-            model_info = MODEL_MANAGER.get_model_info(model_id)
+            model_info = self._model_manager.get_model_info(model_id)
             model_type = model_info.model_type
             if model_type == BuiltInModelType.SUNDIAL.value:
                 config = SundialConfig()
@@ -277,7 +278,7 @@ class PoolController:
             )
             pool.start()
             self._register_pool(model_id, device_id, pool_id, pool, result_queue)
-            if not pool.ready_event.wait(timeout=30):
+            if not pool.ready_event.wait(timeout=300):
                 logger.error(
                     f"[Inference][Device-{device_id}][Pool-{pool_id}] Pool failed to be ready in time"
                 )
diff --git a/iotdb-core/ainode/iotdb/ainode/core/inference/pool_scheduler/basic_pool_scheduler.py b/iotdb-core/ainode/iotdb/ainode/core/inference/pool_scheduler/basic_pool_scheduler.py
index 5ee1b4f0c9a..6a2bd2b619a 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/inference/pool_scheduler/basic_pool_scheduler.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/inference/pool_scheduler/basic_pool_scheduler.py
@@ -41,8 +41,6 @@ from iotdb.ainode.core.util.gpu_mapping import convert_device_id_to_torch_device
 
 logger = Logger()
 
-MODEL_MANAGER = ModelManager()
-
 
 def _estimate_shared_pool_size_by_total_mem(
     device: torch.device,
@@ -106,6 +104,7 @@ class BasicPoolScheduler(AbstractPoolScheduler):
 
     def __init__(self, request_pool_map: Dict[str, Dict[str, PoolGroup]]):
         super().__init__(request_pool_map)
+        self._model_manager = ModelManager()
 
     def schedule(self, model_id: str) -> List[ScaleAction]:
         """
@@ -123,7 +122,7 @@ class BasicPoolScheduler(AbstractPoolScheduler):
         self, model_info: ModelInfo, device_id: str
     ) -> List[ScaleAction]:
         existing_model_infos = [
-            MODEL_MANAGER.get_model_info(existing_model_id)
+            self._model_manager.get_model_info(existing_model_id)
             for existing_model_id, pool_group_map in self._request_pool_map.items()
             if existing_model_id != model_info.model_id and device_id in pool_group_map
         ]
@@ -140,7 +139,7 @@ class BasicPoolScheduler(AbstractPoolScheduler):
         self, model_info: ModelInfo, device_id: str
     ) -> List[ScaleAction]:
         existing_model_infos = [
-            MODEL_MANAGER.get_model_info(existing_model_id)
+            self._model_manager.get_model_info(existing_model_id)
             for existing_model_id, pool_group_map in self._request_pool_map.items()
             if existing_model_id != model_info.model_id and device_id in pool_group_map
         ]
diff --git a/iotdb-core/ainode/iotdb/ainode/core/log.py b/iotdb-core/ainode/iotdb/ainode/core/log.py
index a7a05d0ea92..fd121b26349 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/log.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/log.py
@@ -116,7 +116,9 @@ class BaseLogger:
             file_handler.setFormatter(self.logger_format)
             self.logger.addHandler(file_handler)
 
-        self.info(f"Logger init successfully.")
+        self.info(
+            f"Logger init successfully, log file prefix name {log_file_name_prefix}."
+        )
 
     # interfaces
     def debug(self, *msg):
diff --git a/iotdb-core/ainode/iotdb/ainode/core/script.py b/iotdb-core/ainode/iotdb/ainode/core/script.py
index 82ed32bc5a2..38653d7ceab 100644
--- a/iotdb-core/ainode/iotdb/ainode/core/script.py
+++ b/iotdb-core/ainode/iotdb/ainode/core/script.py
@@ -15,68 +15,27 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-import os
-import shutil
+import multiprocessing
 import sys
 
 import torch.multiprocessing as mp
 
 from iotdb.ainode.core.ai_node import AINode
-from iotdb.ainode.core.config import AINodeDescriptor
-from iotdb.ainode.core.constant import TSStatusCode
-from iotdb.ainode.core.exception import MissingConfigError
 from iotdb.ainode.core.log import Logger
-from iotdb.ainode.core.rpc.client import ClientManager
-from iotdb.thrift.common.ttypes import TAINodeLocation, TEndPoint
 
 logger = Logger()
 
 
-def remove_ainode(arguments):
-    # Delete the current node
-    if len(arguments) == 2:
-        target_ainode_id = AINodeDescriptor().get_config().get_ainode_id()
-        target_rpc_address = AINodeDescriptor().get_config().get_ain_rpc_address()
-        target_rpc_port = AINodeDescriptor().get_config().get_ain_rpc_port()
-
-    # Delete the node with a given id
-    elif len(arguments) == 3:
-        target_ainode_id = int(arguments[2])
-        ainode_configuration_map = (
-            ClientManager()
-            .borrow_config_node_client()
-            .get_ainode_configuration(target_ainode_id)
-        )
-
-        end_point = ainode_configuration_map[target_ainode_id].location.internalEndPoint
-        target_rpc_address = end_point.ip
-        target_rpc_port = end_point.port
-
-        if not end_point:
-            raise MissingConfigError(
-                "NodeId: {} not found in cluster ".format(target_ainode_id)
-            )
-
-        logger.info("Got target AINode id: {}".format(target_ainode_id))
-
-    else:
-        raise MissingConfigError("Invalid command")
-
-    location = TAINodeLocation(
-        target_ainode_id, TEndPoint(target_rpc_address, target_rpc_port)
-    )
-    status = ClientManager().borrow_config_node_client().node_remove(location)
-
-    if status.code == TSStatusCode.SUCCESS_STATUS.get_status_code():
-        logger.info("IoTDB-AINode has successfully removed.")
-        if os.path.exists(AINodeDescriptor().get_config().get_ain_models_dir()):
-            shutil.rmtree(AINodeDescriptor().get_config().get_ain_models_dir())
-
-
 def main():
+    # Handle PyInstaller: filter out Python arguments that might be passed to subprocesses
+    # These arguments are not needed in frozen executables and cause warnings
+    # Note: This filtering should happen AFTER freeze_support() has handled child processes
+    if getattr(sys, "frozen", False):
+        python_args_to_filter = ["-I", "-B", "-S", "-E", "-O", "-OO"]
+        sys.argv = [arg for arg in sys.argv if arg not in python_args_to_filter]
+
+    logger.info(f"Starting IoTDB-AINode process with sys argv {sys.argv}.")
     arguments = sys.argv
-    # load config
-    AINodeDescriptor()
     if len(arguments) == 1:
         logger.info("Command line argument must be specified.")
         return
@@ -89,19 +48,22 @@ def main():
             ai_node = AINode()
             ai_node.start()
         except Exception as e:
-            logger.error("Start AINode failed, because of: {}".format(e))
-            sys.exit(1)
-    # TODO: remove the following function, and add a destroy script
-    elif command == "remove":
-        try:
-            logger.info("Removing AINode...")
-            remove_ainode(arguments)
-        except Exception as e:
-            logger.error("Remove AINode failed, because of: {}".format(e))
+            logger.warning("Start AINode failed, because of: {}".format(e))
             sys.exit(1)
     else:
         logger.warning("Unknown argument: {}.".format(command))
 
 
 if __name__ == "__main__":
+    # PyInstaller multiprocessing support
+    # freeze_support() is essential for PyInstaller frozen executables on all platforms
+    # It detects if the current process is a multiprocessing child process
+    # If it is, it executes the child process target function and exits
+    # If it's not, it returns immediately and continues with main() execution
+    # This prevents child processes from executing the main application logic
+    if getattr(sys, "frozen", False):
+        # Call freeze_support() for both standard multiprocessing and torch.multiprocessing
+        multiprocessing.freeze_support()
+        mp.freeze_support()
+
     main()
diff --git a/iotdb-core/ainode/poetry.lock b/iotdb-core/ainode/poetry.lock
index 7a22506d06f..a2d8ce581f1 100644
--- a/iotdb-core/ainode/poetry.lock
+++ b/iotdb-core/ainode/poetry.lock
@@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry 2.1.4 and should not be changed by hand.
+# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand.
 
 [[package]]
 name = "alembic"
@@ -20,6 +20,18 @@ typing-extensions = ">=4.12"
 [package.extras]
 tz = ["tzdata"]
 
+[[package]]
+name = "altgraph"
+version = "0.17.4"
+description = "Python graph (network) package"
+optional = false
+python-versions = "*"
+groups = ["main"]
+files = [
+    {file = "altgraph-0.17.4-py2.py3-none-any.whl", hash = "sha256:642743b4750de17e655e6711601b077bc6598dbfa3ba5fa2b2a35ce12b508dff"},
+    {file = "altgraph-0.17.4.tar.gz", hash = "sha256:1b5afbb98f6c4dcadb2e2ae6ab9fa994bbb8c1d75f4fa96d340f9437ae454406"},
+]
+
 [[package]]
 name = "black"
 version = "25.1.0"
@@ -510,6 +522,22 @@ cli = ["jsonargparse[signatures] (>=4.38.0)", "tomlkit"]
 docs = ["requests (>=2.0.0)"]
 typing = ["mypy (>=1.0.0)", "types-setuptools"]
 
+[[package]]
+name = "macholib"
+version = "1.16.3"
+description = "Mach-O header analysis and editing"
+optional = false
+python-versions = "*"
+groups = ["main"]
+markers = "sys_platform == \"darwin\""
+files = [
+    {file = "macholib-1.16.3-py2.py3-none-any.whl", hash = "sha256:0e315d7583d38b8c77e815b1ecbdbf504a8258d8b3e17b61165c6feb60d18f2c"},
+    {file = "macholib-1.16.3.tar.gz", hash = "sha256:07ae9e15e8e4cd9a788013d81f5908b3609aa76f9b1421bae9c4d7606ec86a30"},
+]
+
+[package.dependencies]
+altgraph = ">=0.17"
+
 [[package]]
 name = "mako"
 version = "1.3.10"
@@ -1141,6 +1169,19 @@ numpy = ">=1.4"
 [package.extras]
 test = ["pytest", "pytest-cov", "scipy"]
 
+[[package]]
+name = "pefile"
+version = "2023.2.7"
+description = "Python PE parsing module"
+optional = false
+python-versions = ">=3.6.0"
+groups = ["main"]
+markers = "sys_platform == \"win32\""
+files = [
+    {file = "pefile-2023.2.7-py3-none-any.whl", hash = "sha256:da185cd2af68c08a6cd4481f7325ed600a88f6a813bad9dea07ab3ef73d8d8d6"},
+    {file = "pefile-2023.2.7.tar.gz", hash = "sha256:82e6114004b3d6911c77c3953e3838654b04511b8b66e8583db70c65998017dc"},
+]
+
 [[package]]
 name = "platformdirs"
 version = "4.4.0"
@@ -1181,6 +1222,57 @@ files = [
 dev = ["abi3audit", "black", "check-manifest", "coverage", "packaging", "pylint", "pyperf", "pypinfo", "pyreadline ; os_name == \"nt\"", "pytest", "pytest-cov", "pytest-instafail", "pytest-subtests", "pytest-xdist", "pywin32 ; os_name == \"nt\" and platform_python_implementation != \"PyPy\"", "requests", "rstcheck", "ruff", "setuptools", "sphinx", "sphinx_rtd_theme", "toml-sort", "twine", "virtualenv", "vulture", "wheel", "wheel ; os_name == \"nt\" and platform_python_implementation != \ [...]
 test = ["pytest", "pytest-instafail", "pytest-subtests", "pytest-xdist", "pywin32 ; os_name == \"nt\" and platform_python_implementation != \"PyPy\"", "setuptools", "wheel ; os_name == \"nt\" and platform_python_implementation != \"PyPy\"", "wmi ; os_name == \"nt\" and platform_python_implementation != \"PyPy\""]
 
+[[package]]
+name = "pyinstaller"
+version = "6.16.0"
+description = "PyInstaller bundles a Python application and all its dependencies into a single package."
+optional = false
+python-versions = "<3.15,>=3.8"
+groups = ["main"]
+files = [
+    {file = "pyinstaller-6.16.0-py3-none-macosx_10_13_universal2.whl", hash = "sha256:7fd1c785219a87ca747c21fa92f561b0d2926a7edc06d0a0fe37f3736e00bd7a"},
+    {file = "pyinstaller-6.16.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:b756ddb9007b8141c5476b553351f9d97559b8af5d07f9460869bfae02be26b0"},
+    {file = "pyinstaller-6.16.0-py3-none-manylinux2014_i686.whl", hash = "sha256:0a48f55b85ff60f83169e10050f2759019cf1d06773ad1c4da3a411cd8751058"},
+    {file = "pyinstaller-6.16.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:73ba72e04fcece92e32518bbb1e1fb5ac2892677943dfdff38e01a06e8742851"},
+    {file = "pyinstaller-6.16.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:b1752488248f7899281b17ca3238eefb5410521291371a686a4f5830f29f52b3"},
+    {file = "pyinstaller-6.16.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:ba618a61627ee674d6d68e5de084ba17c707b59a4f2a856084b3999bdffbd3f0"},
+    {file = "pyinstaller-6.16.0-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:c8b7ef536711617e12fef4673806198872033fa06fa92326ad7fd1d84a9fa454"},
+    {file = "pyinstaller-6.16.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:d1ebf84d02c51fed19b82a8abb4df536923abd55bb684d694e1356e4ae2a0ce5"},
+    {file = "pyinstaller-6.16.0-py3-none-win32.whl", hash = "sha256:6d5f8617f3650ff9ef893e2ab4ddbf3c0d23d0c602ef74b5df8fbef4607840c8"},
+    {file = "pyinstaller-6.16.0-py3-none-win_amd64.whl", hash = "sha256:bc10eb1a787f99fea613509f55b902fbd2d8b73ff5f51ff245ea29a481d97d41"},
+    {file = "pyinstaller-6.16.0-py3-none-win_arm64.whl", hash = "sha256:d0af8a401de792c233c32c44b16d065ca9ab8262ee0c906835c12bdebc992a64"},
+    {file = "pyinstaller-6.16.0.tar.gz", hash = "sha256:53559fe1e041a234f2b4dcc3288ea8bdd57f7cad8a6644e422c27bb407f3edef"},
+]
+
+[package.dependencies]
+altgraph = "*"
+macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""}
+packaging = ">=22.0"
+pefile = {version = ">=2022.5.30,<2024.8.26 || >2024.8.26", markers = "sys_platform == \"win32\""}
+pyinstaller-hooks-contrib = ">=2025.8"
+pywin32-ctypes = {version = ">=0.2.1", markers = "sys_platform == \"win32\""}
+setuptools = ">=42.0.0"
+
+[package.extras]
+completion = ["argcomplete"]
+hook-testing = ["execnet (>=1.5.0)", "psutil", "pytest (>=2.7.3)"]
+
+[[package]]
+name = "pyinstaller-hooks-contrib"
+version = "2025.9"
+description = "Community maintained hooks for PyInstaller"
+optional = false
+python-versions = ">=3.8"
+groups = ["main"]
+files = [
+    {file = "pyinstaller_hooks_contrib-2025.9-py3-none-any.whl", hash = "sha256:ccbfaa49399ef6b18486a165810155e5a8d4c59b41f20dc5da81af7482aaf038"},
+    {file = "pyinstaller_hooks_contrib-2025.9.tar.gz", hash = "sha256:56e972bdaad4e9af767ed47d132362d162112260cbe488c9da7fee01f228a5a6"},
+]
+
+[package.dependencies]
+packaging = ">=22.0"
+setuptools = ">=42.0.0"
+
 [[package]]
 name = "python-dateutil"
 version = "2.9.0.post0"
@@ -1208,6 +1300,19 @@ files = [
     {file = "pytz-2025.2.tar.gz", hash = "sha256:360b9e3dbb49a209c21ad61809c7fb453643e048b38924c765813546746e81c3"},
 ]
 
+[[package]]
+name = "pywin32-ctypes"
+version = "0.2.3"
+description = "A (partial) reimplementation of pywin32 using ctypes/cffi"
+optional = false
+python-versions = ">=3.6"
+groups = ["main"]
+markers = "sys_platform == \"win32\""
+files = [
+    {file = "pywin32-ctypes-0.2.3.tar.gz", hash = "sha256:d162dc04946d704503b2edc4d55f3dba5c1d539ead017afa00142c38b9885755"},
+    {file = "pywin32_ctypes-0.2.3-py3-none-any.whl", hash = "sha256:8a1513379d709975552d202d942d9837758905c8d01eb82b8bcc30918929e7b8"},
+]
+
 [[package]]
 name = "pyyaml"
 version = "6.0.3"
@@ -2222,5 +2327,5 @@ zstd = ["zstandard (>=0.18.0)"]
 
 [metadata]
 lock-version = "2.1"
-python-versions = ">=3.11,<=3.13.5"
-content-hash = "08746b5f45ee9836e2d4368f8e394d55d27f556789fb1254e7584b9eedd49d5b"
+python-versions = ">=3.11.0,<3.14.0"
+content-hash = "37441b66c5cf440280823bb97248fa10b0ca20d7fef4d20aec616e3860a31736"
diff --git a/iotdb-core/ainode/pom.xml b/iotdb-core/ainode/pom.xml
index 63c8f2e3f55..1a3be76b633 100644
--- a/iotdb-core/ainode/pom.xml
+++ b/iotdb-core/ainode/pom.xml
@@ -87,9 +87,6 @@
                         <fileset>
                             <directory>target</directory>
                         </fileset>
-                        <fileset>
-                            <directory>venv</directory>
-                        </fileset>
                     </filesets>
                 </configuration>
             </plugin>
@@ -142,6 +139,9 @@
                     <encoding>${project.build.sourceEncoding}</encoding>
                 </configuration>
                 <executions>
+                    <!--
+                        Copy the python api of IoTDB from iotdb-client.
+                    -->
                     <execution>
                         <id>copy-python-dependencies</id>
                         <phase>generate-sources</phase>
@@ -212,55 +212,6 @@
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>exec-maven-plugin</artifactId>
                 <executions>
-                    <!-- Prepare a local installation of python -->
-                    <execution>
-                        <id>python-venv</id>
-                        <phase>initialize</phase>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                        <configuration>
-                            <executable>${python.exe.bin}</executable>
-                            <arguments>
-                                <argument>-m</argument>
-                                <argument>venv</argument>
-                                <argument>./venv</argument>
-                            </arguments>
-                        </configuration>
-                    </execution>
-                    <!-- Update pip in our local working environment -->
-                    <execution>
-                        <id>python-upgrade-pip</id>
-                        <phase>initialize</phase>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                        <configuration>
-                            <executable>${python.venv.bin}${python.exe.bin}</executable>
-                            <arguments>
-                                <argument>-m</argument>
-                                <argument>pip</argument>
-                                <argument>install</argument>
-                                <argument>--upgrade</argument>
-                                <argument>pip</argument>
-                            </arguments>
-                        </configuration>
-                    </execution>
-                    <!-- Install poetry in our local working environment -->
-                    <execution>
-                        <id>python-install-poetry</id>
-                        <phase>initialize</phase>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                        <configuration>
-                            <executable>${python.venv.bin}pip3</executable>
-                            <arguments>
-                                <argument>install</argument>
-                                <argument>poetry</argument>
-                            </arguments>
-                        </configuration>
-                    </execution>
                     <execution>
                         <id>python-compile</id>
                         <phase>compile</phase>
@@ -268,44 +219,13 @@
                             <goal>exec</goal>
                         </goals>
                         <configuration>
-                            <executable>${python.venv.bin}poetry</executable>
+                            <executable>${python.exe.bin}</executable>
+                            <workingDirectory>${project.basedir}</workingDirectory>
                             <arguments>
-                                <argument>build</argument>
+                                <argument>build_binary.py</argument>
                             </arguments>
                         </configuration>
                     </execution>
-                    <!--execution>
-                        <id>python-test</id>
-                        <phase>test</phase>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                        <configuration>
-                            <executable>${python.venv.bin}${python.exe.bin}</executable>
-                            <arguments>
-                                <argument>-m</argument>
-                                <argument>pytest</argument>
-                                <argument>tests</argument>
-                            </arguments>
-                        </configuration>
-                    </execution-->
-                    <!--execution>
-                        <id>python-package</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                        <configuration>
-                            <executable>${python.venv.bin}pip3</executable>
-                            <arguments>
-                                <argument>wheel</argument>
-                                <argument>.</argument>
-                                <argument>-w</argument>
-                                <argument>dist</argument>
-                                <argument>- -no-deps</argument>
-                            </arguments>
-                        </configuration>
-                    </execution-->
                 </executions>
             </plugin>
             <plugin>
diff --git a/iotdb-core/ainode/pyproject.toml b/iotdb-core/ainode/pyproject.toml
index 634f3e09a74..331cb8ab32a 100644
--- a/iotdb-core/ainode/pyproject.toml
+++ b/iotdb-core/ainode/pyproject.toml
@@ -76,24 +76,7 @@ exclude = [
 ]
 
 [tool.poetry.dependencies]
-python = ">=3.11,<=3.13.5"
-
-# Core scientific stack
-numpy = [
-    { version = "^2.3.2", python = ">=3.10" },
-    { version = "^1.26.4", python = ">=3.9,<3.10" }
-]
-scipy = [
-    { version = "^1.12.0", python = ">=3.10" },
-    { version = "^1.11.4", python = ">=3.9,<3.10" }
-]
-pandas = "^2.3.2"
-scikit-learn = [
-    { version = "^1.7.1", python = ">=3.10" },
-    { version = "^1.5.2", python = ">=3.9,<3.10" }
-]
-statsmodels = "^0.14.5"
-sktime = "0.38.5"
+python = ">=3.11.0,<3.14.0"
 
 # ---- DL / HF stack ----
 torch = ">=2.7.0"
@@ -104,6 +87,14 @@ huggingface_hub = "^0.34.4"
 safetensors = "^0.6.2"
 einops = "^0.8.1"
 
+# ---- Core scientific stack ----
+numpy = "^2.3.2"
+scipy = "^1.12.0"
+pandas = "^2.3.2"
+scikit-learn = "^1.7.1"
+statsmodels = "^0.14.5"
+sktime = "0.38.5"
+
 # ---- Optimizers / utils ----
 optuna = "^4.4.0"
 psutil = "^7.0.0"
@@ -116,6 +107,7 @@ tzlocal = "^5.3.1"
 hf_xet = ">=1.1.9"
 
 # ---- Tooling ----
+pyinstaller = "6.16.0"
 black = "25.1.0"
 isort = "6.0.1"
 setuptools = ">=75.3.0"
@@ -127,3 +119,4 @@ ainode = "iotdb.ainode.core.script:main"
 
 [tool.isort]
 profile = "black"
+skip = ["build", "dist", "target"]
\ No newline at end of file
diff --git a/iotdb-core/ainode/resources/syncPythonVersion.groovy b/iotdb-core/ainode/resources/syncPythonVersion.groovy
index 0061930bfca..ecd0f2bdf21 100644
--- a/iotdb-core/ainode/resources/syncPythonVersion.groovy
+++ b/iotdb-core/ainode/resources/syncPythonVersion.groovy
@@ -120,41 +120,8 @@ def checkPython() {
     }
 }
 
-
-// On Ubuntu it seems that venv is generally available, but the 'ensurepip' command fails.
-// In this case we need to install the python3-venv package. Unfortunately checking the
-// venv is successful in this case, so we need this slightly odd test.
-def checkPythonVenv() {
-    print "Detecting venv:            "
-    try {
-        def python = project.properties['python.exe.bin']
-        def cmdArray = [python, "-Im", "ensurepip"]
-        def process = cmdArray.execute()
-        def stdOut = new StringBuilder()
-        def stdErr = new StringBuilder()
-        process.waitForProcessOutput(stdOut, stdErr)
-        if (stdErr.contains("No module named")) {
-            println "missing"
-            println "--- output of version `python -Im \"ensurepip\"` command ---"
-            println output
-            println "------------------------------------------------------------"
-            allConditionsMet = false
-        } else {
-            println "               OK"
-        }
-    } catch (Exception e) {
-        println "missing"
-        println "--- failed with exception ---"
-        println e
-        e.printStackTrace()
-        println "----------------------------------------------------"
-        allConditionsMet = false
-    }
-}
-
 // Check the python environment is setup correctly.
 checkPython()
-checkPythonVenv()
 
 if (!allConditionsMet) {
     throw new RuntimeException("Not all conditions met, see log for details.")
diff --git a/scripts/conf/ainode-env.sh b/scripts/conf/ainode-env.sh
deleted file mode 100644
index 1ec434ad2d9..00000000000
--- a/scripts/conf/ainode-env.sh
+++ /dev/null
@@ -1,138 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# The defaulte venv environment is used if ain_interpreter_dir is not set. Please use absolute path without quotation mark
-# ain_interpreter_dir=
-
-# Set ain_force_reinstall to 1 to force reinstall AINode
-ain_force_reinstall=0
-
-# don't install dependencies online
-ain_install_offline=0
-
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
-
-# fetch parameters with names
-while getopts "i:t:rnm:" opt; do
-  case $opt in
-  i)
-    p_ain_interpreter_dir="$OPTARG"
-    ;;
-  r)
-    p_ain_force_reinstall=1
-    ;;
-  t) ;;
-  n)
-    p_ain_no_dependencies="--no-dependencies"
-    ;;
-  m)
-    p_pypi_mirror="$OPTARG"
-    ;;
-  \?)
-    echo "Invalid option -$OPTARG" >&2
-    exit 1
-    ;;
-  esac
-done
-
-if [ -z "$p_ain_interpreter_dir" ]; then
-  echo "No interpreter_dir is set, use default value."
-else
-  ain_interpreter_dir="$p_ain_interpreter_dir"
-fi
-
-if [ -z "$p_ain_force_reinstall" ]; then
-  echo "No check_version is set, use default value."
-else
-  ain_force_reinstall="$p_ain_force_reinstall"
-fi
-echo Script got inputs: "ain_interpreter_dir: $ain_interpreter_dir", "ain_force_reinstall: $ain_force_reinstall"
-
-if [ -z $ain_interpreter_dir ]; then
-  $(dirname "$0")/../venv/bin/python3 -c "import sys; print(sys.executable)" &&
-    echo "Activate default venv environment" || (
-    echo "Creating default venv environment" && python3 -m venv "$(dirname "$0")/../venv"
-  )
-  ain_interpreter_dir="$SCRIPT_DIR/../venv/bin/python3"
-fi
-echo "Calling venv to check: $ain_interpreter_dir"
-
-# Change the working directory to the parent directory
-cd "$SCRIPT_DIR/.."
-
-echo "Confirming AINode..."
-$ain_interpreter_dir -m pip config set global.disable-pip-version-check true
-$ain_interpreter_dir -m pip list | grep "apache-iotdb-ainode" >/dev/null
-if [ $? -eq 0 ]; then
-  if [ $ain_force_reinstall -eq 0 ]; then
-    echo "AINode is already installed"
-    exit 0
-  fi
-fi
-
-ain_only_ainode=1
-
-# if $ain_install_offline is 1 then do not install dependencies
-if [ $ain_install_offline -eq 1 ]; then
-  # if offline and not -n, then install dependencies
-  if [ -z "$p_ain_no_dependencies" ]; then
-    ain_only_ainode=0
-  else
-    ain_only_ainode=1
-  fi
-  p_ain_no_dependencies="--no-dependencies"
-  echo "Installing AINode offline----without dependencies..."
-fi
-
-if [ $ain_force_reinstall -eq 1 ]; then
-  p_ain_force_reinstall="--force-reinstall"
-else
-  p_ain_force_reinstall=""
-fi
-
-echo "Installing AINode..."
-cd "$SCRIPT_DIR/../lib/"
-shopt -s nullglob
-for i in *.whl; do
-  if [[ $i =~ "ainode" ]]; then
-    echo Installing AINode body: $i
-    if [ -z "$p_pypi_mirror" ]; then
-      $ain_interpreter_dir -m pip install "$i" $p_ain_force_reinstall --no-warn-script-location $p_ain_no_dependencies --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
-    else
-      $ain_interpreter_dir -m pip install "$i" $p_ain_force_reinstall -i $p_pypi_mirror --no-warn-script-location $p_ain_no_dependencies --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
-    fi
-  else
-    # if ain_only_ainode is 0 then install dependencies
-    if [ $ain_only_ainode -eq 0 ]; then
-      echo Installing dependencies $i
-      if [ -z "$p_pypi_mirror" ]; then
-        $ain_interpreter_dir -m pip install "$i" $p_ain_force_reinstall --no-warn-script-location $p_ain_no_dependencies
-      else
-        $ain_interpreter_dir -m pip install "$i" $p_ain_force_reinstall -i $p_pypi_mirror --no-warn-script-location $p_ain_no_dependencies
-      fi
-    fi
-  fi
-  if [ $? -eq 1 ]; then
-    echo "Failed to install AINode"
-    exit 1
-  fi
-done
-echo "AINode is installed successfully"
-exit 0
diff --git a/scripts/conf/windows/ainode-env.bat b/scripts/conf/windows/ainode-env.bat
deleted file mode 100644
index 2c01d411a2c..00000000000
--- a/scripts/conf/windows/ainode-env.bat
+++ /dev/null
@@ -1,129 +0,0 @@
-@REM
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements.  See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership.  The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License.  You may obtain a copy of the License at
-@REM
-@REM     http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied.  See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM
-
-@echo off
-
-@REM The defaulte venv environment is used if ain_interpreter_dir is not set. Please use absolute path without quotation mark
-@REM set ain_interpreter_dir=
-
-@REM Set ain_force_reinstall to 1 to force reinstall ainode
-set ain_force_reinstall=0
-
-@REM don't install dependencies online
-set ain_install_offline=0
-
-pushd %~dp0..\..
-if NOT DEFINED IOTDB_AINODE_HOME set IOTDB_AINODE_HOME=%cd%
-
-:initial
-if "%1"=="" goto done
-set aux=%1
-if "%aux:~0,2%"=="-r" (
-    set ain_force_reinstall=1
-    shift
-    goto initial
-)
-if "%aux:~0,2%"=="-n" (
-    set ain_no_dependencies=--no-dependencies
-    shift
-    goto initial
-)
-if "%aux:~0,1%"=="-" (
-   set nome=%aux:~1,250%
-) else (
-   set "%nome%=%1"
-   set nome=
-)
-shift
-goto initial
-
-:done
-@REM check if the parameters are set
-if "%i%"=="" (
-    echo No interpreter_dir is set, use default value.
-) else (
-    set ain_interpreter_dir=%i%
-)
-
-echo Script got inputs: ain_interpreter_dir: %ain_interpreter_dir% , ain_force_reinstall: %ain_force_reinstall%
-if "%ain_interpreter_dir%"=="" (
-    %IOTDB_AINODE_HOME%//venv//Scripts//python.exe -c "import sys; print(sys.executable)" && (
-        echo Activate default venv environment
-    ) || (
-        echo Creating default venv environment
-        python -m venv "%IOTDB_AINODE_HOME%//venv"
-    )
-    set ain_interpreter_dir="%IOTDB_AINODE_HOME%//venv//Scripts//python.exe"
-)
-
-@REM Switch the working directory to the directory one level above the script
-cd %IOTDB_AINODE_HOME%
-
-echo Confirming ainode
-%ain_interpreter_dir% -m pip config set global.disable-pip-version-check true
-%ain_interpreter_dir% -m pip list | findstr /C:"apache-iotdb-ainode" >nul
-if %errorlevel% == 0 (
-    if %ain_force_reinstall% == 0 (
-        echo ainode is already installed
-        exit /b 0
-    )
-)
-
-set ain_only_ainode=1
-@REM if $ain_install_offline is 1 then do not install dependencies
-if %ain_install_offline% == 1 (
-    @REM if offline and not -n, then install dependencies
-    if "%ain_no_dependencies%"=="" (
-        set ain_only_ainode=0
-    ) else (
-        set ain_only_ainode=1
-    )
-    set ain_no_dependencies=--no-dependencies
-    echo Installing ainode offline----without dependencies...
-)
-
-if %ain_force_reinstall% == 1 (
-    set ain_force_reinstall=--force-reinstall
-) else (
-    set ain_force_reinstall=
-)
-
-echo Installing ainode...
-@REM Print current work dir
-cd lib
-for %%i in (*.whl *.tar.gz) do (
-    echo %%i | findstr "ainode" >nul && (
-        echo Installing ainode body: %%i
-        %ain_interpreter_dir% -m pip install %%i %ain_force_reinstall% --no-warn-script-location %ain_no_dependencies% --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
-    ) || (
-        @REM if ain_only_ainode is 0 then install dependencies
-        if %ain_only_ainode% == 0 (
-            echo Installing dependencies: %%i
-            set ain_force_reinstall=--force-reinstall
-            %ain_interpreter_dir% -m pip install %%i %ain_force_reinstall% --no-warn-script-location %ain_no_dependencies% --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
-        )
-    )
-    if %errorlevel% == 1 (
-        echo Failed to install ainode
-        exit /b 1
-    )
-)
-echo ainode is installed successfully
-cd ..
-exit /b 0
diff --git a/scripts/sbin/start-ainode.sh b/scripts/sbin/start-ainode.sh
index 4ab202a209e..671de54ba1a 100644
--- a/scripts/sbin/start-ainode.sh
+++ b/scripts/sbin/start-ainode.sh
@@ -23,24 +23,12 @@ echo Starting IoTDB AINode
 echo ---------------------------
 
 IOTDB_AINODE_HOME="$(cd "`dirname "$0"`"/..; pwd)"
-
+export IOTDB_AINODE_HOME
 echo "IOTDB_AINODE_HOME: $IOTDB_AINODE_HOME"
-chmod u+x $IOTDB_AINODE_HOME/conf/ainode-env.sh
-ain_interpreter_dir=$(sed -n 's/^ain_interpreter_dir=\(.*\)$/\1/p' $IOTDB_AINODE_HOME/conf/ainode-env.sh)
-bash $IOTDB_AINODE_HOME/conf/ainode-env.sh $*
-if [ $? -eq 1 ]; then
-  echo "Environment check failed. Exiting..."
-  exit 1
-fi
-
 
 # fetch parameters with names
 while getopts "i:rn" opt; do
   case $opt in
-    i) p_ain_interpreter_dir="$OPTARG"
-    ;;
-    r) p_ain_force_reinstall="$OPTARG"
-    ;;
     n)
     ;;
     \?) echo "Invalid option -$OPTARG" >&2
@@ -49,31 +37,10 @@ while getopts "i:rn" opt; do
   esac
 done
 
-# If ain_interpreter_dir in parameters is empty:
-if [ -z "$p_ain_interpreter_dir" ]; then
-  # If ain_interpreter_dir in ../conf/ainode-env.sh is empty, set default value to ../venv/bin/python3
-  if [ -z "$ain_interpreter_dir" ]; then
-    ain_interpreter_dir="$IOTDB_AINODE_HOME/venv/bin/python3"
-  fi
-else
-  # If ain_interpreter_dir in parameters is not empty, set ain_interpreter_dir to the value in parameters
-  ain_interpreter_dir="$p_ain_interpreter_dir"
-fi
-
-# check if ain_interpreter_dir is an absolute path
-if [[ "$ain_interpreter_dir" != /* ]]; then
-  ain_interpreter_dir="$IOTDB_AINODE_HOME/$ain_interpreter_dir"
-fi
-
-echo Script got parameter: ain_interpreter_dir: $ain_interpreter_dir
-
-# Change the working directory to the parent directory
-cd "$IOTDB_AINODE_HOME"
-
-ain_ainode_dir=$(dirname "$ain_interpreter_dir")/ainode
+ain_ainode_executable="$IOTDB_AINODE_HOME/lib/ainode"
 
-echo Script got ainode dir: ain_ainode_dir: $ain_ainode_dir
+echo Script got ainode executable: "$ain_ainode_executable"
 
 echo Starting AINode...
 
-$ain_ainode_dir start
+$ain_ainode_executable start
diff --git a/scripts/sbin/windows/start-ainode.bat b/scripts/sbin/windows/start-ainode.bat
index 0a83865fd23..1d9a4306baf 100644
--- a/scripts/sbin/windows/start-ainode.bat
+++ b/scripts/sbin/windows/start-ainode.bat
@@ -26,54 +26,12 @@ echo ```````````````````````````
 pushd %~dp0..\..
 if NOT DEFINED IOTDB_AINODE_HOME set IOTDB_AINODE_HOME=%cd%
 
-call %IOTDB_AINODE_HOME%\\conf\\windows\\ainode-env.bat %*
-if %errorlevel% neq 0 (
-    echo Environment check failed. Exiting...
-    exit /b 1
-)
+set ain_ainode_executable=%IOTDB_AINODE_HOME%\lib\ainode
 
-for /f "tokens=2 delims==" %%a in ('findstr /i /c:"^ain_interpreter_dir" "%IOTDB_AINODE_HOME%\\conf\\windows\\ainode-env.bat"') do (
-    set _ain_interpreter_dir=%%a
-    goto :done
-)
-
-:initial
-if "%1"=="" goto done
-set aux=%1
-if "%aux:~0,1%"=="-" (
-   set nome=%aux:~1,250%
-) else (
-   set "%nome%=%1"
-   set nome=
-)
-shift
-goto initial
-
-:done
-if "%i%"=="" (
-    if "%_ain_interpreter_dir%"=="" (
-        set _ain_interpreter_dir=%IOTDB_AINODE_HOME%\\venv\\Scripts\\python.exe
-    )
-) else (
-    set _ain_interpreter_dir=%i%
-)
-
-echo Script got parameter: ain_interpreter_dir: %_ain_interpreter_dir%
-
-cd %IOTDB_AINODE_HOME%
-
-for %%i in ("%_ain_interpreter_dir%") do set "parent=%%~dpi"
-
-set ain_ainode_dir=%parent%\ainode.exe
-
-set ain_ainode_dir_new=%parent%\Scripts\\ainode.exe
+echo Script got ainode executable: %ain_ainode_executable%
 
 echo Starting AINode...
 
-%ain_ainode_dir% start
-if %errorlevel% neq 0 (
-    echo ain_ainode_dir_new is %ain_ainode_dir_new%
-    %ain_ainode_dir_new% start
-)
+%$ain_ainode_executable% start
 
 pause
\ No newline at end of file


(iotdb) 26/45: [AINode] Update AINodeClient for DataNode to borrow (#16647)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit dfda7a0b221afcdadb1d2038d65fcacd21a54fa7
Author: Zeyu Zhang <11...@users.noreply.github.com>
AuthorDate: Tue Nov 18 00:02:24 2025 +0800

    [AINode] Update AINodeClient for DataNode to borrow (#16647)
    
    (cherry picked from commit d49d7dd77115aaf951b2f7896ea4347cb1a77bfb)
---
 .../async/AsyncAINodeHeartbeatClientPool.java      |   7 +-
 .../request/read/model/ShowModelPlan.java          |   4 +-
 .../iotdb/confignode/manager/ConfigManager.java    |  26 ++--
 .../apache/iotdb/confignode/manager/IManager.java  |  18 +--
 .../iotdb/confignode/manager/ModelManager.java     |  37 ++---
 .../procedure/impl/model/CreateModelProcedure.java |   4 +-
 .../procedure/impl/model/DropModelProcedure.java   |   7 +-
 .../procedure/impl/node/RemoveAINodeProcedure.java |   4 +-
 .../thrift/ConfigNodeRPCServiceProcessor.java      |  69 ++++-----
 .../db/protocol/client/AINodeClientFactory.java    | 133 ++++++++++++++++
 .../iotdb/db/protocol/client/ConfigNodeClient.java |  51 +------
 .../db/protocol}/client/ainode/AINodeClient.java   | 168 ++++++++++++---------
 .../client/ainode/AINodeClientManager.java         |  75 +++++++++
 .../client/ainode/AsyncAINodeServiceClient.java    |   2 +-
 .../operator/process/ai/InferenceOperator.java     |   4 +-
 .../InformationSchemaContentSupplierFactory.java   |  17 ++-
 .../config/executor/ClusterConfigTaskExecutor.java | 109 ++++++-------
 .../config/metadata/ai/ShowAIDevicesTask.java      |   2 +-
 .../config/metadata/ai/ShowLoadedModelsTask.java   |   4 +-
 .../config/metadata/ai/ShowModelsTask.java         |   4 +-
 .../function/tvf/ForecastTableFunction.java        |   8 +-
 .../db/queryengine/plan/udf/UDTFForecast.java      |   8 +-
 iotdb-core/node-commons/pom.xml                    |   6 -
 .../iotdb/commons/client/ClientPoolFactory.java    |  52 -------
 .../commons/client/ainode/AINodeClientManager.java |  40 -----
 .../src/main/thrift/confignode.thrift              |  83 ++--------
 26 files changed, 487 insertions(+), 455 deletions(-)

diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/client/async/AsyncAINodeHeartbeatClientPool.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/client/async/AsyncAINodeHeartbeatClientPool.java
index e09ccc79bec..2721fedafb1 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/client/async/AsyncAINodeHeartbeatClientPool.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/client/async/AsyncAINodeHeartbeatClientPool.java
@@ -21,10 +21,10 @@ package org.apache.iotdb.confignode.client.async;
 
 import org.apache.iotdb.ainode.rpc.thrift.TAIHeartbeatReq;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
-import org.apache.iotdb.commons.client.ClientPoolFactory;
 import org.apache.iotdb.commons.client.IClientManager;
-import org.apache.iotdb.commons.client.ainode.AsyncAINodeServiceClient;
 import org.apache.iotdb.confignode.client.async.handlers.heartbeat.AINodeHeartbeatHandler;
+import org.apache.iotdb.db.protocol.client.AINodeClientFactory;
+import org.apache.iotdb.db.protocol.client.ainode.AsyncAINodeServiceClient;
 
 public class AsyncAINodeHeartbeatClientPool {
 
@@ -33,8 +33,7 @@ public class AsyncAINodeHeartbeatClientPool {
   private AsyncAINodeHeartbeatClientPool() {
     clientManager =
         new IClientManager.Factory<TEndPoint, AsyncAINodeServiceClient>()
-            .createClientManager(
-                new ClientPoolFactory.AsyncAINodeHeartbeatServiceClientPoolFactory());
+            .createClientManager(new AINodeClientFactory.AINodeHeartbeatClientPoolFactory());
   }
 
   public void getAINodeHeartBeat(
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/read/model/ShowModelPlan.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/read/model/ShowModelPlan.java
index 16bc16bc872..eca00e8827d 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/read/model/ShowModelPlan.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/read/model/ShowModelPlan.java
@@ -19,9 +19,9 @@
 
 package org.apache.iotdb.confignode.consensus.request.read.model;
 
+import org.apache.iotdb.ainode.rpc.thrift.TShowModelsReq;
 import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlanType;
 import org.apache.iotdb.confignode.consensus.request.read.ConfigPhysicalReadPlan;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelReq;
 
 import java.util.Objects;
 
@@ -33,7 +33,7 @@ public class ShowModelPlan extends ConfigPhysicalReadPlan {
     super(ConfigPhysicalPlanType.ShowModel);
   }
 
-  public ShowModelPlan(final TShowModelReq showModelReq) {
+  public ShowModelPlan(final TShowModelsReq showModelReq) {
     super(ConfigPhysicalPlanType.ShowModel);
     if (showModelReq.isSetModelId()) {
       this.modelName = showModelReq.getModelId();
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
index 502937713c2..5d4b09adfc7 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
@@ -20,7 +20,14 @@
 package org.apache.iotdb.confignode.manager;
 
 import org.apache.iotdb.ainode.rpc.thrift.IDataSchema;
+import org.apache.iotdb.ainode.rpc.thrift.TLoadModelReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowAIDevicesResp;
+import org.apache.iotdb.ainode.rpc.thrift.TShowLoadedModelsReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowLoadedModelsResp;
+import org.apache.iotdb.ainode.rpc.thrift.TShowModelsReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowModelsResp;
 import org.apache.iotdb.ainode.rpc.thrift.TTrainingReq;
+import org.apache.iotdb.ainode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.common.rpc.thrift.TAINodeConfiguration;
 import org.apache.iotdb.common.rpc.thrift.TAINodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
@@ -42,8 +49,6 @@ import org.apache.iotdb.common.rpc.thrift.TShowConfigurationResp;
 import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
 import org.apache.iotdb.commons.auth.AuthException;
 import org.apache.iotdb.commons.auth.entity.PrivilegeUnion;
-import org.apache.iotdb.commons.client.ainode.AINodeClient;
-import org.apache.iotdb.commons.client.ainode.AINodeClientManager;
 import org.apache.iotdb.commons.cluster.NodeStatus;
 import org.apache.iotdb.commons.cluster.NodeType;
 import org.apache.iotdb.commons.conf.CommonConfig;
@@ -213,7 +218,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TGetTimeSlotListResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetTriggerTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetUDFTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetUdfTableReq;
-import org.apache.iotdb.confignode.rpc.thrift.TLoadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TMigrateRegionReq;
 import org.apache.iotdb.confignode.rpc.thrift.TNodeVersionInfo;
 import org.apache.iotdb.confignode.rpc.thrift.TPermissionInfoResp;
@@ -226,7 +230,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TSchemaNodeManagementResp;
 import org.apache.iotdb.confignode.rpc.thrift.TSchemaPartitionTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TSetDataNodeStatusReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSetSchemaTemplateReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowAIDevicesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowAINodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowCQResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowClusterResp;
@@ -235,10 +238,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowConfigNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodes4InformationSchemaResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDatabaseResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipePluginReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeResp;
@@ -256,12 +255,13 @@ import org.apache.iotdb.confignode.rpc.thrift.TStopPipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSubscribeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TThrottleQuotaResp;
 import org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList;
-import org.apache.iotdb.confignode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUnsetSchemaTemplateReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUnsubscribeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUpdateModelInfoReq;
 import org.apache.iotdb.consensus.common.DataSet;
 import org.apache.iotdb.consensus.exception.ConsensusException;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClientManager;
 import org.apache.iotdb.db.schemaengine.template.Template;
 import org.apache.iotdb.db.schemaengine.template.TemplateAlterOperationType;
 import org.apache.iotdb.db.schemaengine.template.alter.TemplateAlterOperationUtil;
@@ -2863,19 +2863,19 @@ public class ConfigManager implements IManager {
   }
 
   @Override
-  public TShowModelResp showModel(TShowModelReq req) {
+  public TShowModelsResp showModel(TShowModelsReq req) {
     TSStatus status = confirmLeader();
     return status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
         ? modelManager.showModel(req)
-        : new TShowModelResp(status);
+        : new TShowModelsResp(status);
   }
 
   @Override
-  public TShowLoadedModelResp showLoadedModel(TShowLoadedModelReq req) {
+  public TShowLoadedModelsResp showLoadedModel(TShowLoadedModelsReq req) {
     TSStatus status = confirmLeader();
     return status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
         ? modelManager.showLoadedModel(req)
-        : new TShowLoadedModelResp(status, Collections.emptyMap());
+        : new TShowLoadedModelsResp(status, Collections.emptyMap());
   }
 
   @Override
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/IManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/IManager.java
index e15c33e04b7..33e77db2490 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/IManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/IManager.java
@@ -19,6 +19,13 @@
 
 package org.apache.iotdb.confignode.manager;
 
+import org.apache.iotdb.ainode.rpc.thrift.TLoadModelReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowAIDevicesResp;
+import org.apache.iotdb.ainode.rpc.thrift.TShowLoadedModelsReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowLoadedModelsResp;
+import org.apache.iotdb.ainode.rpc.thrift.TShowModelsReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowModelsResp;
+import org.apache.iotdb.ainode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TConsensusGroupId;
 import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
@@ -128,7 +135,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TGetTimeSlotListResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetTriggerTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetUDFTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetUdfTableReq;
-import org.apache.iotdb.confignode.rpc.thrift.TLoadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TMigrateRegionReq;
 import org.apache.iotdb.confignode.rpc.thrift.TPermissionInfoResp;
 import org.apache.iotdb.confignode.rpc.thrift.TPipeConfigTransferReq;
@@ -140,7 +146,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TSchemaNodeManagementResp;
 import org.apache.iotdb.confignode.rpc.thrift.TSchemaPartitionTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TSetDataNodeStatusReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSetSchemaTemplateReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowAIDevicesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowAINodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowCQResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowClusterResp;
@@ -149,10 +154,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowConfigNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodes4InformationSchemaResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDatabaseResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipePluginReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeResp;
@@ -166,7 +167,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowVariablesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TStartPipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TStopPipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSubscribeReq;
-import org.apache.iotdb.confignode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUnsetSchemaTemplateReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUnsubscribeReq;
 import org.apache.iotdb.consensus.common.DataSet;
@@ -893,10 +893,10 @@ public interface IManager {
   TSStatus unloadModel(TUnloadModelReq req);
 
   /** Return the model table. */
-  TShowModelResp showModel(TShowModelReq req);
+  TShowModelsResp showModel(TShowModelsReq req);
 
   /** Return the loaded model instances. */
-  TShowLoadedModelResp showLoadedModel(TShowLoadedModelReq req);
+  TShowLoadedModelsResp showLoadedModel(TShowLoadedModelsReq req);
 
   /** Return all available AI devices. */
   TShowAIDevicesResp showAIDevices();
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ModelManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ModelManager.java
index 4c1f94eab9e..3efdbc222b6 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ModelManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ModelManager.java
@@ -19,14 +19,15 @@
 
 package org.apache.iotdb.confignode.manager;
 
+import org.apache.iotdb.ainode.rpc.thrift.TLoadModelReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowAIDevicesResp;
 import org.apache.iotdb.ainode.rpc.thrift.TShowLoadedModelsReq;
 import org.apache.iotdb.ainode.rpc.thrift.TShowLoadedModelsResp;
 import org.apache.iotdb.ainode.rpc.thrift.TShowModelsReq;
 import org.apache.iotdb.ainode.rpc.thrift.TShowModelsResp;
+import org.apache.iotdb.ainode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.client.ainode.AINodeClient;
-import org.apache.iotdb.commons.client.ainode.AINodeClientManager;
 import org.apache.iotdb.commons.client.exception.ClientManagerException;
 import org.apache.iotdb.commons.model.ModelInformation;
 import org.apache.iotdb.commons.model.ModelStatus;
@@ -40,15 +41,10 @@ import org.apache.iotdb.confignode.rpc.thrift.TCreateModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TDropModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TGetModelInfoReq;
 import org.apache.iotdb.confignode.rpc.thrift.TGetModelInfoResp;
-import org.apache.iotdb.confignode.rpc.thrift.TLoadModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowAIDevicesResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelResp;
-import org.apache.iotdb.confignode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUpdateModelInfoReq;
 import org.apache.iotdb.consensus.exception.ConsensusException;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClientManager;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.slf4j.Logger;
@@ -124,15 +120,16 @@ public class ModelManager {
     }
   }
 
-  public TShowModelResp showModel(final TShowModelReq req) {
+  public TShowModelsResp showModel(final TShowModelsReq req) {
     try (AINodeClient client = getAINodeClient()) {
       TShowModelsReq showModelsReq = new TShowModelsReq();
       if (req.isSetModelId()) {
         showModelsReq.setModelId(req.getModelId());
       }
       TShowModelsResp resp = client.showModels(showModelsReq);
-      TShowModelResp res =
-          new TShowModelResp().setStatus(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
+      TShowModelsResp res =
+          new TShowModelsResp()
+              .setStatus(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
       res.setModelIdList(resp.getModelIdList());
       res.setModelTypeMap(resp.getModelTypeMap());
       res.setCategoryMap(resp.getCategoryMap());
@@ -140,26 +137,26 @@ public class ModelManager {
       return res;
     } catch (Exception e) {
       LOGGER.warn("Failed to show models due to", e);
-      return new TShowModelResp()
+      return new TShowModelsResp()
           .setStatus(
               new TSStatus(TSStatusCode.AI_NODE_INTERNAL_ERROR.getStatusCode())
                   .setMessage(e.getMessage()));
     }
   }
 
-  public TShowLoadedModelResp showLoadedModel(final TShowLoadedModelReq req) {
+  public TShowLoadedModelsResp showLoadedModel(final TShowLoadedModelsReq req) {
     try (AINodeClient client = getAINodeClient()) {
       TShowLoadedModelsReq showModelsReq =
           new TShowLoadedModelsReq().setDeviceIdList(req.getDeviceIdList());
       TShowLoadedModelsResp resp = client.showLoadedModels(showModelsReq);
-      TShowLoadedModelResp res =
-          new TShowLoadedModelResp()
+      TShowLoadedModelsResp res =
+          new TShowLoadedModelsResp()
               .setStatus(new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));
       res.setDeviceLoadedModelsMap(resp.getDeviceLoadedModelsMap());
       return res;
     } catch (Exception e) {
       LOGGER.warn("Failed to show loaded models due to", e);
-      return new TShowLoadedModelResp()
+      return new TShowLoadedModelsResp()
           .setStatus(
               new TSStatus(TSStatusCode.AI_NODE_INTERNAL_ERROR.getStatusCode())
                   .setMessage(e.getMessage()));
@@ -235,7 +232,11 @@ public class ModelManager {
     }
     TEndPoint targetAINodeEndPoint =
         new TEndPoint(aiNodeInfo.get(0).getInternalAddress(), aiNodeInfo.get(0).getInternalPort());
-    return AINodeClientManager.getInstance().borrowClient(targetAINodeEndPoint);
+    try {
+      return AINodeClientManager.getInstance().borrowClient(targetAINodeEndPoint);
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    }
   }
 
   public List<Integer> getModelDistributions(String modelName) {
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/model/CreateModelProcedure.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/model/CreateModelProcedure.java
index 8282608466d..98906161021 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/model/CreateModelProcedure.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/model/CreateModelProcedure.java
@@ -21,8 +21,6 @@ package org.apache.iotdb.confignode.procedure.impl.model;
 
 import org.apache.iotdb.common.rpc.thrift.TAINodeConfiguration;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.client.ainode.AINodeClient;
-import org.apache.iotdb.commons.client.ainode.AINodeClientManager;
 import org.apache.iotdb.commons.exception.ainode.LoadModelException;
 import org.apache.iotdb.commons.model.ModelInformation;
 import org.apache.iotdb.commons.model.ModelStatus;
@@ -36,6 +34,8 @@ import org.apache.iotdb.confignode.procedure.impl.node.AbstractNodeProcedure;
 import org.apache.iotdb.confignode.procedure.state.model.CreateModelState;
 import org.apache.iotdb.confignode.procedure.store.ProcedureType;
 import org.apache.iotdb.consensus.exception.ConsensusException;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClientManager;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.apache.tsfile.utils.ReadWriteIOUtils;
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/model/DropModelProcedure.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/model/DropModelProcedure.java
index 23e02ea2e1d..daa029e04dd 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/model/DropModelProcedure.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/model/DropModelProcedure.java
@@ -19,10 +19,9 @@
 
 package org.apache.iotdb.confignode.procedure.impl.model;
 
+import org.apache.iotdb.ainode.rpc.thrift.TDeleteModelReq;
 import org.apache.iotdb.common.rpc.thrift.TAINodeConfiguration;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.client.ainode.AINodeClient;
-import org.apache.iotdb.commons.client.ainode.AINodeClientManager;
 import org.apache.iotdb.commons.model.exception.ModelManagementException;
 import org.apache.iotdb.confignode.consensus.request.write.model.DropModelPlan;
 import org.apache.iotdb.confignode.procedure.env.ConfigNodeProcedureEnv;
@@ -30,6 +29,8 @@ import org.apache.iotdb.confignode.procedure.exception.ProcedureException;
 import org.apache.iotdb.confignode.procedure.impl.node.AbstractNodeProcedure;
 import org.apache.iotdb.confignode.procedure.state.model.DropModelState;
 import org.apache.iotdb.confignode.procedure.store.ProcedureType;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClientManager;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.apache.thrift.TException;
@@ -115,7 +116,7 @@ public class DropModelProcedure extends AbstractNodeProcedure<DropModelState> {
                           .getRegisteredAINode(nodeId)
                           .getLocation()
                           .getInternalEndPoint())) {
-            TSStatus status = client.deleteModel(modelName);
+            TSStatus status = client.deleteModel(new TDeleteModelReq(modelName));
             if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
               LOGGER.warn(
                   "Failed to drop model [{}] on AINode [{}], status: {}",
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/node/RemoveAINodeProcedure.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/node/RemoveAINodeProcedure.java
index 5f98930d074..2cab08c2824 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/node/RemoveAINodeProcedure.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/node/RemoveAINodeProcedure.java
@@ -21,8 +21,6 @@ package org.apache.iotdb.confignode.procedure.impl.node;
 
 import org.apache.iotdb.common.rpc.thrift.TAINodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
-import org.apache.iotdb.commons.client.ainode.AINodeClient;
-import org.apache.iotdb.commons.client.ainode.AINodeClientManager;
 import org.apache.iotdb.commons.utils.ThriftCommonsSerDeUtils;
 import org.apache.iotdb.confignode.consensus.request.write.ainode.RemoveAINodePlan;
 import org.apache.iotdb.confignode.consensus.request.write.model.DropModelInNodePlan;
@@ -30,6 +28,8 @@ import org.apache.iotdb.confignode.procedure.env.ConfigNodeProcedureEnv;
 import org.apache.iotdb.confignode.procedure.exception.ProcedureException;
 import org.apache.iotdb.confignode.procedure.state.RemoveAINodeState;
 import org.apache.iotdb.confignode.procedure.store.ProcedureType;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClientManager;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.slf4j.Logger;
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
index bcc9f5068a5..59ce7352312 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
@@ -19,6 +19,8 @@
 
 package org.apache.iotdb.confignode.service.thrift;
 
+import org.apache.iotdb.common.rpc.thrift.TAINodeConfiguration;
+import org.apache.iotdb.common.rpc.thrift.TAINodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TFlushReq;
@@ -119,7 +121,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TCreatePipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateSchemaTemplateReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateTableViewReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateTopicReq;
-import org.apache.iotdb.confignode.rpc.thrift.TCreateTrainingReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateTriggerReq;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeConfigurationResp;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRegisterReq;
@@ -151,6 +152,7 @@ import org.apache.iotdb.confignode.rpc.thrift.TDropTopicReq;
 import org.apache.iotdb.confignode.rpc.thrift.TDropTriggerReq;
 import org.apache.iotdb.confignode.rpc.thrift.TExtendRegionReq;
 import org.apache.iotdb.confignode.rpc.thrift.TFetchTableResp;
+import org.apache.iotdb.confignode.rpc.thrift.TGetAINodeLocationResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetAllPipeInfoResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetAllSubscriptionInfoResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetAllTemplatesResp;
@@ -176,7 +178,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TGetTimeSlotListResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetTriggerTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetUDFTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetUdfTableReq;
-import org.apache.iotdb.confignode.rpc.thrift.TLoadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TLoginReq;
 import org.apache.iotdb.confignode.rpc.thrift.TMigrateRegionReq;
 import org.apache.iotdb.confignode.rpc.thrift.TPermissionInfoResp;
@@ -194,7 +195,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TSetDataReplicationFactorReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSetSchemaReplicationFactorReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSetSchemaTemplateReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSetTimePartitionIntervalReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowAIDevicesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowAINodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowCQResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowClusterResp;
@@ -203,10 +203,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowConfigNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodes4InformationSchemaResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDatabaseResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipePluginReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeResp;
@@ -228,7 +224,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TSubscribeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSystemConfigurationResp;
 import org.apache.iotdb.confignode.rpc.thrift.TTestOperation;
 import org.apache.iotdb.confignode.rpc.thrift.TThrottleQuotaResp;
-import org.apache.iotdb.confignode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUnsetSchemaTemplateReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUnsubscribeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUpdateModelInfoReq;
@@ -649,6 +644,34 @@ public class ConfigNodeRPCServiceProcessor implements IConfigNodeRPCService.Ifac
             req.getNewUsername()));
   }
 
+  @Override
+  public TGetAINodeLocationResp getAINodeLocation() throws TException {
+    final TGetAINodeLocationResp resp = new TGetAINodeLocationResp();
+    final TSStatus status = new TSStatus();
+    try {
+      final List<TAINodeConfiguration> registeredAINodes =
+          configManager.getNodeManager().getRegisteredAINodes();
+
+      if (registeredAINodes == null || registeredAINodes.isEmpty()) {
+        status.setCode(TSStatusCode.NO_REGISTERED_AI_NODE_ERROR.getStatusCode());
+        status.setMessage("No registered AINode found");
+        resp.setStatus(status);
+        return resp;
+      }
+
+      final TAINodeLocation loc = registeredAINodes.get(0).getLocation();
+      resp.setAiNodeLocation(loc);
+      status.setCode(TSStatusCode.SUCCESS_STATUS.getStatusCode());
+      status.setMessage("AINode location resolved");
+
+    } catch (Exception e) {
+      status.setCode(TSStatusCode.INTERNAL_SERVER_ERROR.getStatusCode());
+      status.setMessage("getAINodeLocation failed: " + e.getMessage());
+    }
+    resp.setStatus(status);
+    return resp;
+  }
+
   @Override
   public TAuthorizerResp queryPermission(final TAuthorizerReq req) {
     final PermissionInfoResp dataSet =
@@ -1349,31 +1372,6 @@ public class ConfigNodeRPCServiceProcessor implements IConfigNodeRPCService.Ifac
     return configManager.dropModel(req);
   }
 
-  @Override
-  public TSStatus loadModel(TLoadModelReq req) {
-    return configManager.loadModel(req);
-  }
-
-  @Override
-  public TSStatus unloadModel(TUnloadModelReq req) {
-    return configManager.unloadModel(req);
-  }
-
-  @Override
-  public TShowModelResp showModel(TShowModelReq req) {
-    return configManager.showModel(req);
-  }
-
-  @Override
-  public TShowLoadedModelResp showLoadedModel(TShowLoadedModelReq req) {
-    return configManager.showLoadedModel(req);
-  }
-
-  @Override
-  public TShowAIDevicesResp showAIDevices() {
-    return configManager.showAIDevices();
-  }
-
   @Override
   public TGetModelInfoResp getModelInfo(TGetModelInfoReq req) {
     return configManager.getModelInfo(req);
@@ -1384,11 +1382,6 @@ public class ConfigNodeRPCServiceProcessor implements IConfigNodeRPCService.Ifac
     return configManager.updateModelInfo(req);
   }
 
-  @Override
-  public TSStatus createTraining(TCreateTrainingReq req) throws TException {
-    return configManager.createTraining(req);
-  }
-
   @Override
   public TSStatus setSpaceQuota(final TSetSpaceQuotaReq req) throws TException {
     return configManager.setSpaceQuota(req);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/AINodeClientFactory.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/AINodeClientFactory.java
new file mode 100644
index 00000000000..0d784617c09
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/AINodeClientFactory.java
@@ -0,0 +1,133 @@
+/*
+ * 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.protocol.client;
+
+import org.apache.iotdb.common.rpc.thrift.TEndPoint;
+import org.apache.iotdb.commons.client.ClientManager;
+import org.apache.iotdb.commons.client.ClientManagerMetrics;
+import org.apache.iotdb.commons.client.IClientPoolFactory;
+import org.apache.iotdb.commons.client.factory.ThriftClientFactory;
+import org.apache.iotdb.commons.client.property.ClientPoolProperty;
+import org.apache.iotdb.commons.client.property.ThriftClientProperty;
+import org.apache.iotdb.commons.concurrent.ThreadName;
+import org.apache.iotdb.commons.conf.CommonConfig;
+import org.apache.iotdb.commons.conf.CommonDescriptor;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AsyncAINodeServiceClient;
+
+import org.apache.commons.pool2.PooledObject;
+import org.apache.commons.pool2.impl.DefaultPooledObject;
+import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
+
+import java.util.Optional;
+
+/** Dedicated factory for AINodeClient + AINodeClientPoolFactory. */
+public class AINodeClientFactory extends ThriftClientFactory<TEndPoint, AINodeClient> {
+
+  private static final int connectionTimeout =
+      CommonDescriptor.getInstance().getConfig().getDnConnectionTimeoutInMS();
+
+  public AINodeClientFactory(
+      ClientManager<TEndPoint, AINodeClient> manager, ThriftClientProperty thriftProperty) {
+    super(manager, thriftProperty);
+  }
+
+  @Override
+  public PooledObject<AINodeClient> makeObject(TEndPoint endPoint) throws Exception {
+    return new DefaultPooledObject<>(
+        new AINodeClient(thriftClientProperty, endPoint, clientManager));
+  }
+
+  @Override
+  public void destroyObject(TEndPoint key, PooledObject<AINodeClient> pooled) throws Exception {
+    pooled.getObject().invalidate();
+  }
+
+  @Override
+  public boolean validateObject(TEndPoint key, PooledObject<AINodeClient> pooledObject) {
+    return Optional.ofNullable(pooledObject.getObject().getTransport())
+        .map(org.apache.thrift.transport.TTransport::isOpen)
+        .orElse(false);
+  }
+
+  /** The PoolFactory originally inside ClientPoolFactory — now moved here. */
+  public static class AINodeClientPoolFactory
+      implements IClientPoolFactory<TEndPoint, AINodeClient> {
+
+    @Override
+    public GenericKeyedObjectPool<TEndPoint, AINodeClient> createClientPool(
+        ClientManager<TEndPoint, AINodeClient> manager) {
+
+      // Build thrift client properties
+      ThriftClientProperty thriftProperty =
+          new ThriftClientProperty.Builder()
+              .setConnectionTimeoutMs(connectionTimeout)
+              .setRpcThriftCompressionEnabled(
+                  CommonDescriptor.getInstance().getConfig().isRpcThriftCompressionEnabled())
+              .build();
+
+      GenericKeyedObjectPool<TEndPoint, AINodeClient> pool =
+          new GenericKeyedObjectPool<>(
+              new AINodeClientFactory(manager, thriftProperty),
+              new ClientPoolProperty.Builder<AINodeClient>()
+                  .setMaxClientNumForEachNode(
+                      CommonDescriptor.getInstance().getConfig().getMaxClientNumForEachNode())
+                  .build()
+                  .getConfig());
+
+      ClientManagerMetrics.getInstance()
+          .registerClientManager(this.getClass().getSimpleName(), pool);
+
+      return pool;
+    }
+  }
+
+  public static class AINodeHeartbeatClientPoolFactory
+      implements IClientPoolFactory<TEndPoint, AsyncAINodeServiceClient> {
+
+    @Override
+    public GenericKeyedObjectPool<TEndPoint, AsyncAINodeServiceClient> createClientPool(
+        ClientManager<TEndPoint, AsyncAINodeServiceClient> manager) {
+
+      final CommonConfig conf = CommonDescriptor.getInstance().getConfig();
+
+      GenericKeyedObjectPool<TEndPoint, AsyncAINodeServiceClient> clientPool =
+          new GenericKeyedObjectPool<>(
+              new AsyncAINodeServiceClient.Factory(
+                  manager,
+                  new ThriftClientProperty.Builder()
+                      .setConnectionTimeoutMs(conf.getCnConnectionTimeoutInMS())
+                      .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
+                      .setSelectorNumOfAsyncClientManager(conf.getSelectorNumOfClientManager())
+                      .setPrintLogWhenEncounterException(false)
+                      .build(),
+                  ThreadName.ASYNC_DATANODE_HEARTBEAT_CLIENT_POOL.getName()),
+              new ClientPoolProperty.Builder<AsyncAINodeServiceClient>()
+                  .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
+                  .build()
+                  .getConfig());
+
+      ClientManagerMetrics.getInstance()
+          .registerClientManager(this.getClass().getSimpleName(), clientPool);
+
+      return clientPool;
+    }
+  }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ConfigNodeClient.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ConfigNodeClient.java
index 6854a3191fa..2c037cf0f3e 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ConfigNodeClient.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ConfigNodeClient.java
@@ -79,7 +79,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TCreatePipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateSchemaTemplateReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateTableViewReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateTopicReq;
-import org.apache.iotdb.confignode.rpc.thrift.TCreateTrainingReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateTriggerReq;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeConfigurationResp;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRegisterReq;
@@ -111,6 +110,7 @@ import org.apache.iotdb.confignode.rpc.thrift.TDropTopicReq;
 import org.apache.iotdb.confignode.rpc.thrift.TDropTriggerReq;
 import org.apache.iotdb.confignode.rpc.thrift.TExtendRegionReq;
 import org.apache.iotdb.confignode.rpc.thrift.TFetchTableResp;
+import org.apache.iotdb.confignode.rpc.thrift.TGetAINodeLocationResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetAllPipeInfoResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetAllSubscriptionInfoResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetAllTemplatesResp;
@@ -136,7 +136,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TGetTimeSlotListResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetTriggerTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetUDFTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetUdfTableReq;
-import org.apache.iotdb.confignode.rpc.thrift.TLoadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TLoginReq;
 import org.apache.iotdb.confignode.rpc.thrift.TMigrateRegionReq;
 import org.apache.iotdb.confignode.rpc.thrift.TPermissionInfoResp;
@@ -154,7 +153,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TSetDataReplicationFactorReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSetSchemaReplicationFactorReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSetSchemaTemplateReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSetTimePartitionIntervalReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowAIDevicesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowAINodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowCQResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowClusterResp;
@@ -163,10 +161,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowConfigNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodes4InformationSchemaResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDatabaseResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipePluginReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeResp;
@@ -188,7 +182,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TSubscribeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TSystemConfigurationResp;
 import org.apache.iotdb.confignode.rpc.thrift.TTestOperation;
 import org.apache.iotdb.confignode.rpc.thrift.TThrottleQuotaResp;
-import org.apache.iotdb.confignode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUnsetSchemaTemplateReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUnsubscribeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUpdateModelInfoReq;
@@ -530,6 +523,11 @@ public class ConfigNodeClient implements IConfigNodeRPCService.Iface, ThriftClie
     throw new UnsupportedOperationException(UNSUPPORTED_INVOCATION);
   }
 
+  @Override
+  public TGetAINodeLocationResp getAINodeLocation() throws TException {
+    return client.getAINodeLocation();
+  }
+
   @Override
   public TSStatus removeAINode(TAINodeRemoveReq req) throws TException {
     return executeRemoteCallWithRetry(
@@ -1353,53 +1351,16 @@ public class ConfigNodeClient implements IConfigNodeRPCService.Iface, ThriftClie
         () -> client.dropModel(req), status -> !updateConfigNodeLeader(status));
   }
 
-  @Override
-  public TShowModelResp showModel(TShowModelReq req) throws TException {
-    return executeRemoteCallWithRetry(
-        () -> client.showModel(req), resp -> !updateConfigNodeLeader(resp.status));
-  }
-
-  @Override
-  public TShowLoadedModelResp showLoadedModel(TShowLoadedModelReq req) throws TException {
-    return executeRemoteCallWithRetry(
-        () -> client.showLoadedModel(req), resp -> !updateConfigNodeLeader(resp.status));
-  }
-
-  @Override
-  public TShowAIDevicesResp showAIDevices() throws TException {
-    return executeRemoteCallWithRetry(
-        () -> client.showAIDevices(), resp -> !updateConfigNodeLeader(resp.status));
-  }
-
-  @Override
-  public TSStatus loadModel(TLoadModelReq req) throws TException {
-    return executeRemoteCallWithRetry(
-        () -> client.loadModel(req), status -> !updateConfigNodeLeader(status));
-  }
-
-  public TSStatus unloadModel(TUnloadModelReq req) throws TException {
-    return executeRemoteCallWithRetry(
-        () -> client.unloadModel(req), status -> !updateConfigNodeLeader(status));
-  }
-
-  @Override
   public TGetModelInfoResp getModelInfo(TGetModelInfoReq req) throws TException {
     return executeRemoteCallWithRetry(
         () -> client.getModelInfo(req), resp -> !updateConfigNodeLeader(resp.getStatus()));
   }
 
-  @Override
   public TSStatus updateModelInfo(TUpdateModelInfoReq req) throws TException {
     return executeRemoteCallWithRetry(
         () -> client.updateModelInfo(req), status -> !updateConfigNodeLeader(status));
   }
 
-  @Override
-  public TSStatus createTraining(TCreateTrainingReq req) throws TException {
-    return executeRemoteCallWithRetry(
-        () -> client.createTraining(req), status -> !updateConfigNodeLeader(status));
-  }
-
   @Override
   public TSStatus setSpaceQuota(TSetSpaceQuotaReq req) throws TException {
     return executeRemoteCallWithRetry(
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClient.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ainode/AINodeClient.java
similarity index 74%
rename from iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClient.java
rename to iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ainode/AINodeClient.java
index 0058bc7a2fc..54150b8f300 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClient.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ainode/AINodeClient.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.iotdb.commons.client.ainode;
+package org.apache.iotdb.db.protocol.client.ainode;
 
 import org.apache.iotdb.ainode.rpc.thrift.IAINodeRPCService;
 import org.apache.iotdb.ainode.rpc.thrift.TConfigs;
@@ -37,16 +37,23 @@ import org.apache.iotdb.ainode.rpc.thrift.TShowModelsResp;
 import org.apache.iotdb.ainode.rpc.thrift.TTrainingReq;
 import org.apache.iotdb.ainode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.ainode.rpc.thrift.TWindowParams;
+import org.apache.iotdb.common.rpc.thrift.TAINodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.commons.client.ClientManager;
+import org.apache.iotdb.commons.client.IClientManager;
 import org.apache.iotdb.commons.client.ThriftClient;
 import org.apache.iotdb.commons.client.factory.ThriftClientFactory;
 import org.apache.iotdb.commons.client.property.ThriftClientProperty;
 import org.apache.iotdb.commons.conf.CommonConfig;
 import org.apache.iotdb.commons.conf.CommonDescriptor;
+import org.apache.iotdb.commons.consensus.ConfigRegionId;
 import org.apache.iotdb.commons.exception.ainode.LoadModelException;
 import org.apache.iotdb.commons.model.ModelInformation;
+import org.apache.iotdb.confignode.rpc.thrift.TGetAINodeLocationResp;
+import org.apache.iotdb.db.protocol.client.ConfigNodeClient;
+import org.apache.iotdb.db.protocol.client.ConfigNodeClientManager;
+import org.apache.iotdb.db.protocol.client.ConfigNodeInfo;
 import org.apache.iotdb.rpc.TConfigurationConst;
 import org.apache.iotdb.rpc.TSStatusCode;
 
@@ -67,6 +74,7 @@ import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.util.Map;
 import java.util.Optional;
+import java.util.concurrent.atomic.AtomicReference;
 
 import static org.apache.iotdb.rpc.TSStatusCode.CAN_NOT_CONNECT_AINODE;
 import static org.apache.iotdb.rpc.TSStatusCode.INTERNAL_SERVER_ERROR;
@@ -77,7 +85,7 @@ public class AINodeClient implements AutoCloseable, ThriftClient {
 
   private static final CommonConfig commonConfig = CommonDescriptor.getInstance().getConfig();
 
-  private final TEndPoint endPoint;
+  private TEndPoint endPoint;
 
   private TTransport transport;
 
@@ -86,11 +94,90 @@ public class AINodeClient implements AutoCloseable, ThriftClient {
 
   public static final String MSG_CONNECTION_FAIL =
       "Fail to connect to AINode. Please check status of AINode";
+  private static final int MAX_RETRY = 3;
+
+  @FunctionalInterface
+  private interface RemoteCall<R> {
+    R apply(IAINodeRPCService.Client c) throws TException;
+  }
 
   private final TsBlockSerde tsBlockSerde = new TsBlockSerde();
 
   ClientManager<TEndPoint, AINodeClient> clientManager;
 
+  private static final IClientManager<ConfigRegionId, ConfigNodeClient> CONFIG_NODE_CLIENT_MANAGER =
+      ConfigNodeClientManager.getInstance();
+
+  private static final AtomicReference<TAINodeLocation> CURRENT_LOCATION = new AtomicReference<>();
+
+  public static TEndPoint getCurrentEndpoint() {
+    TAINodeLocation loc = CURRENT_LOCATION.get();
+    if (loc == null) {
+      loc = refreshFromConfigNode();
+    }
+    return (loc == null) ? null : pickEndpointFrom(loc);
+  }
+
+  public static void updateGlobalAINodeLocation(final TAINodeLocation loc) {
+    if (loc != null) {
+      CURRENT_LOCATION.set(loc);
+    }
+  }
+
+  private <R> R executeRemoteCallWithRetry(RemoteCall<R> call) throws TException {
+    TException last = null;
+    for (int attempt = 1; attempt <= MAX_RETRY; attempt++) {
+      try {
+        if (transport == null || !transport.isOpen()) {
+          final TEndPoint ep = getCurrentEndpoint();
+          if (ep == null) {
+            throw new TException("AINode endpoint unavailable");
+          }
+          this.endPoint = ep;
+          init();
+        }
+        return call.apply(client);
+      } catch (TException e) {
+        last = e;
+        invalidate();
+        final TAINodeLocation loc = refreshFromConfigNode();
+        if (loc != null) {
+          this.endPoint = pickEndpointFrom(loc);
+        }
+        try {
+          Thread.sleep(1000L * attempt);
+        } catch (InterruptedException ie) {
+          Thread.currentThread().interrupt();
+        }
+      }
+    }
+    throw (last != null ? last : new TException(MSG_CONNECTION_FAIL));
+  }
+
+  private static TAINodeLocation refreshFromConfigNode() {
+    try (final ConfigNodeClient cn =
+        CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
+      final TGetAINodeLocationResp resp = cn.getAINodeLocation();
+      if (resp != null && resp.isSetAiNodeLocation()) {
+        final TAINodeLocation loc = resp.getAiNodeLocation();
+        CURRENT_LOCATION.set(loc);
+        return loc;
+      }
+    } catch (Exception e) {
+      LoggerFactory.getLogger(AINodeClient.class)
+          .debug("[AINodeClient] refreshFromConfigNode failed: {}", e.toString());
+    }
+    return null;
+  }
+
+  private static TEndPoint pickEndpointFrom(final TAINodeLocation loc) {
+    if (loc == null) return null;
+    if (loc.isSetInternalEndPoint() && loc.getInternalEndPoint() != null) {
+      return loc.getInternalEndPoint();
+    }
+    return null;
+  }
+
   public AINodeClient(
       ThriftClientProperty property,
       TEndPoint endPoint,
@@ -98,6 +185,7 @@ public class AINodeClient implements AutoCloseable, ThriftClient {
       throws TException {
     this.property = property;
     this.clientManager = clientManager;
+    // Instance default endpoint (pool key). Global location can override it on retries.
     this.endPoint = endPoint;
     init();
   }
@@ -188,76 +276,28 @@ public class AINodeClient implements AutoCloseable, ThriftClient {
         modelName, inputShape, outputShape, inputType, outputType, attributes);
   }
 
-  public TSStatus deleteModel(String modelId) throws TException {
-    try {
-      return client.deleteModel(new TDeleteModelReq(modelId));
-    } catch (TException e) {
-      logger.warn(
-          "Failed to connect to AINode from ConfigNode when executing {}: {}",
-          Thread.currentThread().getStackTrace()[1].getMethodName(),
-          e.getMessage());
-      throw new TException(MSG_CONNECTION_FAIL);
-    }
+  public TSStatus deleteModel(TDeleteModelReq req) throws TException {
+    return executeRemoteCallWithRetry(c -> c.deleteModel(req));
   }
 
   public TSStatus loadModel(TLoadModelReq req) throws TException {
-    try {
-      return client.loadModel(req);
-    } catch (TException e) {
-      logger.warn(
-          "Failed to connect to AINode from ConfigNode when executing {}: {}",
-          Thread.currentThread().getStackTrace()[1].getMethodName(),
-          e.getMessage());
-      throw new TException(MSG_CONNECTION_FAIL);
-    }
+    return executeRemoteCallWithRetry(c -> c.loadModel(req));
   }
 
   public TSStatus unloadModel(TUnloadModelReq req) throws TException {
-    try {
-      return client.unloadModel(req);
-    } catch (TException e) {
-      logger.warn(
-          "Failed to connect to AINode from ConfigNode when executing {}: {}",
-          Thread.currentThread().getStackTrace()[1].getMethodName(),
-          e.getMessage());
-      throw new TException(MSG_CONNECTION_FAIL);
-    }
+    return executeRemoteCallWithRetry(c -> c.unloadModel(req));
   }
 
   public TShowModelsResp showModels(TShowModelsReq req) throws TException {
-    try {
-      return client.showModels(req);
-    } catch (TException e) {
-      logger.warn(
-          "Failed to connect to AINode from ConfigNode when executing {}: {}",
-          Thread.currentThread().getStackTrace()[1].getMethodName(),
-          e.getMessage());
-      throw new TException(MSG_CONNECTION_FAIL);
-    }
+    return executeRemoteCallWithRetry(c -> c.showModels(req));
   }
 
   public TShowLoadedModelsResp showLoadedModels(TShowLoadedModelsReq req) throws TException {
-    try {
-      return client.showLoadedModels(req);
-    } catch (TException e) {
-      logger.warn(
-          "Failed to connect to AINode from ConfigNode when executing {}: {}",
-          Thread.currentThread().getStackTrace()[1].getMethodName(),
-          e.getMessage());
-      throw new TException(MSG_CONNECTION_FAIL);
-    }
+    return executeRemoteCallWithRetry(c -> c.showLoadedModels(req));
   }
 
   public TShowAIDevicesResp showAIDevices() throws TException {
-    try {
-      return client.showAIDevices();
-    } catch (TException e) {
-      logger.warn(
-          "Failed to connect to AINode from ConfigNode when executing {}: {}",
-          Thread.currentThread().getStackTrace()[1].getMethodName(),
-          e.getMessage());
-      throw new TException(MSG_CONNECTION_FAIL);
-    }
+    return executeRemoteCallWithRetry(IAINodeRPCService.Client::showAIDevices);
   }
 
   public TInferenceResp inference(
@@ -274,7 +314,7 @@ public class AINodeClient implements AutoCloseable, ThriftClient {
       if (inferenceAttributes != null) {
         inferenceReq.setInferenceAttributes(inferenceAttributes);
       }
-      return client.inference(inferenceReq);
+      return executeRemoteCallWithRetry(c -> c.inference(inferenceReq));
     } catch (IOException e) {
       throw new TException("An exception occurred while serializing input data", e);
     } catch (TException e) {
@@ -292,7 +332,7 @@ public class AINodeClient implements AutoCloseable, ThriftClient {
       TForecastReq forecastReq =
           new TForecastReq(modelId, tsBlockSerde.serialize(inputTsBlock), outputLength);
       forecastReq.setOptions(options);
-      return client.forecast(forecastReq);
+      return executeRemoteCallWithRetry(c -> c.forecast(forecastReq));
     } catch (IOException e) {
       TSStatus tsStatus = new TSStatus(INTERNAL_SERVER_ERROR.getStatusCode());
       tsStatus.setMessage(String.format("Failed to serialize input tsblock %s", e.getMessage()));
@@ -308,15 +348,7 @@ public class AINodeClient implements AutoCloseable, ThriftClient {
   }
 
   public TSStatus createTrainingTask(TTrainingReq req) throws TException {
-    try {
-      return client.createTrainingTask(req);
-    } catch (TException e) {
-      logger.warn(
-          "Failed to connect to AINode when executing {}: {}",
-          Thread.currentThread().getStackTrace()[1].getMethodName(),
-          e.getMessage());
-      throw new TException(MSG_CONNECTION_FAIL);
-    }
+    return executeRemoteCallWithRetry(c -> c.createTrainingTask(req));
   }
 
   @Override
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ainode/AINodeClientManager.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ainode/AINodeClientManager.java
new file mode 100644
index 00000000000..faef1c1ae7b
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ainode/AINodeClientManager.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.protocol.client.ainode;
+
+import org.apache.iotdb.common.rpc.thrift.TEndPoint;
+import org.apache.iotdb.commons.client.IClientManager;
+import org.apache.iotdb.db.protocol.client.AINodeClientFactory;
+
+public class AINodeClientManager {
+
+  public static final int DEFAULT_AINODE_ID = 0;
+
+  private static final AINodeClientManager INSTANCE = new AINodeClientManager();
+
+  private final IClientManager<TEndPoint, AINodeClient> clientManager;
+
+  private volatile TEndPoint defaultAINodeEndPoint;
+
+  private AINodeClientManager() {
+    this.clientManager =
+        new IClientManager.Factory<TEndPoint, AINodeClient>()
+            .createClientManager(new AINodeClientFactory.AINodeClientPoolFactory());
+  }
+
+  public static AINodeClientManager getInstance() {
+    return INSTANCE;
+  }
+
+  public void updateDefaultAINodeLocation(TEndPoint endPoint) {
+    this.defaultAINodeEndPoint = endPoint;
+  }
+
+  public AINodeClient borrowClient(TEndPoint endPoint) throws Exception {
+    return clientManager.borrowClient(endPoint);
+  }
+
+  public AINodeClient borrowClient(int aiNodeId) throws Exception {
+    if (aiNodeId != DEFAULT_AINODE_ID) {
+      throw new IllegalArgumentException("Unsupported AINodeId: " + aiNodeId);
+    }
+    if (defaultAINodeEndPoint == null) {
+      defaultAINodeEndPoint = AINodeClient.getCurrentEndpoint();
+    }
+    return clientManager.borrowClient(defaultAINodeEndPoint);
+  }
+
+  public void clear(TEndPoint endPoint) {
+    clientManager.clear(endPoint);
+  }
+
+  public void clearAll() {
+    clientManager.close();
+  }
+
+  public IClientManager<TEndPoint, AINodeClient> getRawClientManager() {
+    return clientManager;
+  }
+}
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AsyncAINodeServiceClient.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ainode/AsyncAINodeServiceClient.java
similarity index 98%
rename from iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AsyncAINodeServiceClient.java
rename to iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ainode/AsyncAINodeServiceClient.java
index ba0b1d11e70..26130287697 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AsyncAINodeServiceClient.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ainode/AsyncAINodeServiceClient.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.iotdb.commons.client.ainode;
+package org.apache.iotdb.db.protocol.client.ainode;
 
 import org.apache.iotdb.ainode.rpc.thrift.IAINodeRPCService;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/ai/InferenceOperator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/ai/InferenceOperator.java
index ccdef60aaf0..7126af78b8b 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/ai/InferenceOperator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/ai/InferenceOperator.java
@@ -21,9 +21,9 @@ package org.apache.iotdb.db.queryengine.execution.operator.process.ai;
 
 import org.apache.iotdb.ainode.rpc.thrift.TInferenceResp;
 import org.apache.iotdb.ainode.rpc.thrift.TWindowParams;
-import org.apache.iotdb.commons.client.ainode.AINodeClient;
-import org.apache.iotdb.commons.client.ainode.AINodeClientManager;
 import org.apache.iotdb.db.exception.runtime.ModelInferenceProcessException;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClientManager;
 import org.apache.iotdb.db.queryengine.execution.MemoryEstimationHelper;
 import org.apache.iotdb.db.queryengine.execution.operator.Operator;
 import org.apache.iotdb.db.queryengine.execution.operator.OperatorContext;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/InformationSchemaContentSupplierFactory.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/InformationSchemaContentSupplierFactory.java
index db36048fcd0..51c8c72e894 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/InformationSchemaContentSupplierFactory.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/InformationSchemaContentSupplierFactory.java
@@ -19,11 +19,14 @@
 
 package org.apache.iotdb.db.queryengine.execution.operator.source.relational;
 
+import org.apache.iotdb.ainode.rpc.thrift.TShowModelsReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowModelsResp;
 import org.apache.iotdb.common.rpc.thrift.Model;
 import org.apache.iotdb.common.rpc.thrift.TAINodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
 import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
+import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.commons.audit.UserEntity;
 import org.apache.iotdb.commons.conf.IoTDBConstant;
 import org.apache.iotdb.commons.exception.IoTDBRuntimeException;
@@ -51,8 +54,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TGetUdfTableReq;
 import org.apache.iotdb.confignode.rpc.thrift.TNodeVersionInfo;
 import org.apache.iotdb.confignode.rpc.thrift.TRegionInfo;
 import org.apache.iotdb.confignode.rpc.thrift.TShowClusterResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeInfo;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowRegionReq;
@@ -66,6 +67,8 @@ import org.apache.iotdb.db.pipe.metric.overview.PipeDataNodeSinglePipeMetrics;
 import org.apache.iotdb.db.protocol.client.ConfigNodeClient;
 import org.apache.iotdb.db.protocol.client.ConfigNodeClientManager;
 import org.apache.iotdb.db.protocol.client.ConfigNodeInfo;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClientManager;
 import org.apache.iotdb.db.protocol.session.IClientSession;
 import org.apache.iotdb.db.queryengine.plan.Coordinator;
 import org.apache.iotdb.db.queryengine.plan.execution.IQueryExecution;
@@ -789,18 +792,18 @@ public class InformationSchemaContentSupplierFactory {
 
     private ModelsSupplier(final List<TSDataType> dataTypes) throws Exception {
       super(dataTypes);
-      try (final ConfigNodeClient client =
-          ConfigNodeClientManager.getInstance().borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
-        iterator = new ModelIterator(client.showModel(new TShowModelReq()));
+      final TEndPoint ep = AINodeClient.getCurrentEndpoint();
+      try (final AINodeClient ai = AINodeClientManager.getInstance().borrowClient(ep)) {
+        iterator = new ModelIterator(ai.showModels(new TShowModelsReq()));
       }
     }
 
     private static class ModelIterator implements Iterator<ModelInfoInString> {
 
       private int index = 0;
-      private final TShowModelResp resp;
+      private final TShowModelsResp resp;
 
-      private ModelIterator(TShowModelResp resp) {
+      private ModelIterator(TShowModelsResp resp) {
         this.resp = resp;
       }
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
index 517e201f3d8..beba9896f0b 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
@@ -19,6 +19,14 @@
 
 package org.apache.iotdb.db.queryengine.plan.execution.config.executor;
 
+import org.apache.iotdb.ainode.rpc.thrift.TLoadModelReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowAIDevicesResp;
+import org.apache.iotdb.ainode.rpc.thrift.TShowLoadedModelsReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowLoadedModelsResp;
+import org.apache.iotdb.ainode.rpc.thrift.TShowModelsReq;
+import org.apache.iotdb.ainode.rpc.thrift.TShowModelsResp;
+import org.apache.iotdb.ainode.rpc.thrift.TTrainingReq;
+import org.apache.iotdb.ainode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.common.rpc.thrift.FunctionType;
 import org.apache.iotdb.common.rpc.thrift.Model;
 import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
@@ -93,12 +101,9 @@ import org.apache.iotdb.confignode.rpc.thrift.TCreatePipePluginReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreatePipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateTableViewReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateTopicReq;
-import org.apache.iotdb.confignode.rpc.thrift.TCreateTrainingReq;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateTriggerReq;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRemoveReq;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRemoveResp;
-import org.apache.iotdb.confignode.rpc.thrift.TDataSchemaForTable;
-import org.apache.iotdb.confignode.rpc.thrift.TDataSchemaForTree;
 import org.apache.iotdb.confignode.rpc.thrift.TDatabaseSchema;
 import org.apache.iotdb.confignode.rpc.thrift.TDeactivateSchemaTemplateReq;
 import org.apache.iotdb.confignode.rpc.thrift.TDeleteDatabasesReq;
@@ -129,24 +134,18 @@ import org.apache.iotdb.confignode.rpc.thrift.TGetTimeSlotListResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetTriggerTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetUDFTableResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetUdfTableReq;
-import org.apache.iotdb.confignode.rpc.thrift.TLoadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TMigrateRegionReq;
 import org.apache.iotdb.confignode.rpc.thrift.TPipeConfigTransferReq;
 import org.apache.iotdb.confignode.rpc.thrift.TPipeConfigTransferResp;
 import org.apache.iotdb.confignode.rpc.thrift.TReconstructRegionReq;
 import org.apache.iotdb.confignode.rpc.thrift.TRegionInfo;
 import org.apache.iotdb.confignode.rpc.thrift.TRemoveRegionReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowAIDevicesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowAINodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowCQResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowClusterResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowConfigNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDatabaseResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelResp;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelReq;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeInfo;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipePluginReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowPipeReq;
@@ -164,7 +163,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TSpaceQuotaResp;
 import org.apache.iotdb.confignode.rpc.thrift.TStartPipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TStopPipeReq;
 import org.apache.iotdb.confignode.rpc.thrift.TThrottleQuotaResp;
-import org.apache.iotdb.confignode.rpc.thrift.TUnloadModelReq;
 import org.apache.iotdb.confignode.rpc.thrift.TUnsetSchemaTemplateReq;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.exception.BatchProcessException;
@@ -177,6 +175,8 @@ import org.apache.iotdb.db.protocol.client.ConfigNodeClient;
 import org.apache.iotdb.db.protocol.client.ConfigNodeClientManager;
 import org.apache.iotdb.db.protocol.client.ConfigNodeInfo;
 import org.apache.iotdb.db.protocol.client.DataNodeClientPoolFactory;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClientManager;
 import org.apache.iotdb.db.protocol.session.IClientSession;
 import org.apache.iotdb.db.protocol.session.SessionManager;
 import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
@@ -3627,20 +3627,19 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
   @Override
   public SettableFuture<ConfigTaskResult> showModels(final String modelId) {
     final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
-    try (final ConfigNodeClient client =
-        CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
-      final TShowModelReq req = new TShowModelReq();
+    try (final AINodeClient ai =
+        AINodeClientManager.getInstance().borrowClient(AINodeClientManager.DEFAULT_AINODE_ID)) {
+      final TShowModelsReq req = new TShowModelsReq();
       if (modelId != null) {
         req.setModelId(modelId);
       }
-      final TShowModelResp showModelResp = client.showModel(req);
-      if (showModelResp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-        future.setException(new IoTDBException(showModelResp.getStatus()));
+      final TShowModelsResp resp = ai.showModels(req);
+      if (resp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+        future.setException(new IoTDBException(resp.getStatus()));
         return future;
       }
-      // convert model info list and buildTsBlock
-      ShowModelsTask.buildTsBlock(showModelResp, future);
-    } catch (final ClientManagerException | TException e) {
+      ShowModelsTask.buildTsBlock(resp, future);
+    } catch (final Exception e) {
       future.setException(e);
     }
     return future;
@@ -3649,21 +3648,17 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
   @Override
   public SettableFuture<ConfigTaskResult> showLoadedModels(List<String> deviceIdList) {
     final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
-    try (final ConfigNodeClient client =
-        CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
-      final TShowLoadedModelReq req = new TShowLoadedModelReq();
-      if (deviceIdList != null) {
-        req.setDeviceIdList(deviceIdList);
-      } else {
-        req.setDeviceIdList(new ArrayList<>());
-      }
-      final TShowLoadedModelResp resp = client.showLoadedModel(req);
+    try (final AINodeClient ai =
+        AINodeClientManager.getInstance().borrowClient(AINodeClientManager.DEFAULT_AINODE_ID)) {
+      final TShowLoadedModelsReq req = new TShowLoadedModelsReq();
+      req.setDeviceIdList(deviceIdList != null ? deviceIdList : new ArrayList<>());
+      final TShowLoadedModelsResp resp = ai.showLoadedModels(req);
       if (resp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
         future.setException(new IoTDBException(resp.getStatus()));
         return future;
       }
       ShowLoadedModelsTask.buildTsBlock(resp, future);
-    } catch (final ClientManagerException | TException e) {
+    } catch (final Exception e) {
       future.setException(e);
     }
     return future;
@@ -3672,15 +3667,15 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
   @Override
   public SettableFuture<ConfigTaskResult> showAIDevices() {
     final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
-    try (final ConfigNodeClient client =
-        CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
-      final TShowAIDevicesResp resp = client.showAIDevices();
+    try (final AINodeClient ai =
+        AINodeClientManager.getInstance().borrowClient(AINodeClientManager.DEFAULT_AINODE_ID)) {
+      final TShowAIDevicesResp resp = ai.showAIDevices();
       if (resp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
         future.setException(new IoTDBException(resp.getStatus()));
         return future;
       }
       ShowAIDevicesTask.buildTsBlock(resp, future);
-    } catch (final ClientManagerException | TException e) {
+    } catch (final Exception e) {
       future.setException(e);
     }
     return future;
@@ -3690,16 +3685,16 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
   public SettableFuture<ConfigTaskResult> loadModel(
       String existingModelId, List<String> deviceIdList) {
     final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
-    try (final ConfigNodeClient client =
-        CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
+    try (final AINodeClient ai =
+        AINodeClientManager.getInstance().borrowClient(AINodeClientManager.DEFAULT_AINODE_ID)) {
       final TLoadModelReq req = new TLoadModelReq(existingModelId, deviceIdList);
-      final TSStatus result = client.loadModel(req);
+      final TSStatus result = ai.loadModel(req);
       if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != result.getCode()) {
         future.setException(new IoTDBException(result));
       } else {
         future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS));
       }
-    } catch (final ClientManagerException | TException e) {
+    } catch (final Exception e) {
       future.setException(e);
     }
     return future;
@@ -3709,16 +3704,16 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
   public SettableFuture<ConfigTaskResult> unloadModel(
       String existingModelId, List<String> deviceIdList) {
     final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
-    try (final ConfigNodeClient client =
-        CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
+    try (final AINodeClient ai =
+        AINodeClientManager.getInstance().borrowClient(AINodeClientManager.DEFAULT_AINODE_ID)) {
       final TUnloadModelReq req = new TUnloadModelReq(existingModelId, deviceIdList);
-      final TSStatus result = client.unloadModel(req);
+      final TSStatus result = ai.unloadModel(req);
       if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != result.getCode()) {
         future.setException(new IoTDBException(result));
       } else {
         future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS));
       }
-    } catch (final ClientManagerException | TException e) {
+    } catch (final Exception e) {
       future.setException(e);
     }
     return future;
@@ -3734,28 +3729,24 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
       @Nullable String targetSql,
       @Nullable List<String> pathList) {
     final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
-    try (final ConfigNodeClient client =
-        CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
-      final TCreateTrainingReq req = new TCreateTrainingReq(modelId, isTableModel, existingModelId);
-
-      if (isTableModel) {
-        TDataSchemaForTable dataSchemaForTable = new TDataSchemaForTable();
-        dataSchemaForTable.setTargetSql(targetSql);
-        req.setDataSchemaForTable(dataSchemaForTable);
-      } else {
-        TDataSchemaForTree dataSchemaForTree = new TDataSchemaForTree();
-        dataSchemaForTree.setPath(pathList);
-        req.setDataSchemaForTree(dataSchemaForTree);
-      }
+    try (final AINodeClient ai =
+        AINodeClientManager.getInstance().borrowClient(AINodeClientManager.DEFAULT_AINODE_ID)) {
+      final TTrainingReq req = new TTrainingReq();
+      req.setModelId(modelId);
       req.setParameters(parameters);
-      req.setTimeRanges(timeRanges);
-      final TSStatus executionStatus = client.createTraining(req);
-      if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != executionStatus.getCode()) {
-        future.setException(new IoTDBException(executionStatus));
+      if (existingModelId != null) {
+        req.setExistingModelId(existingModelId);
+      }
+      if (existingModelId != null) {
+        req.setExistingModelId(existingModelId);
+      }
+      final TSStatus status = ai.createTrainingTask(req);
+      if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != status.getCode()) {
+        future.setException(new IoTDBException(status));
       } else {
         future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS));
       }
-    } catch (final ClientManagerException | TException e) {
+    } catch (final Exception e) {
       future.setException(e);
     }
     return future;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowAIDevicesTask.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowAIDevicesTask.java
index d2cdd967595..690f6f9485f 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowAIDevicesTask.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowAIDevicesTask.java
@@ -19,9 +19,9 @@
 
 package org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ai;
 
+import org.apache.iotdb.ainode.rpc.thrift.TShowAIDevicesResp;
 import org.apache.iotdb.commons.schema.column.ColumnHeader;
 import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
-import org.apache.iotdb.confignode.rpc.thrift.TShowAIDevicesResp;
 import org.apache.iotdb.db.queryengine.common.header.DatasetHeader;
 import org.apache.iotdb.db.queryengine.common.header.DatasetHeaderFactory;
 import org.apache.iotdb.db.queryengine.plan.execution.config.ConfigTaskResult;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowLoadedModelsTask.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowLoadedModelsTask.java
index 5beb8a6a5aa..c8c6f8938f7 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowLoadedModelsTask.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowLoadedModelsTask.java
@@ -19,9 +19,9 @@
 
 package org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ai;
 
+import org.apache.iotdb.ainode.rpc.thrift.TShowLoadedModelsResp;
 import org.apache.iotdb.commons.schema.column.ColumnHeader;
 import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
-import org.apache.iotdb.confignode.rpc.thrift.TShowLoadedModelResp;
 import org.apache.iotdb.db.queryengine.common.header.DatasetHeader;
 import org.apache.iotdb.db.queryengine.common.header.DatasetHeaderFactory;
 import org.apache.iotdb.db.queryengine.plan.execution.config.ConfigTaskResult;
@@ -54,7 +54,7 @@ public class ShowLoadedModelsTask implements IConfigTask {
   }
 
   public static void buildTsBlock(
-      TShowLoadedModelResp resp, SettableFuture<ConfigTaskResult> future) {
+      TShowLoadedModelsResp resp, SettableFuture<ConfigTaskResult> future) {
     List<TSDataType> outputDataTypes =
         ColumnHeaderConstant.showLoadedModelsColumnHeaders.stream()
             .map(ColumnHeader::getColumnType)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowModelsTask.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowModelsTask.java
index 73c5b1b6f7d..c0d7f4ef203 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowModelsTask.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/ai/ShowModelsTask.java
@@ -19,9 +19,9 @@
 
 package org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ai;
 
+import org.apache.iotdb.ainode.rpc.thrift.TShowModelsResp;
 import org.apache.iotdb.commons.schema.column.ColumnHeader;
 import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
-import org.apache.iotdb.confignode.rpc.thrift.TShowModelResp;
 import org.apache.iotdb.db.queryengine.common.header.DatasetHeader;
 import org.apache.iotdb.db.queryengine.common.header.DatasetHeaderFactory;
 import org.apache.iotdb.db.queryengine.plan.execution.config.ConfigTaskResult;
@@ -59,7 +59,7 @@ public class ShowModelsTask implements IConfigTask {
     return configTaskExecutor.showModels(modelName);
   }
 
-  public static void buildTsBlock(TShowModelResp resp, SettableFuture<ConfigTaskResult> future) {
+  public static void buildTsBlock(TShowModelsResp resp, SettableFuture<ConfigTaskResult> future) {
     List<String> modelIdList = resp.getModelIdList();
     Map<String, String> modelTypeMap = resp.getModelTypeMap();
     Map<String, String> categoryMap = resp.getCategoryMap();
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/ForecastTableFunction.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/ForecastTableFunction.java
index 5521062a24e..887d7c26d30 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/ForecastTableFunction.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/ForecastTableFunction.java
@@ -21,11 +21,10 @@ package org.apache.iotdb.db.queryengine.plan.relational.function.tvf;
 
 import org.apache.iotdb.ainode.rpc.thrift.TForecastResp;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
-import org.apache.iotdb.commons.client.IClientManager;
-import org.apache.iotdb.commons.client.ainode.AINodeClient;
-import org.apache.iotdb.commons.client.ainode.AINodeClientManager;
 import org.apache.iotdb.commons.exception.IoTDBRuntimeException;
 import org.apache.iotdb.db.exception.sql.SemanticException;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClientManager;
 import org.apache.iotdb.db.queryengine.plan.analyze.IModelFetcher;
 import org.apache.iotdb.db.queryengine.plan.planner.plan.parameter.model.ModelInferenceDescriptor;
 import org.apache.iotdb.rpc.TSStatusCode;
@@ -457,8 +456,7 @@ public class ForecastTableFunction implements TableFunction {
   private static class ForecastDataProcessor implements TableFunctionDataProcessor {
 
     private static final TsBlockSerde SERDE = new TsBlockSerde();
-    private static final IClientManager<TEndPoint, AINodeClient> CLIENT_MANAGER =
-        AINodeClientManager.getInstance();
+    private static final AINodeClientManager CLIENT_MANAGER = AINodeClientManager.getInstance();
 
     private final TEndPoint targetAINode;
     private final String modelId;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java
index 22c2bce7b5e..e77e0641ae9 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java
@@ -21,10 +21,9 @@ package org.apache.iotdb.db.queryengine.plan.udf;
 
 import org.apache.iotdb.ainode.rpc.thrift.TForecastResp;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
-import org.apache.iotdb.commons.client.IClientManager;
-import org.apache.iotdb.commons.client.ainode.AINodeClient;
-import org.apache.iotdb.commons.client.ainode.AINodeClientManager;
 import org.apache.iotdb.commons.exception.IoTDBRuntimeException;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClient;
+import org.apache.iotdb.db.protocol.client.ainode.AINodeClientManager;
 import org.apache.iotdb.db.queryengine.plan.analyze.IModelFetcher;
 import org.apache.iotdb.db.queryengine.plan.analyze.ModelFetcher;
 import org.apache.iotdb.db.queryengine.plan.planner.plan.parameter.model.ModelInferenceDescriptor;
@@ -55,8 +54,7 @@ import java.util.stream.Collectors;
 
 public class UDTFForecast implements UDTF {
   private static final TsBlockSerde serde = new TsBlockSerde();
-  private static final IClientManager<TEndPoint, AINodeClient> CLIENT_MANAGER =
-      AINodeClientManager.getInstance();
+  private static final AINodeClientManager CLIENT_MANAGER = AINodeClientManager.getInstance();
   private TEndPoint targetAINode = new TEndPoint("127.0.0.1", 10810);
   private String model_id;
   private int maxInputLength;
diff --git a/iotdb-core/node-commons/pom.xml b/iotdb-core/node-commons/pom.xml
index 9e74e999fc4..4a42198f5b5 100644
--- a/iotdb-core/node-commons/pom.xml
+++ b/iotdb-core/node-commons/pom.xml
@@ -179,12 +179,6 @@
             <groupId>com.timecho.ratis</groupId>
             <artifactId>ratis-common</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.iotdb</groupId>
-            <artifactId>iotdb-thrift-ainode</artifactId>
-            <version>2.0.6-SNAPSHOT</version>
-            <scope>compile</scope>
-        </dependency>
     </dependencies>
     <build>
         <resources>
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java
index 32c6345dc27..106d67b6279 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ClientPoolFactory.java
@@ -20,8 +20,6 @@
 package org.apache.iotdb.commons.client;
 
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
-import org.apache.iotdb.commons.client.ainode.AINodeClient;
-import org.apache.iotdb.commons.client.ainode.AsyncAINodeServiceClient;
 import org.apache.iotdb.commons.client.async.AsyncConfigNodeInternalServiceClient;
 import org.apache.iotdb.commons.client.async.AsyncDataNodeExternalServiceClient;
 import org.apache.iotdb.commons.client.async.AsyncDataNodeInternalServiceClient;
@@ -325,56 +323,6 @@ public class ClientPoolFactory {
     }
   }
 
-  public static class AsyncAINodeHeartbeatServiceClientPoolFactory
-      implements IClientPoolFactory<TEndPoint, AsyncAINodeServiceClient> {
-    @Override
-    public GenericKeyedObjectPool<TEndPoint, AsyncAINodeServiceClient> createClientPool(
-        ClientManager<TEndPoint, AsyncAINodeServiceClient> manager) {
-      GenericKeyedObjectPool<TEndPoint, AsyncAINodeServiceClient> clientPool =
-          new GenericKeyedObjectPool<>(
-              new AsyncAINodeServiceClient.Factory(
-                  manager,
-                  new ThriftClientProperty.Builder()
-                      .setConnectionTimeoutMs(conf.getCnConnectionTimeoutInMS())
-                      .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
-                      .setSelectorNumOfAsyncClientManager(conf.getSelectorNumOfClientManager())
-                      .setPrintLogWhenEncounterException(false)
-                      .build(),
-                  ThreadName.ASYNC_DATANODE_HEARTBEAT_CLIENT_POOL.getName()),
-              new ClientPoolProperty.Builder<AsyncAINodeServiceClient>()
-                  .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
-                  .build()
-                  .getConfig());
-      ClientManagerMetrics.getInstance()
-          .registerClientManager(this.getClass().getSimpleName(), clientPool);
-      return clientPool;
-    }
-  }
-
-  public static class AINodeClientPoolFactory
-      implements IClientPoolFactory<TEndPoint, AINodeClient> {
-
-    @Override
-    public GenericKeyedObjectPool<TEndPoint, AINodeClient> createClientPool(
-        ClientManager<TEndPoint, AINodeClient> manager) {
-      GenericKeyedObjectPool<TEndPoint, AINodeClient> clientPool =
-          new GenericKeyedObjectPool<>(
-              new AINodeClient.Factory(
-                  manager,
-                  new ThriftClientProperty.Builder()
-                      .setConnectionTimeoutMs(conf.getDnConnectionTimeoutInMS())
-                      .setRpcThriftCompressionEnabled(conf.isRpcThriftCompressionEnabled())
-                      .build()),
-              new ClientPoolProperty.Builder<AINodeClient>()
-                  .setMaxClientNumForEachNode(conf.getMaxClientNumForEachNode())
-                  .build()
-                  .getConfig());
-      ClientManagerMetrics.getInstance()
-          .registerClientManager(this.getClass().getSimpleName(), clientPool);
-      return clientPool;
-    }
-  }
-
   public static class SyncPipeConsensusServiceClientPoolFactory
       implements IClientPoolFactory<TEndPoint, SyncPipeConsensusServiceClient> {
 
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClientManager.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClientManager.java
deleted file mode 100644
index 3a06e478e7b..00000000000
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ainode/AINodeClientManager.java
+++ /dev/null
@@ -1,40 +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.commons.client.ainode;
-
-import org.apache.iotdb.common.rpc.thrift.TEndPoint;
-import org.apache.iotdb.commons.client.ClientPoolFactory;
-import org.apache.iotdb.commons.client.IClientManager;
-
-public class AINodeClientManager {
-  private AINodeClientManager() {
-    // Empty constructor
-  }
-
-  private static final class AINodeClientManagerHolder {
-    private static final IClientManager<TEndPoint, AINodeClient> INSTANCE =
-        new IClientManager.Factory<TEndPoint, AINodeClient>()
-            .createClientManager(new ClientPoolFactory.AINodeClientPoolFactory());
-  }
-
-  public static IClientManager<TEndPoint, AINodeClient> getInstance() {
-    return AINodeClientManagerHolder.INSTANCE;
-  }
-}
diff --git a/iotdb-protocol/thrift-confignode/src/main/thrift/confignode.thrift b/iotdb-protocol/thrift-confignode/src/main/thrift/confignode.thrift
index 3ee3ca89bdc..d8f6318063e 100644
--- a/iotdb-protocol/thrift-confignode/src/main/thrift/confignode.thrift
+++ b/iotdb-protocol/thrift-confignode/src/main/thrift/confignode.thrift
@@ -659,6 +659,13 @@ struct TAINodeInfo {
   4: required i32 internalPort
 }
 
+// ----------- New messages -----------
+
+struct TGetAINodeLocationResp {
+  1: required common.TSStatus status
+  2: optional common.TAINodeLocation aiNodeLocation
+}
+
 struct TShowDataNodes4InformationSchemaResp {
   1: required common.TSStatus status
   2: optional list<TDataNodeInfo4InformationSchema> dataNodesInfoList
@@ -1098,42 +1105,6 @@ struct TDropModelReq {
   1: required string modelId
 }
 
-struct TShowModelReq {
-  1: optional string modelId
-}
-
-struct TShowModelResp {
-  1: required common.TSStatus status
-  2: optional list<string> modelIdList
-  3: optional map<string, string> modelTypeMap
-  4: optional map<string, string> categoryMap
-  5: optional map<string, string> stateMap
-}
-
-struct TShowLoadedModelReq {
-    1: required list<string> deviceIdList
-}
-
-struct TShowLoadedModelResp {
-  1: required common.TSStatus status
-  2: required map<string, map<string, i32>> deviceLoadedModelsMap
-}
-
-struct TShowAIDevicesResp {
-    1: required common.TSStatus status
-    2: required list<string> deviceIdList
-}
-
-struct TLoadModelReq {
-  1: required string existingModelId
-  2: required list<string> deviceIdList
-}
-
-struct TUnloadModelReq {
-  1: required string modelId
-  2: required list<string> deviceIdList
-}
-
 struct TGetModelInfoReq {
   1: required string modelId
 }
@@ -1371,6 +1342,11 @@ service IConfigNodeRPCService {
 
   TAINodeConfigurationResp getAINodeConfiguration(i32 aiNodeId)
 
+  /**
+   * Return a reachable AINode location.
+   */
+  TGetAINodeLocationResp getAINodeLocation()
+
   /**
    * Get system configurations. i.e. configurations that is not associated with the DataNodeId
    */
@@ -2049,43 +2025,12 @@ service IConfigNodeRPCService {
   common.TSStatus dropModel(TDropModelReq req)
 
   /**
-   * Return the model table
-   */
-  TShowModelResp showModel(TShowModelReq req)
-
-  /**
-   * Return the loaded model table
-   */
-  TShowLoadedModelResp showLoadedModel(TShowLoadedModelReq req)
-
-  /**
-   * Return the available ai devices
-   */
-  TShowAIDevicesResp showAIDevices()
-
-  /**
-   * Load an existing model to specific devices
-   *
-   * @return SUCCESS_STATUS if the model loading task was submitted successfully
-   */
-  common.TSStatus loadModel(TLoadModelReq req)
-
-  /**
-   * Unload an existing model to specific devices
-   *
-   * @return SUCCESS_STATUS if the model unloading task was submitted successfully
-   */
-  common.TSStatus unloadModel(TUnloadModelReq req)
-
-   /**
-   * Return the model info by model_id
-   */
+  * Return the model info by model_id
+  */
   TGetModelInfoResp getModelInfo(TGetModelInfoReq req)
 
   common.TSStatus updateModelInfo(TUpdateModelInfoReq req)
 
-  common.TSStatus createTraining(TCreateTrainingReq req)
-
   // ======================================================
   // Quota
   // ======================================================


(iotdb) 08/45: Pipe: Fix unhandled timeout exceptions in Thrift Client (#16727)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit d24cddadbd2f80fb4b1e7896515e5ddc508aeb95
Author: Zhenyu Luo <zh...@apache.org>
AuthorDate: Tue Nov 11 10:50:20 2025 +0800

    Pipe: Fix unhandled timeout exceptions in Thrift Client (#16727)
    
    * Pipe: Fix unhandled timeout exceptions in Thrift Client
    
    * update
    
    (cherry picked from commit 93c55577e6f051307fa97656b17150aa038cb5de)
---
 .../src/main/java/org/apache/iotdb/commons/client/ThriftClient.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ThriftClient.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ThriftClient.java
index 6c1b9d3fb0a..0b78e51a99a 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ThriftClient.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/ThriftClient.java
@@ -115,7 +115,8 @@ public interface ThriftClient {
             && (hasExpectedMessage(cause, "Connection reset by peer")
                 || hasExpectedMessage(cause, "Broken pipe")))
         || (cause instanceof ConnectException && hasExpectedMessage(cause, "Connection refused")
-            || (cause instanceof ClosedChannelException));
+            || (cause instanceof ClosedChannelException))
+        || (cause instanceof java.util.concurrent.TimeoutException);
   }
 
   static boolean hasExpectedMessage(Throwable cause, String expectedMessage) {


(iotdb) 09/45: Fixed the procedure has_more_state bug & Fixed the IT for encoding & compressor (#16729)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 15f39d4854302b7cef2cb44a88c5e3f0479fb9fa
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Tue Nov 11 14:18:08 2025 +0800

    Fixed the procedure has_more_state bug & Fixed the IT for encoding & compressor (#16729)
    
    * IT-fix
    
    * fix
    
    (cherry picked from commit 468a91a4d2e7c014b14f5712d400bcc68905e563)
---
 .../it/dual/treemodel/manual/IoTDBPipeInclusionIT.java   | 16 ++++++++++++----
 .../impl/schema/AlterEncodingCompressorProcedure.java    |  9 ++++++---
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/manual/IoTDBPipeInclusionIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/manual/IoTDBPipeInclusionIT.java
index 4778f1f9b9b..61eaf14bb4e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/manual/IoTDBPipeInclusionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/manual/IoTDBPipeInclusionIT.java
@@ -81,8 +81,7 @@ public class IoTDBPipeInclusionIT extends AbstractPipeDualTreeModelManualIT {
               // banned
               "create timeSeries root.ln.wf01.wt01.status with datatype=BOOLEAN,encoding=PLAIN",
               "ALTER timeSeries root.ln.wf01.wt01.status ADD TAGS tag3=v3",
-              "ALTER timeSeries root.ln.wf01.wt01.status ADD ATTRIBUTES attr4=v4",
-              "ALTER timeSeries root.** set compressor=ZSTD"),
+              "ALTER timeSeries root.ln.wf01.wt01.status ADD ATTRIBUTES attr4=v4"),
           null);
 
       TestUtils.assertDataEventuallyOnEnv(
@@ -90,14 +89,23 @@ public class IoTDBPipeInclusionIT extends AbstractPipeDualTreeModelManualIT {
           "show timeseries root.ln.**",
           "Timeseries,Alias,Database,DataType,Encoding,Compression,Tags,Attributes,Deadband,DeadbandParameters,ViewType,",
           Collections.singleton(
-              "root.ln.wf01.wt01.status,null,root.ln,BOOLEAN,PLAIN,ZSTD,{\"tag3\":\"v3\"},{\"attr4\":\"v4\"},null,null,BASE,"));
+              "root.ln.wf01.wt01.status,null,root.ln,BOOLEAN,PLAIN,LZ4,{\"tag3\":\"v3\"},{\"attr4\":\"v4\"},null,null,BASE,"));
 
       TestUtils.executeNonQueries(
           senderEnv,
           Arrays.asList(
-              "insert into root.ln.wf01.wt01(time, status) values(now(), false)", "flush"),
+              "ALTER timeSeries root.** set STORAGE_PROPERTIES compressor=ZSTD",
+              "insert into root.ln.wf01.wt01(time, status) values(now(), false)",
+              "flush"),
           null);
 
+      TestUtils.assertDataEventuallyOnEnv(
+          receiverEnv,
+          "show timeseries root.ln.**",
+          "Timeseries,Alias,Database,DataType,Encoding,Compression,Tags,Attributes,Deadband,DeadbandParameters,ViewType,",
+          Collections.singleton(
+              "root.ln.wf01.wt01.status,null,root.ln,BOOLEAN,PLAIN,ZSTD,{\"tag3\":\"v3\"},{\"attr4\":\"v4\"},null,null,BASE,"));
+
       TestUtils.assertDataAlwaysOnEnv(
           receiverEnv, "select * from root.ln.**", "Time,", Collections.emptySet());
     }
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/AlterEncodingCompressorProcedure.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/AlterEncodingCompressorProcedure.java
index 627547ce722..f92cc5d2dd8 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/AlterEncodingCompressorProcedure.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/schema/AlterEncodingCompressorProcedure.java
@@ -126,7 +126,9 @@ public class AlterEncodingCompressorProcedure
                 SerializeUtils.deserializeCompressorNullable(compressor),
                 requestMessage);
           }
-          alterEncodingCompressorInSchemaRegion(env);
+          if (!alterEncodingCompressorInSchemaRegion(env)) {
+            return Flow.NO_MORE_STATE;
+          }
           break;
         case CLEAR_CACHE:
           LOGGER.info("Invalidate cache of timeSeries {}", requestMessage);
@@ -146,7 +148,7 @@ public class AlterEncodingCompressorProcedure
     }
   }
 
-  private void alterEncodingCompressorInSchemaRegion(final ConfigNodeProcedureEnv env) {
+  private boolean alterEncodingCompressorInSchemaRegion(final ConfigNodeProcedureEnv env) {
     final Map<TConsensusGroupId, TRegionReplicaSet> relatedSchemaRegionGroup =
         env.getConfigManager().getRelatedSchemaRegionGroup(patternTree, mayAlterAudit);
 
@@ -160,7 +162,7 @@ public class AlterEncodingCompressorProcedure
                         .collect(Collectors.toList()),
                     false)));
       }
-      return;
+      return false;
     }
 
     final DataNodeTSStatusTaskExecutor<TAlterEncodingCompressorReq> alterEncodingCompressorTask =
@@ -223,6 +225,7 @@ public class AlterEncodingCompressorProcedure
         };
     alterEncodingCompressorTask.execute();
     setNextState(AlterEncodingCompressorState.CLEAR_CACHE);
+    return true;
   }
 
   private void collectPayload4Pipe(final ConfigNodeProcedureEnv env) {


(iotdb) 38/45: Load: Remove the getParentFile and exists checks from Load New File (#16787)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 9488a7ed0e6b4a1b5a1bde3a24bde80ad9c93e0b
Author: Zhenyu Luo <zh...@apache.org>
AuthorDate: Mon Nov 24 09:33:52 2025 +0800

    Load: Remove the getParentFile and exists checks from Load New File (#16787)
    
    (cherry picked from commit 9121208304c2ad930f58ba2d59ac2bd4bd1f1065)
---
 .../java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
index 43c395abc12..f9c34f5c3dc 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
@@ -3552,9 +3552,7 @@ public class DataRegion implements IDataRegionForQuery {
     final File tsfileToBeInserted = newTsFileResource.getTsFile().getAbsoluteFile();
     final long newFilePartitionId = newTsFileResource.getTimePartitionWithCheck();
 
-    if (!TsFileValidator.getInstance().validateTsFile(newTsFileResource)
-        || !tsfileToBeInserted.exists()
-        || tsfileToBeInserted.getParentFile() == null) {
+    if (!TsFileValidator.getInstance().validateTsFile(newTsFileResource)) {
       throw new LoadFileException(
           "tsfile validate failed, " + newTsFileResource.getTsFile().getName());
     }


(iotdb) 15/45: Fix that a deletion test may fail due to inconsistency caused by leader redistribution (#16744)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit a1fe4104c9d855a4b7968de824dd1686335d43d0
Author: Jiang Tian <jt...@163.com>
AuthorDate: Wed Nov 12 21:39:50 2025 +0800

    Fix that a deletion test may fail due to inconsistency caused by leader redistribution (#16744)
    
    (cherry picked from commit b7f9f8d49afcf32ed7739e600e74561b72c65d1b)
---
 .../java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java
index 997a80a76f1..d08e26be4f0 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java
@@ -117,6 +117,8 @@ public class IoTDBDeletionTableIT {
         .setMemtableSizeThreshold(10000);
     // Adjust MemTable threshold size to make it flush automatically
     EnvFactory.getEnv().getConfig().getDataNodeConfig().setCompactionScheduleInterval(5000);
+    // avoid inconsistency caused by leader migration
+    EnvFactory.getEnv().getConfig().getConfigNodeConfig().setLeaderDistributionPolicy("HASH");
     EnvFactory.getEnv().initClusterEnvironment();
   }
 


(iotdb) 31/45: Fixed the bugs related to device auto-create alignment ignorance (#16780)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 842c4a5ffc8e987633594cb57e49ebab43cc97a2
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Thu Nov 20 17:28:25 2025 +0800

    Fixed the bugs related to device auto-create alignment ignorance (#16780)
    
    * plan-first
    
    * refact
    
    * refa
    
    * fux
    
    * fix
    
    * ref
    
    * partial-fix
    
    * fix
    
    * may-final
    
    * fix
    
    * PBTree
    
    * fix
    
    * gras
    
    * err
    
    * bugfix
    
    (cherry picked from commit 9fd9d7e818a8fd6049b9caf3a417f698070bf429)
---
 .../it/schema/IoTDBCreateAlignedTimeseriesIT.java  | 22 +++++++++++
 .../db/it/schema/IoTDBCreateTimeseriesIT.java      |  8 ++++
 .../java/org/apache/iotdb/rpc/TSStatusCode.java    |  1 -
 .../schemaregion/SchemaExecutionVisitor.java       | 44 +++++++++++++--------
 .../metadata/AlignedTimeSeriesException.java       | 35 ++++++++++++++++
 .../execution/executor/RegionWriteExecutor.java    |  4 +-
 .../analyze/schema/AutoCreateSchemaExecutor.java   | 46 ++++++++++++++++------
 .../schemaregion/impl/SchemaRegionMemoryImpl.java  | 10 ++++-
 .../schemaregion/impl/SchemaRegionPBTreeImpl.java  | 10 ++++-
 .../mtree/impl/mem/MTreeBelowSGMemoryImpl.java     | 18 ++++++++-
 .../mtree/impl/pbtree/MTreeBelowSGCachedImpl.java  | 21 ++++++++--
 .../req/impl/CreateAlignedTimeSeriesPlanImpl.java  | 10 +++++
 .../write/req/impl/CreateTimeSeriesPlanImpl.java   | 10 +++++
 .../db/metadata/path/MeasurementPathTest.java      |  4 +-
 .../apache/iotdb/commons/path/MeasurementPath.java | 26 ------------
 .../org/apache/iotdb/commons/path/PartialPath.java | 26 ++++++++++++
 16 files changed, 227 insertions(+), 68 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java
index bd470cfdb4d..7b784c034ab 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java
@@ -19,6 +19,7 @@
 package org.apache.iotdb.db.it.schema;
 
 import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
+import org.apache.iotdb.db.it.utils.TestUtils;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
@@ -34,6 +35,9 @@ import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Collections;
+
+import static org.junit.Assert.fail;
 
 /**
  * Notice that, all test begins with "IoTDB" is integration test. All test which will start the
@@ -141,4 +145,22 @@ public class IoTDBCreateAlignedTimeseriesIT extends AbstractSchemaIT {
     }
     Assert.assertEquals(timeSeriesArray.length, count);
   }
+
+  @Test
+  public void testDifferentDeviceAlignment() {
+    try (Connection connection = EnvFactory.getEnv().getConnection();
+        Statement statement = connection.createStatement()) {
+      // Should ignore the alignment difference
+      statement.execute("create aligned timeseries root.sg2.d (s2 int64, s3 int64)");
+      // Should use the existing alignment
+      statement.execute("create timeseries root.sg2.d.s1 with datatype=INT64");
+      statement.execute("insert into root.sg2.d (time, s4) values (-1, 1)");
+      TestUtils.assertResultSetEqual(
+          statement.executeQuery("select * from root.sg2.d"),
+          "Time,root.sg2.d.s3,root.sg2.d.s4,root.sg2.d.s1,root.sg2.d.s2,",
+          Collections.singleton("-1,null,1.0,null,null,"));
+    } catch (SQLException ignored) {
+      fail();
+    }
+  }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateTimeseriesIT.java
index ca309274b63..b2b6f1c1078 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateTimeseriesIT.java
@@ -20,6 +20,7 @@
 package org.apache.iotdb.db.it.schema;
 
 import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
+import org.apache.iotdb.db.it.utils.TestUtils;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
@@ -35,6 +36,7 @@ import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -308,6 +310,12 @@ public class IoTDBCreateTimeseriesIT extends AbstractSchemaIT {
       statement.execute("create timeseries root.sg2.d.s1 with datatype=INT64");
       // Should ignore the alignment difference
       statement.execute("create aligned timeseries root.sg2.d (s2 int64, s3 int64)");
+      // Should use the existing alignment
+      statement.execute("insert into root.sg2.d (time, s4) aligned values (-1, 1)");
+      TestUtils.assertResultSetEqual(
+          statement.executeQuery("select * from root.sg2.d"),
+          "Time,root.sg2.d.s3,root.sg2.d.s4,root.sg2.d.s1,root.sg2.d.s2,",
+          Collections.singleton("-1,null,1.0,null,null,"));
     } catch (SQLException ignored) {
       fail();
     }
diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java
index 4fd90ca4b94..246a1f66982 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java
@@ -106,7 +106,6 @@ public enum TSStatusCode {
   WRITE_PROCESS_REJECT(606),
   OUT_OF_TTL(607),
   COMPACTION_ERROR(608),
-  @Deprecated
   ALIGNED_TIMESERIES_ERROR(609),
   WAL_ERROR(610),
   DISK_SPACE_INSUFFICIENT(611),
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/schemaregion/SchemaExecutionVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/schemaregion/SchemaExecutionVisitor.java
index 8d3c2155838..28ccff2f20d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/schemaregion/SchemaExecutionVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/schemaregion/SchemaExecutionVisitor.java
@@ -189,7 +189,7 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
     final PartialPath devicePath = node.getDevicePath();
     final MeasurementGroup measurementGroup = node.getMeasurementGroup();
 
-    final List<TSStatus> alreadyExistingTimeSeries = new ArrayList<>();
+    final List<TSStatus> existingTimeSeriesAndAlignmentMismatch = new ArrayList<>();
     final List<TSStatus> failingStatus = new ArrayList<>();
 
     if (node.isAligned()) {
@@ -197,7 +197,7 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
           devicePath,
           measurementGroup,
           schemaRegion,
-          alreadyExistingTimeSeries,
+          existingTimeSeriesAndAlignmentMismatch,
           failingStatus,
           node.isGeneratedByPipe());
     } else {
@@ -205,7 +205,7 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
           devicePath,
           measurementGroup,
           schemaRegion,
-          alreadyExistingTimeSeries,
+          existingTimeSeriesAndAlignmentMismatch,
           failingStatus,
           node.isGeneratedByPipe());
     }
@@ -214,8 +214,8 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
       return RpcUtils.getStatus(failingStatus);
     }
 
-    if (!alreadyExistingTimeSeries.isEmpty()) {
-      return RpcUtils.getStatus(alreadyExistingTimeSeries);
+    if (!existingTimeSeriesAndAlignmentMismatch.isEmpty()) {
+      return RpcUtils.getStatus(existingTimeSeriesAndAlignmentMismatch);
     }
 
     return RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS, "Execute successfully");
@@ -227,7 +227,7 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
     PartialPath devicePath;
     MeasurementGroup measurementGroup;
 
-    final List<TSStatus> alreadyExistingTimeSeries = new ArrayList<>();
+    final List<TSStatus> existingTimeSeriesAndAlignmentMismatch = new ArrayList<>();
     final List<TSStatus> failingStatus = new ArrayList<>();
 
     for (final Map.Entry<PartialPath, Pair<Boolean, MeasurementGroup>> deviceEntry :
@@ -239,7 +239,7 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
             devicePath,
             measurementGroup,
             schemaRegion,
-            alreadyExistingTimeSeries,
+            existingTimeSeriesAndAlignmentMismatch,
             failingStatus,
             node.isGeneratedByPipe());
       } else {
@@ -247,7 +247,7 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
             devicePath,
             measurementGroup,
             schemaRegion,
-            alreadyExistingTimeSeries,
+            existingTimeSeriesAndAlignmentMismatch,
             failingStatus,
             node.isGeneratedByPipe());
       }
@@ -257,8 +257,8 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
       return RpcUtils.getStatus(failingStatus);
     }
 
-    if (!alreadyExistingTimeSeries.isEmpty()) {
-      return RpcUtils.getStatus(alreadyExistingTimeSeries);
+    if (!existingTimeSeriesAndAlignmentMismatch.isEmpty()) {
+      return RpcUtils.getStatus(existingTimeSeriesAndAlignmentMismatch);
     }
 
     return RpcUtils.getStatus(TSStatusCode.SUCCESS_STATUS, "Execute successfully");
@@ -268,11 +268,12 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
       final PartialPath devicePath,
       final MeasurementGroup measurementGroup,
       final ISchemaRegion schemaRegion,
-      final List<TSStatus> alreadyExistingTimeSeries,
+      final List<TSStatus> existingTimeSeriesAndAlignmentMismatch,
       final List<TSStatus> failingStatus,
       final boolean withMerge) {
     final int size = measurementGroup.getMeasurements().size();
     // todo implement batch creation of one device in SchemaRegion
+    boolean alignedIsSet = false;
     for (int i = 0; i < size; i++) {
       try {
         final ICreateTimeSeriesPlan createTimeSeriesPlan =
@@ -283,11 +284,17 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
         // Thus the original ones are not altered
         ((CreateTimeSeriesPlanImpl) createTimeSeriesPlan).setWithMerge(withMerge);
         schemaRegion.createTimeSeries(createTimeSeriesPlan, -1);
+        if (((CreateTimeSeriesPlanImpl) createTimeSeriesPlan).getAligned().get() && !alignedIsSet) {
+          existingTimeSeriesAndAlignmentMismatch.add(
+              new TSStatus(TSStatusCode.ALIGNED_TIMESERIES_ERROR.getStatusCode())
+                  .setMessage(PartialPath.transformDataToString(devicePath)));
+          alignedIsSet = true;
+        }
       } catch (final MeasurementAlreadyExistException e) {
         // There's no need to internal create time series.
-        alreadyExistingTimeSeries.add(
+        existingTimeSeriesAndAlignmentMismatch.add(
             RpcUtils.getStatus(
-                e.getErrorCode(), MeasurementPath.transformDataToString(e.getMeasurementPath())));
+                e.getErrorCode(), PartialPath.transformDataToString(e.getMeasurementPath())));
       } catch (final MetadataException e) {
         logger.warn("{}: MetaData error: ", e.getMessage(), e);
         failingStatus.add(RpcUtils.getStatus(e.getErrorCode(), e.getMessage()));
@@ -299,7 +306,7 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
       final PartialPath devicePath,
       final MeasurementGroup measurementGroup,
       final ISchemaRegion schemaRegion,
-      final List<TSStatus> alreadyExistingTimeSeries,
+      final List<TSStatus> existingTimeSeriesAndAlignmentMismatch,
       final List<TSStatus> failingStatus,
       final boolean withMerge) {
     final List<String> measurementList = measurementGroup.getMeasurements();
@@ -336,9 +343,9 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
         // The existence check will be executed before truly creation
         // There's no need to internal create time series.
         final MeasurementPath measurementPath = e.getMeasurementPath();
-        alreadyExistingTimeSeries.add(
+        existingTimeSeriesAndAlignmentMismatch.add(
             RpcUtils.getStatus(
-                e.getErrorCode(), MeasurementPath.transformDataToString(e.getMeasurementPath())));
+                e.getErrorCode(), PartialPath.transformDataToString(e.getMeasurementPath())));
 
         // remove the existing time series from plan
         final int index = measurementList.indexOf(measurementPath.getMeasurement());
@@ -389,6 +396,11 @@ public class SchemaExecutionVisitor extends PlanVisitor<TSStatus, ISchemaRegion>
         shouldRetry = false;
       }
     }
+    if (!((CreateAlignedTimeSeriesPlanImpl) createAlignedTimeSeriesPlan).getAligned().get()) {
+      existingTimeSeriesAndAlignmentMismatch.add(
+          new TSStatus(TSStatusCode.ALIGNED_TIMESERIES_ERROR.getStatusCode())
+              .setMessage(PartialPath.transformDataToString(devicePath)));
+    }
   }
 
   @Override
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/exception/metadata/AlignedTimeSeriesException.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/exception/metadata/AlignedTimeSeriesException.java
new file mode 100644
index 00000000000..f159376dfae
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/exception/metadata/AlignedTimeSeriesException.java
@@ -0,0 +1,35 @@
+/*
+ * 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.commons.exception.MetadataException;
+import org.apache.iotdb.rpc.TSStatusCode;
+
+public class AlignedTimeSeriesException extends MetadataException {
+
+  public AlignedTimeSeriesException(final boolean aligned, final String path) {
+    super(
+        String.format(
+            "TimeSeries under this device is%s aligned, please use createTimeSeries or change device. (Path: %s)",
+            aligned ? "" : " not", path),
+        TSStatusCode.ALIGNED_TIMESERIES_ERROR.getStatusCode(),
+        true);
+  }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/executor/RegionWriteExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/executor/RegionWriteExecutor.java
index 63af0423d1a..b5a831b90b2 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/executor/RegionWriteExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/executor/RegionWriteExecutor.java
@@ -676,7 +676,7 @@ public class RegionWriteExecutor {
               alreadyExistingStatus.add(
                   RpcUtils.getStatus(
                       metadataException.getErrorCode(),
-                      MeasurementPath.transformDataToString(
+                      PartialPath.transformDataToString(
                           ((MeasurementAlreadyExistException) metadataException)
                               .getMeasurementPath())));
             } else {
@@ -774,7 +774,7 @@ public class RegionWriteExecutor {
                 alreadyExistingStatus.add(
                     RpcUtils.getStatus(
                         metadataException.getErrorCode(),
-                        MeasurementPath.transformDataToString(
+                        PartialPath.transformDataToString(
                             ((MeasurementAlreadyExistException) metadataException)
                                 .getMeasurementPath())));
               } else {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/AutoCreateSchemaExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/AutoCreateSchemaExecutor.java
index 358614c9a58..a6a3301aea0 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/AutoCreateSchemaExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/AutoCreateSchemaExecutor.java
@@ -29,6 +29,7 @@ import org.apache.iotdb.commons.service.metric.PerformanceOverviewMetrics;
 import org.apache.iotdb.db.auth.AuthorityChecker;
 import org.apache.iotdb.db.conf.IoTDBConfig;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.exception.metadata.AlignedTimeSeriesException;
 import org.apache.iotdb.db.exception.sql.SemanticException;
 import org.apache.iotdb.db.protocol.session.SessionManager;
 import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
@@ -188,7 +189,7 @@ class AutoCreateSchemaExecutor {
     }
 
     if (!devicesNeedAutoCreateTimeSeries.isEmpty()) {
-      internalCreateTimeSeries(schemaTree, devicesNeedAutoCreateTimeSeries, context);
+      internalCreateTimeSeries(schemaTree, devicesNeedAutoCreateTimeSeries, context, false);
     }
   }
 
@@ -425,7 +426,7 @@ class AutoCreateSchemaExecutor {
     }
 
     if (!devicesNeedAutoCreateTimeSeries.isEmpty()) {
-      internalCreateTimeSeries(schemaTree, devicesNeedAutoCreateTimeSeries, context);
+      internalCreateTimeSeries(schemaTree, devicesNeedAutoCreateTimeSeries, context, true);
     }
   }
 
@@ -463,11 +464,15 @@ class AutoCreateSchemaExecutor {
       List<CompressionType> compressors,
       boolean isAligned,
       MPPQueryContext context) {
+    final Map<PartialPath, Pair<Boolean, MeasurementGroup>> input =
+        Collections.singletonMap(devicePath, new Pair<>(isAligned, null));
     List<MeasurementPath> measurementPathList =
-        executeInternalCreateTimeseriesStatement(
+        executeInternalCreateTimeSeriesStatement(
+            input,
             new InternalCreateTimeSeriesStatement(
                 devicePath, measurements, tsDataTypes, encodings, compressors, isAligned),
-            context);
+            context,
+            false);
 
     Set<Integer> alreadyExistingMeasurementIndexSet =
         measurementPathList.stream()
@@ -488,13 +493,16 @@ class AutoCreateSchemaExecutor {
           null,
           null,
           null,
-          isAligned);
+          input.get(devicePath).getLeft());
     }
   }
 
-  // Auto create timeseries and return the existing timeseries info
-  private List<MeasurementPath> executeInternalCreateTimeseriesStatement(
-      final Statement statement, final MPPQueryContext context) {
+  // Auto create timeSeries and return the existing timeSeries info
+  private List<MeasurementPath> executeInternalCreateTimeSeriesStatement(
+      final Map<PartialPath, Pair<Boolean, MeasurementGroup>> devicesNeedAutoCreateTimeSeries,
+      final Statement statement,
+      final MPPQueryContext context,
+      final boolean isLoad) {
     final TSStatus status = AuthorityChecker.checkAuthority(statement, context);
     if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
       throw new IoTDBRuntimeException(status.getMessage(), status.getCode());
@@ -516,7 +524,18 @@ class AutoCreateSchemaExecutor {
     for (final TSStatus subStatus : executionResult.status.subStatus) {
       if (subStatus.code == TSStatusCode.TIMESERIES_ALREADY_EXIST.getStatusCode()) {
         alreadyExistingMeasurements.add(
-            MeasurementPath.parseDataFromString(subStatus.getMessage()));
+            (MeasurementPath) PartialPath.parseDataFromString(subStatus.getMessage()));
+      } else if (subStatus.code == TSStatusCode.ALIGNED_TIMESERIES_ERROR.getStatusCode()) {
+        final PartialPath devicePath = PartialPath.parseDataFromString(subStatus.getMessage());
+        final Pair<Boolean, MeasurementGroup> pair =
+            devicesNeedAutoCreateTimeSeries.get(devicePath);
+        if (!isLoad) {
+          pair.setLeft(!pair.getLeft());
+        } else {
+          // Load does not tolerate the device alignment mismatch
+          throw new SemanticException(
+              new AlignedTimeSeriesException(!pair.getLeft(), devicePath.getFullPath()));
+        }
       } else {
         failedCreationSet.add(subStatus);
       }
@@ -583,11 +602,13 @@ class AutoCreateSchemaExecutor {
   private void internalCreateTimeSeries(
       ClusterSchemaTree schemaTree,
       Map<PartialPath, Pair<Boolean, MeasurementGroup>> devicesNeedAutoCreateTimeSeries,
-      MPPQueryContext context) {
+      MPPQueryContext context,
+      final boolean isLoad) {
 
     // Deep copy to avoid changes to the original map
     final List<MeasurementPath> measurementPathList =
-        executeInternalCreateTimeseriesStatement(
+        executeInternalCreateTimeSeriesStatement(
+            devicesNeedAutoCreateTimeSeries,
             new InternalCreateMultiTimeSeriesStatement(
                 devicesNeedAutoCreateTimeSeries.entrySet().stream()
                     .collect(
@@ -597,7 +618,8 @@ class AutoCreateSchemaExecutor {
                                 new Pair<>(
                                     entry.getValue().getLeft(),
                                     entry.getValue().getRight().deepCopy())))),
-            context);
+            context,
+            isLoad);
 
     schemaTree.appendMeasurementPaths(measurementPathList);
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java
index 39be89f0938..5f6486f8be4 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java
@@ -702,7 +702,10 @@ public class SchemaRegionMemoryImpl implements ISchemaRegion {
               plan instanceof CreateTimeSeriesPlanImpl
                       && ((CreateTimeSeriesPlanImpl) plan).isWithMerge()
                   || plan instanceof CreateTimeSeriesNode
-                      && ((CreateTimeSeriesNode) plan).isGeneratedByPipe());
+                      && ((CreateTimeSeriesNode) plan).isGeneratedByPipe(),
+              plan instanceof CreateTimeSeriesPlanImpl
+                  ? ((CreateTimeSeriesPlanImpl) plan).getAligned()
+                  : null);
 
       // Should merge
       if (Objects.isNull(leafMNode)) {
@@ -786,7 +789,10 @@ public class SchemaRegionMemoryImpl implements ISchemaRegion {
               aliasList,
               (plan instanceof CreateAlignedTimeSeriesPlanImpl
                   && ((CreateAlignedTimeSeriesPlanImpl) plan).isWithMerge()),
-              existingMeasurementIndexes);
+              existingMeasurementIndexes,
+              (plan instanceof CreateAlignedTimeSeriesPlanImpl
+                  ? ((CreateAlignedTimeSeriesPlanImpl) plan).getAligned()
+                  : null));
 
       // update statistics and schemaDataTypeNumMap
       regionStatistics.addMeasurement(measurementMNodeList.size());
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionPBTreeImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionPBTreeImpl.java
index 944ffe0ea53..a39b881fe1f 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionPBTreeImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionPBTreeImpl.java
@@ -645,7 +645,10 @@ public class SchemaRegionPBTreeImpl implements ISchemaRegion {
               plan.getProps(),
               plan.getAlias(),
               (plan instanceof CreateTimeSeriesPlanImpl
-                  && ((CreateTimeSeriesPlanImpl) plan).isWithMerge()));
+                  && ((CreateTimeSeriesPlanImpl) plan).isWithMerge()),
+              plan instanceof CreateTimeSeriesPlanImpl
+                  ? ((CreateTimeSeriesPlanImpl) plan).getAligned()
+                  : null);
 
       try {
         // Should merge
@@ -756,7 +759,10 @@ public class SchemaRegionPBTreeImpl implements ISchemaRegion {
               aliasList,
               (plan instanceof CreateAlignedTimeSeriesPlanImpl
                   && ((CreateAlignedTimeSeriesPlanImpl) plan).isWithMerge()),
-              existingMeasurementIndexes);
+              existingMeasurementIndexes,
+              (plan instanceof CreateAlignedTimeSeriesPlanImpl
+                  ? ((CreateAlignedTimeSeriesPlanImpl) plan).getAligned()
+                  : null));
 
       try {
         // Update statistics and schemaDataTypeNumMap
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java
index 15d51928d64..5931023b3cf 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java
@@ -238,7 +238,8 @@ public class MTreeBelowSGMemoryImpl {
       final CompressionType compressor,
       final Map<String, String> props,
       final String alias,
-      final boolean withMerge)
+      final boolean withMerge,
+      final AtomicBoolean isAligned)
       throws MetadataException {
     final String[] nodeNames = path.getNodes();
     if (nodeNames.length <= 2) {
@@ -253,6 +254,12 @@ public class MTreeBelowSGMemoryImpl {
     synchronized (this) {
       final IMemMNode device = checkAndAutoCreateDeviceNode(devicePath.getTailNode(), deviceParent);
 
+      if (device.isDevice()
+          && device.getAsDeviceMNode().isAlignedNullable() != null
+          && isAligned != null) {
+        isAligned.set(device.getAsDeviceMNode().isAligned());
+      }
+
       MetaFormatUtils.checkTimeseriesProps(path.getFullPath(), props);
 
       final String leafName = path.getMeasurement();
@@ -328,7 +335,8 @@ public class MTreeBelowSGMemoryImpl {
       final List<CompressionType> compressors,
       final List<String> aliasList,
       final boolean withMerge,
-      final Set<Integer> existingMeasurementIndexes)
+      final Set<Integer> existingMeasurementIndexes,
+      final AtomicBoolean isAligned)
       throws MetadataException {
     final List<IMeasurementMNode<IMemMNode>> measurementMNodeList = new ArrayList<>();
     MetaFormatUtils.checkSchemaMeasurementNames(measurements);
@@ -339,6 +347,12 @@ public class MTreeBelowSGMemoryImpl {
     synchronized (this) {
       final IMemMNode device = checkAndAutoCreateDeviceNode(devicePath.getTailNode(), deviceParent);
 
+      if (device.isDevice()
+          && device.getAsDeviceMNode().isAlignedNullable() != null
+          && isAligned != null) {
+        isAligned.set(device.getAsDeviceMNode().isAligned());
+      }
+
       for (int i = 0; i < measurements.size(); i++) {
         if (device.hasChild(measurements.get(i))) {
           final IMemMNode node = device.getChild(measurements.get(i));
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/MTreeBelowSGCachedImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/MTreeBelowSGCachedImpl.java
index d5187e14c91..5127cd9e655 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/MTreeBelowSGCachedImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/MTreeBelowSGCachedImpl.java
@@ -266,7 +266,8 @@ public class MTreeBelowSGCachedImpl {
       String alias)
       throws MetadataException {
     IMeasurementMNode<ICachedMNode> measurementMNode =
-        createTimeSeriesWithPinnedReturn(path, dataType, encoding, compressor, props, alias, false);
+        createTimeSeriesWithPinnedReturn(
+            path, dataType, encoding, compressor, props, alias, false, null);
     unPinMNode(measurementMNode.getAsMNode());
     return measurementMNode;
   }
@@ -289,7 +290,8 @@ public class MTreeBelowSGCachedImpl {
       final CompressionType compressor,
       final Map<String, String> props,
       final String alias,
-      final boolean withMerge)
+      final boolean withMerge,
+      final AtomicBoolean isAligned)
       throws MetadataException {
     final String[] nodeNames = path.getNodes();
     if (nodeNames.length <= 2) {
@@ -305,6 +307,12 @@ public class MTreeBelowSGCachedImpl {
       synchronized (this) {
         ICachedMNode device = checkAndAutoCreateDeviceNode(devicePath.getTailNode(), deviceParent);
 
+        if (device.isDevice()
+            && device.getAsDeviceMNode().isAlignedNullable() != null
+            && isAligned != null) {
+          isAligned.set(device.getAsDeviceMNode().isAligned());
+        }
+
         try {
           MetaFormatUtils.checkTimeseriesProps(path.getFullPath(), props);
 
@@ -387,7 +395,8 @@ public class MTreeBelowSGCachedImpl {
       final List<CompressionType> compressors,
       final List<String> aliasList,
       final boolean withMerge,
-      final Set<Integer> existingMeasurementIndexes)
+      final Set<Integer> existingMeasurementIndexes,
+      final AtomicBoolean isAligned)
       throws MetadataException {
     final List<IMeasurementMNode<ICachedMNode>> measurementMNodeList = new ArrayList<>();
     MetaFormatUtils.checkSchemaMeasurementNames(measurements);
@@ -399,6 +408,12 @@ public class MTreeBelowSGCachedImpl {
       synchronized (this) {
         ICachedMNode device = checkAndAutoCreateDeviceNode(devicePath.getTailNode(), deviceParent);
 
+        if (device.isDevice()
+            && device.getAsDeviceMNode().isAlignedNullable() != null
+            && isAligned != null) {
+          isAligned.set(device.getAsDeviceMNode().isAligned());
+        }
+
         try {
           for (int i = 0; i < measurements.size(); i++) {
             if (store.hasChild(device, measurements.get(i))) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/write/req/impl/CreateAlignedTimeSeriesPlanImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/write/req/impl/CreateAlignedTimeSeriesPlanImpl.java
index 4ffa8aca5b2..8a2c4c12e8c 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/write/req/impl/CreateAlignedTimeSeriesPlanImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/write/req/impl/CreateAlignedTimeSeriesPlanImpl.java
@@ -32,6 +32,7 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 public class CreateAlignedTimeSeriesPlanImpl implements ICreateAlignedTimeSeriesPlan {
 
@@ -45,6 +46,7 @@ public class CreateAlignedTimeSeriesPlanImpl implements ICreateAlignedTimeSeries
   private List<Map<String, String>> attributesList;
   private List<Long> tagOffsets = null;
   private transient boolean withMerge;
+  private final transient AtomicBoolean aligned = new AtomicBoolean(true);
 
   public CreateAlignedTimeSeriesPlanImpl() {}
 
@@ -194,4 +196,12 @@ public class CreateAlignedTimeSeriesPlanImpl implements ICreateAlignedTimeSeries
       tagOffsets = Objects.nonNull(tagOffsets) ? new ArrayList<>(tagOffsets) : null;
     }
   }
+
+  public void setAligned(final boolean aligned) {
+    this.aligned.set(aligned);
+  }
+
+  public AtomicBoolean getAligned() {
+    return aligned;
+  }
 }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/write/req/impl/CreateTimeSeriesPlanImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/write/req/impl/CreateTimeSeriesPlanImpl.java
index 6234cc41aff..73b47a4f516 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/write/req/impl/CreateTimeSeriesPlanImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/write/req/impl/CreateTimeSeriesPlanImpl.java
@@ -28,6 +28,7 @@ import org.apache.tsfile.write.schema.MeasurementSchema;
 
 import java.util.Map;
 import java.util.TreeMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 public class CreateTimeSeriesPlanImpl implements ICreateTimeSeriesPlan {
 
@@ -41,6 +42,7 @@ public class CreateTimeSeriesPlanImpl implements ICreateTimeSeriesPlan {
   private Map<String, String> attributes = null;
   private long tagOffset = -1;
   private transient boolean withMerge;
+  private final transient AtomicBoolean aligned = new AtomicBoolean(false);
 
   public CreateTimeSeriesPlanImpl() {}
 
@@ -170,4 +172,12 @@ public class CreateTimeSeriesPlanImpl implements ICreateTimeSeriesPlan {
   public void setWithMerge(final boolean withMerge) {
     this.withMerge = withMerge;
   }
+
+  public void setAligned(final boolean aligned) {
+    this.aligned.set(aligned);
+  }
+
+  public AtomicBoolean getAligned() {
+    return aligned;
+  }
 }
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/metadata/path/MeasurementPathTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/metadata/path/MeasurementPathTest.java
index cf5f8ab57ba..148a3c56bd4 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/metadata/path/MeasurementPathTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/metadata/path/MeasurementPathTest.java
@@ -43,8 +43,8 @@ public class MeasurementPathTest {
         new MeasurementPath(
             new PartialPath("root.sg.d.s"), new MeasurementSchema("s", TSDataType.INT32), true);
     rawPath.setMeasurementAlias("alias");
-    String string = MeasurementPath.transformDataToString(rawPath);
-    MeasurementPath newPath = MeasurementPath.parseDataFromString(string);
+    String string = PartialPath.transformDataToString(rawPath);
+    MeasurementPath newPath = (MeasurementPath) PartialPath.parseDataFromString(string);
     Assert.assertEquals(rawPath.getFullPath(), newPath.getFullPath());
     Assert.assertEquals(rawPath.getMeasurementAlias(), newPath.getMeasurementAlias());
     Assert.assertEquals(rawPath.getMeasurementSchema(), newPath.getMeasurementSchema());
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/MeasurementPath.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/MeasurementPath.java
index f74a29f1815..0718366aabf 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/MeasurementPath.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/MeasurementPath.java
@@ -33,12 +33,9 @@ import org.apache.tsfile.write.schema.VectorMeasurementSchema;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.nio.ByteBuffer;
-import java.nio.charset.StandardCharsets;
 import java.rmi.UnexpectedException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -339,23 +336,6 @@ public class MeasurementPath extends PartialPath {
     return getDevicePath().concatNode(getTailNode());
   }
 
-  /**
-   * In specific scenarios, like internal create timeseries, the message can only be passed as
-   * String format.
-   */
-  public static String transformDataToString(MeasurementPath measurementPath) {
-    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-    DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
-    try {
-      measurementPath.serialize(dataOutputStream);
-    } catch (IOException ignored) {
-      // this exception won't happen.
-    }
-    byte[] bytes = byteArrayOutputStream.toByteArray();
-    // must use single-byte char sets
-    return new String(bytes, StandardCharsets.ISO_8859_1);
-  }
-
   @Override
   protected IDeviceID toDeviceID(String[] nodes) {
     // remove measurement
@@ -363,12 +343,6 @@ public class MeasurementPath extends PartialPath {
     return super.toDeviceID(nodes);
   }
 
-  public static MeasurementPath parseDataFromString(String measurementPathData) {
-    return (MeasurementPath)
-        PathDeserializeUtil.deserialize(
-            ByteBuffer.wrap(measurementPathData.getBytes(StandardCharsets.ISO_8859_1)));
-  }
-
   @Override
   protected PartialPath createPartialPath(String[] newPathNodes) {
     return new MeasurementPath(newPathNodes);
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
index ae35769a1d0..b0f2c3fe051 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
@@ -38,9 +38,12 @@ import org.apache.tsfile.write.schema.IMeasurementSchema;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -1040,6 +1043,29 @@ public class PartialPath extends Path implements Comparable<Path>, Cloneable {
     return this;
   }
 
+  /**
+   * In specific scenarios, like internal create timeseries, the message can only be passed as
+   * String format.
+   */
+  public static String transformDataToString(PartialPath partialPath) {
+    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+    DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
+    try {
+      partialPath.serialize(dataOutputStream);
+    } catch (IOException ignored) {
+      // this exception won't happen.
+    }
+    byte[] bytes = byteArrayOutputStream.toByteArray();
+    // must use single-byte char sets
+    return new String(bytes, StandardCharsets.ISO_8859_1);
+  }
+
+  public static PartialPath parseDataFromString(String measurementPathData) {
+    return (PartialPath)
+        PathDeserializeUtil.deserialize(
+            ByteBuffer.wrap(measurementPathData.getBytes(StandardCharsets.ISO_8859_1)));
+  }
+
   /** Return true if the path ends with ** and no other nodes contain *. Otherwise, return false. */
   public boolean isPrefixPath() {
     if (nodes.length <= 0) {


(iotdb) 16/45: Fixed the NPE caused by concurrent "check for createTimeSeries" and deleteTimeSeries (#16742)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit d712ffc4d5fdb60af0cd97c9b494209a143b1bef
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Wed Nov 12 21:44:35 2025 +0800

    Fixed the NPE caused by concurrent "check for createTimeSeries" and deleteTimeSeries (#16742)
    
    * befix
    
    * shi
    
    (cherry picked from commit 7515568c8e4649fdbb793a5cd539f299be734281)
---
 .../apache/iotdb/db/schemaengine/schemaregion/ISchemaRegion.java    | 5 ++++-
 .../db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java   | 6 +++++-
 .../db/schemaengine/schemaregion/impl/SchemaRegionPBTreeImpl.java   | 6 +++++-
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/ISchemaRegion.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/ISchemaRegion.java
index 916e52b4aca..c087d638d4a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/ISchemaRegion.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/ISchemaRegion.java
@@ -146,7 +146,10 @@ public interface ISchemaRegion {
    * @param aliasList a list of alias that you want to check
    * @return returns a map contains index of the measurements or alias that threw the exception, and
    *     exception details. The exceptions describe whether the measurement or alias exists. For
-   *     example, a MeasurementAlreadyExistException means this measurement exists.
+   *     example, a MeasurementAlreadyExistException means this measurement exists. If there are
+   *     exceptions during check, this may return an empty map, then all the measurements will be
+   *     re-checked under consensus layer, which guarantees safety(Yet may cause unnecessary replay
+   *     of raft log)
    */
   Map<Integer, MetadataException> checkMeasurementExistence(
       final PartialPath devicePath,
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java
index 3a80abba2b8..39be89f0938 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java
@@ -874,7 +874,11 @@ public class SchemaRegionMemoryImpl implements ISchemaRegion {
   @Override
   public Map<Integer, MetadataException> checkMeasurementExistence(
       PartialPath devicePath, List<String> measurementList, List<String> aliasList) {
-    return mTree.checkMeasurementExistence(devicePath, measurementList, aliasList);
+    try {
+      return mTree.checkMeasurementExistence(devicePath, measurementList, aliasList);
+    } catch (final Exception e) {
+      return Collections.emptyMap();
+    }
   }
 
   @Override
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionPBTreeImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionPBTreeImpl.java
index 58e8fd786a5..944ffe0ea53 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionPBTreeImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionPBTreeImpl.java
@@ -855,7 +855,11 @@ public class SchemaRegionPBTreeImpl implements ISchemaRegion {
   @Override
   public Map<Integer, MetadataException> checkMeasurementExistence(
       PartialPath devicePath, List<String> measurementList, List<String> aliasList) {
-    return mtree.checkMeasurementExistence(devicePath, measurementList, aliasList);
+    try {
+      return mtree.checkMeasurementExistence(devicePath, measurementList, aliasList);
+    } catch (final Exception e) {
+      return Collections.emptyMap();
+    }
   }
 
   @Override


(iotdb) 11/45: Pipe: support path exclusion under tree model (#16632)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 25d5ba551355dd032b1d210b96148d4da529f8ab
Author: VGalaxies <vg...@apache.org>
AuthorDate: Wed Nov 12 10:34:59 2025 +0800

    Pipe: support path exclusion under tree model (#16632)
    
    * backup
    
    * refact
    
    * add comments
    
    * minor improve
    
    * add ITs
    
    * improve IT
    
    * basic impl for meta exclusion
    
    * impl getIntersection for ExclusionIoTDBTreePattern & add tests for PipeStatementTreePatternParseVisitorTest
    
    * pending at testCommitSetSchemaTemplate
    
    * add IT
    
    * fixup
    
    * apply review
    
    * apply review
    
    * add TreePattern.checkAndLogPatternCoverage
    
    * fixup
    
    * throws PipeException If the inclusion pattern is fully covered by the exclusion pattern
    
    (cherry picked from commit d48347cdc8d7b636130c10871ba8140cb857f3c0)
---
 .../auto/basic/IoTDBTreePatternFormatIT.java       | 616 ++++++++++++---------
 .../treemodel/manual/IoTDBPipeInclusionIT.java     |  72 +++
 .../receiver/protocol/IoTDBConfigNodeReceiver.java |  13 +-
 .../pipe/source/IoTDBConfigRegionSource.java       |   6 +-
 ...eConfigPhysicalPlanTreePatternParseVisitor.java |  46 +-
 ...figPhysicalPlanTreePatternParseVisitorTest.java |   7 +-
 .../agent/task/connection/PipeEventCollector.java  |   4 +-
 .../parser/TsFileInsertionEventParserProvider.java |   6 +-
 .../protocol/thrift/IoTDBDataNodeReceiver.java     |  11 +-
 .../PipeStatementTreePatternParseVisitor.java      |  22 +-
 .../source/dataregion/IoTDBDataRegionSource.java   |   6 +-
 .../PipePlanTreePatternParseVisitor.java           |  41 +-
 .../db/pipe/pattern/TreePatternCoverageTest.java   | 133 +++++
 .../PipeStatementTreePatternParseVisitorTest.java  | 202 ++++---
 .../PipePlanTreePatternParseVisitorTest.java       |   7 +-
 .../pipe/config/constant/PipeSourceConstant.java   |   5 +
 .../datastructure/pattern/IoTDBTreePattern.java    |  68 ++-
 .../pattern/IoTDBTreePatternOperations.java        |  52 ++
 .../datastructure/pattern/PrefixTreePattern.java   |  70 ++-
 .../datastructure/pattern/SingleTreePattern.java   |  59 --
 .../pipe/datastructure/pattern/TreePattern.java    | 369 ++++++++++--
 .../pattern/UnionIoTDBTreePattern.java             | 115 ++--
 .../datastructure/pattern/UnionTreePattern.java    |  17 +-
 .../pattern/WithExclusionIoTDBTreePattern.java     | 213 +++++++
 .../pattern/WithExclusionTreePattern.java          | 119 ++++
 .../pipe/source/IoTDBNonDataRegionSource.java      |  14 +-
 26 files changed, 1690 insertions(+), 603 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBTreePatternFormatIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBTreePatternFormatIT.java
index 4e287106793..d8992d6c232 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBTreePatternFormatIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBTreePatternFormatIT.java
@@ -38,6 +38,7 @@ import org.junit.runner.RunWith;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -208,323 +209,398 @@ public class IoTDBTreePatternFormatIT extends AbstractPipeDualTreeModelAutoIT {
     }
   }
 
-  @Test
-  public void testMultiplePrefixPatternHistoricalData() throws Exception {
-    final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);
-
-    final String receiverIp = receiverDataNode.getIp();
-    final int receiverPort = receiverDataNode.getPort();
-
-    try (final SyncConfigNodeIServiceClient client =
-        (SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
-      final Map<String, String> extractorAttributes = new HashMap<>();
-      final Map<String, String> processorAttributes = new HashMap<>();
-      final Map<String, String> connectorAttributes = new HashMap<>();
+  //////////////////////////// Multiple & Exclusion ////////////////////////////
 
-      extractorAttributes.put("extractor.pattern", "root.db.d1.s, root.db2.d1.s");
-      extractorAttributes.put("extractor.inclusion", "data.insert");
+  private void testPipeWithMultiplePatterns(
+      final Map<String, String> extractorAttributes,
+      final List<String> insertQueries,
+      final boolean isHistorical,
+      final String validationSelectQuery,
+      final String validationSelectHeader,
+      final Set<String> expectedResultSet)
+      throws Exception {
 
-      connectorAttributes.put("connector", "iotdb-thrift-connector");
-      connectorAttributes.put("connector.batch.enable", "false");
-      connectorAttributes.put("connector.ip", receiverIp);
-      connectorAttributes.put("connector.port", Integer.toString(receiverPort));
-
-      TestUtils.executeNonQueries(
-          senderEnv,
-          Arrays.asList(
-              "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
-              "insert into root.db.d2(time, s) values (2, 2)",
-              "insert into root.db2.d1(time, s) values (3, 3)"),
-          null);
-      awaitUntilFlush(senderEnv);
-
-      final TSStatus status =
-          client.createPipe(
-              new TCreatePipeReq("p1", connectorAttributes)
-                  .setExtractorAttributes(extractorAttributes)
-                  .setProcessorAttributes(processorAttributes));
-
-      Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
-
-      Assert.assertEquals(
-          TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
-
-      final Set<String> expectedResSet = new HashSet<>();
-      expectedResSet.add("1,null,1.0,1.0,");
-      expectedResSet.add("3,3.0,null,null,");
-      TestUtils.assertDataEventuallyOnEnv(
-          receiverEnv,
-          "select * from root.db2.**,root.db.**",
-          "Time,root.db2.d1.s,root.db.d1.s,root.db.d1.s1,",
-          expectedResSet);
-    }
-  }
-
-  @Test
-  public void testMultipleIoTDBPatternHistoricalData() throws Exception {
+    // 1. Get receiver connection details
     final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);
-
     final String receiverIp = receiverDataNode.getIp();
     final int receiverPort = receiverDataNode.getPort();
 
     try (final SyncConfigNodeIServiceClient client =
         (SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
-      final Map<String, String> extractorAttributes = new HashMap<>();
+
+      // 2. Define standard processor and connector attributes
       final Map<String, String> processorAttributes = new HashMap<>();
       final Map<String, String> connectorAttributes = new HashMap<>();
-
-      extractorAttributes.put("extractor.path", "root.db.**, root.db2.d1.*");
-      extractorAttributes.put("extractor.inclusion", "data.insert");
-
       connectorAttributes.put("connector", "iotdb-thrift-connector");
       connectorAttributes.put("connector.batch.enable", "false");
       connectorAttributes.put("connector.ip", receiverIp);
       connectorAttributes.put("connector.port", Integer.toString(receiverPort));
 
-      TestUtils.executeNonQueries(
-          senderEnv,
-          Arrays.asList(
-              "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
-              "insert into root.db.d2(time, s) values (2, 2)",
-              "insert into root.db2.d1(time, s, t) values (3, 3, 3)",
-              "insert into root.db3.d1(time, s) values (4, 4)"),
-          null);
-      awaitUntilFlush(senderEnv);
+      // 3. Handle historical data insertion (if applicable)
+      if (isHistorical) {
+        TestUtils.executeNonQueries(senderEnv, insertQueries, null);
+        awaitUntilFlush(senderEnv);
+      }
 
-      final TSStatus status =
+      // 4. Create the pipe
+      final TSStatus createStatus =
           client.createPipe(
               new TCreatePipeReq("p1", connectorAttributes)
                   .setExtractorAttributes(extractorAttributes)
                   .setProcessorAttributes(processorAttributes));
+      Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), createStatus.getCode());
 
-      Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
+      // 5. Start the pipe
+      final TSStatus startStatus = client.startPipe("p1");
+      Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), startStatus.getCode());
 
-      Assert.assertEquals(
-          TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
+      // 6. Handle realtime data insertion (if applicable)
+      if (!isHistorical) {
+        TestUtils.executeNonQueries(senderEnv, insertQueries, null);
+        awaitUntilFlush(senderEnv);
+      }
 
-      final Set<String> expectedResSet = new HashSet<>();
-      expectedResSet.add("1,null,null,1.0,1.0,null,");
-      expectedResSet.add("2,null,null,null,null,2.0,");
-      expectedResSet.add("3,3.0,3.0,null,null,null,");
+      // 7. Validate data eventually arrives on the receiver
       TestUtils.assertDataEventuallyOnEnv(
-          receiverEnv,
-          "select * from root.db2.**,root.db.**",
-          "Time,root.db2.d1.s,root.db2.d1.t,root.db.d1.s,root.db.d1.s1,root.db.d2.s,",
-          expectedResSet);
+          receiverEnv, validationSelectQuery, validationSelectHeader, expectedResultSet);
     }
   }
 
   @Test
-  public void testMultipleHybridPatternHistoricalData() throws Exception {
-    final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);
-
-    final String receiverIp = receiverDataNode.getIp();
-    final int receiverPort = receiverDataNode.getPort();
-
-    try (final SyncConfigNodeIServiceClient client =
-        (SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
-      final Map<String, String> extractorAttributes = new HashMap<>();
-      final Map<String, String> processorAttributes = new HashMap<>();
-      final Map<String, String> connectorAttributes = new HashMap<>();
-
-      extractorAttributes.put("extractor.path", "root.db.d1.*");
-      extractorAttributes.put("extractor.pattern", "root.db2.d1.s");
-      extractorAttributes.put("extractor.inclusion", "data.insert");
-
-      connectorAttributes.put("connector", "iotdb-thrift-connector");
-      connectorAttributes.put("connector.batch.enable", "false");
-      connectorAttributes.put("connector.ip", receiverIp);
-      connectorAttributes.put("connector.port", Integer.toString(receiverPort));
-
-      TestUtils.executeNonQueries(
-          senderEnv,
-          Arrays.asList(
-              "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
-              "insert into root.db2.d1(time, s) values (2, 2)",
-              "insert into root.db3.d1(time, s) values (3, 3)"),
-          null);
-      awaitUntilFlush(senderEnv);
-
-      final TSStatus status =
-          client.createPipe(
-              new TCreatePipeReq("p1", connectorAttributes)
-                  .setExtractorAttributes(extractorAttributes)
-                  .setProcessorAttributes(processorAttributes));
-
-      Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
-
-      Assert.assertEquals(
-          TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
-
-      final Set<String> expectedResSet = new HashSet<>();
-      expectedResSet.add("1,1.0,1.0,null,");
-      expectedResSet.add("2,null,null,2.0,");
-
-      TestUtils.assertDataEventuallyOnEnv(
-          receiverEnv,
-          "select * from root.db.**,root.db2.**",
-          "Time,root.db.d1.s,root.db.d1.s1,root.db2.d1.s,",
-          expectedResSet);
-    }
+  public void testMultiplePrefixPatternHistoricalData() throws Exception {
+    // Define extractor attributes
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    extractorAttributes.put("extractor.pattern", "root.db.d1.s, root.db2.d1.s");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    // Define data to be inserted
+    final List<String> insertQueries =
+        Arrays.asList(
+            "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
+            "insert into root.db.d2(time, s) values (2, 2)",
+            "insert into root.db2.d1(time, s) values (3, 3)");
+
+    // Define expected results on receiver
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("1,null,1.0,1.0,");
+    expectedResSet.add("3,3.0,null,null,");
+
+    // Execute the common test logic
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        true, // isHistorical = true
+        "select * from root.db2.**,root.db.**",
+        "Time,root.db2.d1.s,root.db.d1.s,root.db.d1.s1,",
+        expectedResSet);
   }
 
   @Test
   public void testMultiplePrefixPatternRealtimeData() throws Exception {
-    final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);
-
-    final String receiverIp = receiverDataNode.getIp();
-    final int receiverPort = receiverDataNode.getPort();
-
-    try (final SyncConfigNodeIServiceClient client =
-        (SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
-      final Map<String, String> extractorAttributes = new HashMap<>();
-      final Map<String, String> processorAttributes = new HashMap<>();
-      final Map<String, String> connectorAttributes = new HashMap<>();
-
-      extractorAttributes.put("extractor.pattern", "root.db.d1.s, root.db2.d1.s");
-      extractorAttributes.put("extractor.inclusion", "data.insert");
-
-      connectorAttributes.put("connector", "iotdb-thrift-connector");
-      connectorAttributes.put("connector.batch.enable", "false");
-      connectorAttributes.put("connector.ip", receiverIp);
-      connectorAttributes.put("connector.port", Integer.toString(receiverPort));
-
-      final TSStatus status =
-          client.createPipe(
-              new TCreatePipeReq("p1", connectorAttributes)
-                  .setExtractorAttributes(extractorAttributes)
-                  .setProcessorAttributes(processorAttributes));
-
-      Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
-
-      Assert.assertEquals(
-          TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
-
-      TestUtils.executeNonQueries(
-          senderEnv,
-          Arrays.asList(
-              "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
-              "insert into root.db.d2(time, s) values (2, 2)",
-              "insert into root.db2.d1(time, s) values (3, 3)"),
-          null);
-      awaitUntilFlush(senderEnv);
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    extractorAttributes.put("extractor.pattern", "root.db.d1.s, root.db2.d1.s");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
+            "insert into root.db.d2(time, s) values (2, 2)",
+            "insert into root.db2.d1(time, s) values (3, 3)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("1,null,1.0,1.0,");
+    expectedResSet.add("3,3.0,null,null,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        false, // isHistorical = false
+        "select * from root.db2.**,root.db.**",
+        "Time,root.db2.d1.s,root.db.d1.s,root.db.d1.s1,",
+        expectedResSet);
+  }
 
-      final Set<String> expectedResSet = new HashSet<>();
-      expectedResSet.add("1,null,1.0,1.0,");
-      expectedResSet.add("3,3.0,null,null,");
-      TestUtils.assertDataEventuallyOnEnv(
-          receiverEnv,
-          "select * from root.db2.**,root.db.**",
-          "Time,root.db2.d1.s,root.db.d1.s,root.db.d1.s1,",
-          expectedResSet);
-    }
+  @Test
+  public void testMultipleIoTDBPatternHistoricalData() throws Exception {
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    extractorAttributes.put("extractor.path", "root.db.**, root.db2.d1.*");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
+            "insert into root.db.d2(time, s) values (2, 2)",
+            "insert into root.db2.d1(time, s, t) values (3, 3, 3)",
+            "insert into root.db3.d1(time, s) values (4, 4)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("1,null,null,1.0,1.0,null,");
+    expectedResSet.add("2,null,null,null,null,2.0,");
+    expectedResSet.add("3,3.0,3.0,null,null,null,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        true, // isHistorical = true
+        "select * from root.db2.**,root.db.**",
+        "Time,root.db2.d1.s,root.db2.d1.t,root.db.d1.s,root.db.d1.s1,root.db.d2.s,",
+        expectedResSet);
   }
 
   @Test
   public void testMultipleIoTDBPatternRealtimeData() throws Exception {
-    final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);
-
-    final String receiverIp = receiverDataNode.getIp();
-    final int receiverPort = receiverDataNode.getPort();
-
-    try (final SyncConfigNodeIServiceClient client =
-        (SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
-      final Map<String, String> extractorAttributes = new HashMap<>();
-      final Map<String, String> processorAttributes = new HashMap<>();
-      final Map<String, String> connectorAttributes = new HashMap<>();
-
-      extractorAttributes.put("extractor.path", "root.db.**, root.db2.d1.*");
-      extractorAttributes.put("extractor.inclusion", "data.insert");
-
-      connectorAttributes.put("connector", "iotdb-thrift-connector");
-      connectorAttributes.put("connector.batch.enable", "false");
-      connectorAttributes.put("connector.ip", receiverIp);
-      connectorAttributes.put("connector.port", Integer.toString(receiverPort));
-
-      final TSStatus status =
-          client.createPipe(
-              new TCreatePipeReq("p1", connectorAttributes)
-                  .setExtractorAttributes(extractorAttributes)
-                  .setProcessorAttributes(processorAttributes));
-
-      Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
-
-      Assert.assertEquals(
-          TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
-
-      TestUtils.executeNonQueries(
-          senderEnv,
-          Arrays.asList(
-              "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
-              "insert into root.db.d2(time, s) values (2, 2)",
-              "insert into root.db2.d1(time, s, t) values (3, 3, 3)",
-              "insert into root.db3.d1(time, s) values (4, 4)"),
-          null);
-      awaitUntilFlush(senderEnv);
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    extractorAttributes.put("extractor.path", "root.db.**, root.db2.d1.*");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
+            "insert into root.db.d2(time, s) values (2, 2)",
+            "insert into root.db2.d1(time, s, t) values (3, 3, 3)",
+            "insert into root.db3.d1(time, s) values (4, 4)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("1,null,null,1.0,1.0,null,");
+    expectedResSet.add("2,null,null,null,null,2.0,");
+    expectedResSet.add("3,3.0,3.0,null,null,null,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        false, // isHistorical = false
+        "select * from root.db2.**,root.db.**",
+        "Time,root.db2.d1.s,root.db2.d1.t,root.db.d1.s,root.db.d1.s1,root.db.d2.s,",
+        expectedResSet);
+  }
 
-      final Set<String> expectedResSet = new HashSet<>();
-      expectedResSet.add("1,null,null,1.0,1.0,null,");
-      expectedResSet.add("2,null,null,null,null,2.0,");
-      expectedResSet.add("3,3.0,3.0,null,null,null,");
-      TestUtils.assertDataEventuallyOnEnv(
-          receiverEnv,
-          "select * from root.db2.**,root.db.**",
-          "Time,root.db2.d1.s,root.db2.d1.t,root.db.d1.s,root.db.d1.s1,root.db.d2.s,",
-          expectedResSet);
-    }
+  @Test
+  public void testMultipleHybridPatternHistoricalData() throws Exception {
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    extractorAttributes.put("extractor.path", "root.db.d1.*");
+    extractorAttributes.put("extractor.pattern", "root.db2.d1.s");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
+            "insert into root.db2.d1(time, s) values (2, 2)",
+            "insert into root.db3.d1(time, s) values (3, 3)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("1,1.0,1.0,null,");
+    expectedResSet.add("2,null,null,2.0,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        true, // isHistorical = true
+        "select * from root.db.**,root.db2.**",
+        "Time,root.db.d1.s,root.db.d1.s1,root.db2.d1.s,",
+        expectedResSet);
   }
 
   @Test
   public void testMultipleHybridPatternRealtimeData() throws Exception {
-    final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);
-
-    final String receiverIp = receiverDataNode.getIp();
-    final int receiverPort = receiverDataNode.getPort();
-
-    try (final SyncConfigNodeIServiceClient client =
-        (SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
-      final Map<String, String> extractorAttributes = new HashMap<>();
-      final Map<String, String> processorAttributes = new HashMap<>();
-      final Map<String, String> connectorAttributes = new HashMap<>();
-
-      extractorAttributes.put("extractor.path", "root.db.d1.*");
-      extractorAttributes.put("extractor.pattern", "root.db2.d1.s");
-      extractorAttributes.put("extractor.inclusion", "data.insert");
-
-      connectorAttributes.put("connector", "iotdb-thrift-connector");
-      connectorAttributes.put("connector.batch.enable", "false");
-      connectorAttributes.put("connector.ip", receiverIp);
-      connectorAttributes.put("connector.port", Integer.toString(receiverPort));
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    extractorAttributes.put("extractor.path", "root.db.d1.*");
+    extractorAttributes.put("extractor.pattern", "root.db2.d1.s");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
+            "insert into root.db2.d1(time, s) values (2, 2)",
+            "insert into root.db3.d1(time, s) values (3, 3)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("1,1.0,1.0,null,");
+    expectedResSet.add("2,null,null,2.0,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        false, // isHistorical = false
+        "select * from root.db.**,root.db2.**",
+        "Time,root.db.d1.s,root.db.d1.s1,root.db2.d1.s,",
+        expectedResSet);
+  }
 
-      final TSStatus status =
-          client.createPipe(
-              new TCreatePipeReq("p1", connectorAttributes)
-                  .setExtractorAttributes(extractorAttributes)
-                  .setProcessorAttributes(processorAttributes));
+  @Test
+  public void testPrefixPatternWithExclusionHistoricalData() throws Exception {
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    // Inclusion: Match everything under root.db.d1 and root.db.d2
+    extractorAttributes.put("extractor.pattern", "root.db.d1, root.db.d2");
+    // Exclusion: Exclude anything with the prefix root.db.d1.s1
+    extractorAttributes.put("extractor.pattern.exclusion", "root.db.d1.s1");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            // s matches, s1 is excluded
+            "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
+            // s matches
+            "insert into root.db.d2(time, s) values (2, 2)",
+            "insert into root.db1.d1(time, s) values (3, 3)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("1,1.0,null,");
+    expectedResSet.add("2,null,2.0,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        true, // isHistorical = true
+        "select * from root.db.**",
+        "Time,root.db.d1.s,root.db.d2.s,",
+        expectedResSet);
+  }
 
-      Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
+  @Test
+  public void testPrefixPatternWithExclusionRealtimeData() throws Exception {
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    extractorAttributes.put("extractor.pattern", "root.db.d1, root.db.d2");
+    extractorAttributes.put("extractor.pattern.exclusion", "root.db.d1.s1");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
+            "insert into root.db.d2(time, s) values (2, 2)",
+            "insert into root.db1.d1(time, s) values (3, 3)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("1,1.0,null,");
+    expectedResSet.add("2,null,2.0,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        false, // isHistorical = false
+        "select * from root.db.**",
+        "Time,root.db.d1.s,root.db.d2.s,",
+        expectedResSet);
+  }
 
-      Assert.assertEquals(
-          TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("p1").getCode());
+  @Test
+  public void testIoTDBPatternWithExclusionHistoricalData() throws Exception {
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    // Inclusion: Match everything under root.db
+    extractorAttributes.put("extractor.path", "root.db.**");
+    // Exclusion: Exclude root.db.d1.s* and root.db.d3.*
+    extractorAttributes.put("extractor.path.exclusion", "root.db.d1.s*, root.db.d3.*");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            // s, s1 excluded, t matches
+            "insert into root.db.d1(time, s, s1, t) values (1, 1, 1, 1)",
+            // s matches
+            "insert into root.db.d2(time, s) values (2, 2)",
+            // s excluded
+            "insert into root.db.d3(time, s) values (3, 3)",
+            "insert into root.db1.d1(time, s) values (4, 4)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("1,1.0,null,");
+    expectedResSet.add("2,null,2.0,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        true, // isHistorical = true
+        "select * from root.db.**",
+        "Time,root.db.d1.t,root.db.d2.s,",
+        expectedResSet);
+  }
 
-      TestUtils.executeNonQueries(
-          senderEnv,
-          Arrays.asList(
-              "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
-              "insert into root.db2.d1(time, s) values (2, 2)",
-              "insert into root.db3.d1(time, s) values (3, 3)"),
-          null);
-      awaitUntilFlush(senderEnv);
+  @Test
+  public void testIoTDBPatternWithExclusionRealtimeData() throws Exception {
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    extractorAttributes.put("extractor.path", "root.db.**");
+    extractorAttributes.put("extractor.path.exclusion", "root.db.d1.s*, root.db.d3.*");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            "insert into root.db.d1(time, s, s1, t) values (1, 1, 1, 1)",
+            "insert into root.db.d2(time, s) values (2, 2)",
+            "insert into root.db.d3(time, s) values (3, 3)",
+            "insert into root.db1.d1(time, s) values (4, 4)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("1,1.0,null,");
+    expectedResSet.add("2,null,2.0,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        false, // isHistorical = false
+        "select * from root.db.**",
+        "Time,root.db.d1.t,root.db.d2.s,",
+        expectedResSet);
+  }
 
-      final Set<String> expectedResSet = new HashSet<>();
-      expectedResSet.add("1,1.0,1.0,null,");
-      expectedResSet.add("2,null,null,2.0,");
+  @Test
+  public void testHybridPatternWithHybridExclusionHistoricalData() throws Exception {
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    // Inclusion: Match root.db.** (IoTDB) AND root.db2.d1 (Prefix)
+    extractorAttributes.put("extractor.path", "root.db.**");
+    extractorAttributes.put("extractor.pattern", "root.db2.d1");
+    // Exclusion: Exclude root.db.d1.* (IoTDB) AND root.db2.d1.s (Prefix)
+    extractorAttributes.put("extractor.path.exclusion", "root.db.d1.*");
+    extractorAttributes.put("extractor.pattern.exclusion", "root.db2.d1.s");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            // s, s1 excluded by path.exclusion
+            "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
+            // s matches
+            "insert into root.db.d2(time, s) values (2, 2)",
+            // s excluded by pattern.exclusion, t matches
+            "insert into root.db2.d1(time, s, t) values (3, 3, 3)",
+            "insert into root.db3.d1(time, s) values (4, 4)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("2,2.0,null,");
+    expectedResSet.add("3,null,3.0,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        true, // isHistorical = true
+        "select * from root.db.**,root.db2.**",
+        "Time,root.db.d2.s,root.db2.d1.t,",
+        expectedResSet);
+  }
 
-      TestUtils.assertDataEventuallyOnEnv(
-          receiverEnv,
-          "select * from root.db.**,root.db2.**",
-          "Time,root.db.d1.s,root.db.d1.s1,root.db2.d1.s,",
-          expectedResSet);
-    }
+  @Test
+  public void testHybridPatternWithHybridExclusionRealtimeData() throws Exception {
+    final Map<String, String> extractorAttributes = new HashMap<>();
+    extractorAttributes.put("extractor.path", "root.db.**");
+    extractorAttributes.put("extractor.pattern", "root.db2.d1");
+    extractorAttributes.put("extractor.path.exclusion", "root.db.d1.*");
+    extractorAttributes.put("extractor.pattern.exclusion", "root.db2.d1.s");
+    extractorAttributes.put("extractor.inclusion", "data.insert");
+
+    final List<String> insertQueries =
+        Arrays.asList(
+            "insert into root.db.d1(time, s, s1) values (1, 1, 1)",
+            "insert into root.db.d2(time, s) values (2, 2)",
+            "insert into root.db2.d1(time, s, t) values (3, 3, 3)",
+            "insert into root.db3.d1(time, s) values (4, 4)");
+
+    final Set<String> expectedResSet = new HashSet<>();
+    expectedResSet.add("2,2.0,null,");
+    expectedResSet.add("3,null,3.0,");
+
+    testPipeWithMultiplePatterns(
+        extractorAttributes,
+        insertQueries,
+        false, // isHistorical = false
+        "select * from root.db.**,root.db2.**",
+        "Time,root.db.d2.s,root.db2.d1.t,",
+        expectedResSet);
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/manual/IoTDBPipeInclusionIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/manual/IoTDBPipeInclusionIT.java
index 61eaf14bb4e..54657f9c50d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/manual/IoTDBPipeInclusionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/manual/IoTDBPipeInclusionIT.java
@@ -182,6 +182,78 @@ public class IoTDBPipeInclusionIT extends AbstractPipeDualTreeModelManualIT {
     }
   }
 
+  @Test
+  public void testPureSchemaInclusionWithExclusionPattern() throws Exception {
+    final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);
+
+    final String receiverIp = receiverDataNode.getIp();
+    final int receiverPort = receiverDataNode.getPort();
+
+    try (final SyncConfigNodeIServiceClient client =
+        (SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
+      final Map<String, String> extractorAttributes = new HashMap<>();
+      final Map<String, String> processorAttributes = new HashMap<>();
+      final Map<String, String> connectorAttributes = new HashMap<>();
+
+      extractorAttributes.put("extractor.inclusion", "schema");
+      // Include root.ln.**
+      extractorAttributes.put("path", "root.ln.**");
+      // Exclude root.ln.wf02.* and root.ln.wf03.wt01.status
+      extractorAttributes.put("path.exclusion", "root.ln.wf02.**, root.ln.wf03.wt01.status");
+
+      connectorAttributes.put("connector", "iotdb-thrift-connector");
+      connectorAttributes.put("connector.ip", receiverIp);
+      connectorAttributes.put("connector.port", Integer.toString(receiverPort));
+
+      final TSStatus status =
+          client.createPipe(
+              new TCreatePipeReq("testPipe", connectorAttributes)
+                  .setExtractorAttributes(extractorAttributes)
+                  .setProcessorAttributes(processorAttributes));
+
+      Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
+
+      Assert.assertEquals(
+          TSStatusCode.SUCCESS_STATUS.getStatusCode(), client.startPipe("testPipe").getCode());
+
+      // Do not fail if the failure has nothing to do with pipe
+      // Because the failures will randomly generate due to resource limitation
+      TestUtils.executeNonQueries(
+          senderEnv,
+          Arrays.asList(
+              // Should be included
+              "create timeseries root.ln.wf01.wt01.status with datatype=BOOLEAN,encoding=PLAIN",
+              "ALTER timeseries root.ln.wf01.wt01.status ADD TAGS tag3=v3",
+              "ALTER timeseries root.ln.wf01.wt01.status ADD ATTRIBUTES attr4=v4",
+              // Should be excluded by root.ln.wf02.*
+              "create timeseries root.ln.wf02.wt01.status with datatype=BOOLEAN,encoding=PLAIN",
+              "ALTER timeseries root.ln.wf02.wt01.status ADD TAGS tag3=v3",
+              "ALTER timeseries root.ln.wf02.wt01.status ADD ATTRIBUTES attr4=v4",
+              // Should be excluded by root.ln.wf03.wt01.status
+              "create timeseries root.ln.wf03.wt01.status with datatype=BOOLEAN,encoding=PLAIN",
+              "ALTER timeseries root.ln.wf03.wt01.status ADD TAGS tag3=v3",
+              "ALTER timeseries root.ln.wf03.wt01.status ADD ATTRIBUTES attr4=v4"),
+          null);
+
+      TestUtils.assertDataEventuallyOnEnv(
+          receiverEnv,
+          "show timeseries root.ln.**",
+          "Timeseries,Alias,Database,DataType,Encoding,Compression,Tags,Attributes,Deadband,DeadbandParameters,ViewType,",
+          // Only wf01 should be synced
+          Collections.singleton(
+              "root.ln.wf01.wt01.status,null,root.ln,BOOLEAN,PLAIN,LZ4,{\"tag3\":\"v3\"},{\"attr4\":\"v4\"},null,null,BASE,"));
+
+      TestUtils.executeNonQueries(
+          senderEnv,
+          Arrays.asList(
+              "insert into root.ln.wf01.wt01(time, status) values(now(), false)", "flush"),
+          null);
+
+      TestUtils.assertDataAlwaysOnEnv(
+          receiverEnv, "select * from root.ln.**", "Time,", Collections.emptySet());
+    }
+  }
+
   @Test
   public void testAuthExclusion() throws Exception {
     final DataNodeWrapper receiverDataNode = receiverEnv.getDataNodeWrapper(0);
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/receiver/protocol/IoTDBConfigNodeReceiver.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/receiver/protocol/IoTDBConfigNodeReceiver.java
index dc2e491c96c..daf91c51c4c 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/receiver/protocol/IoTDBConfigNodeReceiver.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/receiver/protocol/IoTDBConfigNodeReceiver.java
@@ -28,9 +28,9 @@ import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.path.PathPatternTree;
 import org.apache.iotdb.commons.path.PathPatternTreeUtils;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePattern;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TablePattern;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TreePattern;
-import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.commons.pipe.receiver.IoTDBFileReceiver;
 import org.apache.iotdb.commons.pipe.receiver.PipeReceiverStatusHandler;
 import org.apache.iotdb.commons.pipe.sink.payload.airgap.AirGapPseudoTPipeTransferRequest;
@@ -1127,12 +1127,11 @@ public class IoTDBConfigNodeReceiver extends IoTDBFileReceiver {
             parameters.get(ColumnHeaderConstant.TYPE));
     final boolean isTreeModelDataAllowedToBeCaptured =
         parameters.containsKey(PipeTransferFileSealReqV2.TREE);
-    final List<TreePattern> treePatterns =
-        TreePattern.parseMultiplePatterns(
+    final TreePattern treePattern =
+        TreePattern.parsePatternFromString(
             parameters.get(ColumnHeaderConstant.PATH_PATTERN),
+            isTreeModelDataAllowedToBeCaptured,
             p -> new IoTDBTreePattern(isTreeModelDataAllowedToBeCaptured, p));
-    final TreePattern treePattern =
-        TreePattern.buildUnionPattern(isTreeModelDataAllowedToBeCaptured, treePatterns);
     final TablePattern tablePattern =
         new TablePattern(
             parameters.containsKey(PipeTransferFileSealReqV2.TABLE),
@@ -1141,13 +1140,13 @@ public class IoTDBConfigNodeReceiver extends IoTDBFileReceiver {
     final List<TSStatus> results = new ArrayList<>();
     while (generator.hasNext()) {
       IoTDBConfigRegionSource.parseConfigPlan(
-              generator.next(), (UnionIoTDBTreePattern) treePattern, tablePattern)
+              generator.next(), (IoTDBTreePatternOperations) treePattern, tablePattern)
           .filter(
               configPhysicalPlan ->
                   IoTDBConfigRegionSource.isTypeListened(
                       configPhysicalPlan,
                       executionTypes,
-                      (UnionIoTDBTreePattern) treePattern,
+                      (IoTDBTreePatternOperations) treePattern,
                       tablePattern))
           .ifPresent(
               configPhysicalPlan ->
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/source/IoTDBConfigRegionSource.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/source/IoTDBConfigRegionSource.java
index 252f7331d0c..f3c6996fb59 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/source/IoTDBConfigRegionSource.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/source/IoTDBConfigRegionSource.java
@@ -25,8 +25,8 @@ import org.apache.iotdb.commons.consensus.ConfigRegionId;
 import org.apache.iotdb.commons.exception.auth.AccessDeniedException;
 import org.apache.iotdb.commons.pipe.agent.task.progress.PipeEventCommitManager;
 import org.apache.iotdb.commons.pipe.config.PipeConfig;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TablePattern;
-import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.commons.pipe.datastructure.queue.listening.AbstractPipeListeningQueue;
 import org.apache.iotdb.commons.pipe.event.EnrichedEvent;
 import org.apache.iotdb.commons.pipe.event.PipeSnapshotEvent;
@@ -253,7 +253,7 @@ public class IoTDBConfigRegionSource extends IoTDBNonDataRegionSource {
 
   public static Optional<ConfigPhysicalPlan> parseConfigPlan(
       final ConfigPhysicalPlan plan,
-      final UnionIoTDBTreePattern treePattern,
+      final IoTDBTreePatternOperations treePattern,
       final TablePattern tablePattern) {
     Optional<ConfigPhysicalPlan> result = Optional.of(plan);
     final Boolean isTableDatabasePlan = isTableDatabasePlan(plan);
@@ -296,7 +296,7 @@ public class IoTDBConfigRegionSource extends IoTDBNonDataRegionSource {
   public static boolean isTypeListened(
       final ConfigPhysicalPlan plan,
       final Set<ConfigPhysicalPlanType> listenedTypeSet,
-      final UnionIoTDBTreePattern treePattern,
+      final IoTDBTreePatternOperations treePattern,
       final TablePattern tablePattern) {
     final Boolean isTableDatabasePlan = isTableDatabasePlan(plan);
     return listenedTypeSet.contains(plan.getType())
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/source/PipeConfigPhysicalPlanTreePatternParseVisitor.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/source/PipeConfigPhysicalPlanTreePatternParseVisitor.java
index 8e9a3d2cc0f..0324598b0a4 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/source/PipeConfigPhysicalPlanTreePatternParseVisitor.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/source/PipeConfigPhysicalPlanTreePatternParseVisitor.java
@@ -22,8 +22,8 @@ package org.apache.iotdb.confignode.manager.pipe.source;
 import org.apache.iotdb.commons.auth.entity.PrivilegeType;
 import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.path.PathPatternTree;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TreePattern;
-import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlan;
 import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlanVisitor;
 import org.apache.iotdb.confignode.consensus.request.write.auth.AuthorTreePlan;
@@ -60,12 +60,12 @@ import java.util.stream.Stream;
 
 /**
  * The {@link PipeConfigPhysicalPlanTreePatternParseVisitor} will transform the schema {@link
- * ConfigPhysicalPlan}s using {@link UnionIoTDBTreePattern}. Rule:
+ * ConfigPhysicalPlan}s using {@link IoTDBTreePatternOperations}. Rule:
  *
  * <p>1. All patterns in the output {@link ConfigPhysicalPlan} will be the intersection of the
- * original {@link ConfigPhysicalPlan}'s patterns and the given {@link UnionIoTDBTreePattern}.
+ * original {@link ConfigPhysicalPlan}'s patterns and the given {@link IoTDBTreePatternOperations}.
  *
- * <p>2. If a pattern does not intersect with the {@link UnionIoTDBTreePattern}, it's dropped.
+ * <p>2. If a pattern does not intersect with the {@link IoTDBTreePatternOperations}, it's dropped.
  *
  * <p>3. If all the patterns in the {@link ConfigPhysicalPlan} is dropped, the {@link
  * ConfigPhysicalPlan} is dropped.
@@ -74,13 +74,13 @@ import java.util.stream.Stream;
  * one is used in the {@link PipeConfigRegionWritePlanEvent} in {@link ConfigRegionListeningQueue}.
  */
 public class PipeConfigPhysicalPlanTreePatternParseVisitor
-    extends ConfigPhysicalPlanVisitor<Optional<ConfigPhysicalPlan>, UnionIoTDBTreePattern> {
+    extends ConfigPhysicalPlanVisitor<Optional<ConfigPhysicalPlan>, IoTDBTreePatternOperations> {
   private static final Logger LOGGER =
       LoggerFactory.getLogger(PipeConfigPhysicalPlanTreePatternParseVisitor.class);
 
   @Override
   public Optional<ConfigPhysicalPlan> visitPlan(
-      final ConfigPhysicalPlan plan, final UnionIoTDBTreePattern pattern) {
+      final ConfigPhysicalPlan plan, final IoTDBTreePatternOperations pattern) {
     return Optional.of(plan);
   }
 
@@ -92,7 +92,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
   // Other matches using "matchPrefixPath" are with the same principle.
   @Override
   public Optional<ConfigPhysicalPlan> visitCreateDatabase(
-      final DatabaseSchemaPlan createDatabasePlan, final UnionIoTDBTreePattern pattern) {
+      final DatabaseSchemaPlan createDatabasePlan, final IoTDBTreePatternOperations pattern) {
     return pattern.matchPrefixPath(createDatabasePlan.getSchema().getName())
         ? Optional.of(createDatabasePlan)
         : Optional.empty();
@@ -100,7 +100,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
 
   @Override
   public Optional<ConfigPhysicalPlan> visitAlterDatabase(
-      final DatabaseSchemaPlan alterDatabasePlan, final UnionIoTDBTreePattern pattern) {
+      final DatabaseSchemaPlan alterDatabasePlan, final IoTDBTreePatternOperations pattern) {
     return pattern.matchPrefixPath(alterDatabasePlan.getSchema().getName())
         ? Optional.of(alterDatabasePlan)
         : Optional.empty();
@@ -108,7 +108,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
 
   @Override
   public Optional<ConfigPhysicalPlan> visitDeleteDatabase(
-      final DeleteDatabasePlan deleteDatabasePlan, final UnionIoTDBTreePattern pattern) {
+      final DeleteDatabasePlan deleteDatabasePlan, final IoTDBTreePatternOperations pattern) {
     return pattern.matchPrefixPath(deleteDatabasePlan.getName())
         ? Optional.of(deleteDatabasePlan)
         : Optional.empty();
@@ -117,7 +117,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
   @Override
   public Optional<ConfigPhysicalPlan> visitCreateSchemaTemplate(
       final CreateSchemaTemplatePlan createSchemaTemplatePlan,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     // This is a deserialized template and can be arbitrarily altered
     final Template template = createSchemaTemplatePlan.getTemplate();
     template.getSchemaMap().keySet().removeIf(measurement -> !pattern.matchTailNode(measurement));
@@ -129,7 +129,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
   @Override
   public Optional<ConfigPhysicalPlan> visitCommitSetSchemaTemplate(
       final CommitSetSchemaTemplatePlan commitSetSchemaTemplatePlan,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     return pattern.matchPrefixPath(commitSetSchemaTemplatePlan.getPath())
         ? Optional.of(commitSetSchemaTemplatePlan)
         : Optional.empty();
@@ -138,7 +138,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
   @Override
   public Optional<ConfigPhysicalPlan> visitPipeUnsetSchemaTemplate(
       final PipeUnsetSchemaTemplatePlan pipeUnsetSchemaTemplatePlan,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     return pattern.matchPrefixPath(pipeUnsetSchemaTemplatePlan.getPath())
         ? Optional.of(pipeUnsetSchemaTemplatePlan)
         : Optional.empty();
@@ -147,7 +147,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
   @Override
   public Optional<ConfigPhysicalPlan> visitExtendSchemaTemplate(
       final ExtendSchemaTemplatePlan extendSchemaTemplatePlan,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     final TemplateExtendInfo extendInfo = extendSchemaTemplatePlan.getTemplateExtendInfo();
     final int[] filteredIndexes =
         IntStream.range(0, extendInfo.getMeasurements().size())
@@ -167,30 +167,30 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
 
   @Override
   public Optional<ConfigPhysicalPlan> visitGrantUser(
-      final AuthorTreePlan grantUserPlan, final UnionIoTDBTreePattern pattern) {
+      final AuthorTreePlan grantUserPlan, final IoTDBTreePatternOperations pattern) {
     return visitTreeAuthorPlan(grantUserPlan, pattern);
   }
 
   @Override
   public Optional<ConfigPhysicalPlan> visitRevokeUser(
-      final AuthorTreePlan revokeUserPlan, final UnionIoTDBTreePattern pattern) {
+      final AuthorTreePlan revokeUserPlan, final IoTDBTreePatternOperations pattern) {
     return visitTreeAuthorPlan(revokeUserPlan, pattern);
   }
 
   @Override
   public Optional<ConfigPhysicalPlan> visitGrantRole(
-      final AuthorTreePlan revokeUserPlan, final UnionIoTDBTreePattern pattern) {
+      final AuthorTreePlan revokeUserPlan, final IoTDBTreePatternOperations pattern) {
     return visitTreeAuthorPlan(revokeUserPlan, pattern);
   }
 
   @Override
   public Optional<ConfigPhysicalPlan> visitRevokeRole(
-      final AuthorTreePlan revokeUserPlan, final UnionIoTDBTreePattern pattern) {
+      final AuthorTreePlan revokeUserPlan, final IoTDBTreePatternOperations pattern) {
     return visitTreeAuthorPlan(revokeUserPlan, pattern);
   }
 
   private Optional<ConfigPhysicalPlan> visitTreeAuthorPlan(
-      final AuthorTreePlan pathRelatedAuthorTreePlan, final UnionIoTDBTreePattern pattern) {
+      final AuthorTreePlan pathRelatedAuthorTreePlan, final IoTDBTreePatternOperations pattern) {
     final List<PartialPath> intersectedPaths =
         pathRelatedAuthorTreePlan.getNodeNameList().stream()
             .map(pattern::getIntersection)
@@ -219,7 +219,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
   @Override
   public Optional<ConfigPhysicalPlan> visitPipeDeleteTimeSeries(
       final PipeDeleteTimeSeriesPlan pipeDeleteTimeSeriesPlan,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     try {
       final PathPatternTree intersectedTree =
           pattern.getIntersection(
@@ -238,7 +238,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
   @Override
   public Optional<ConfigPhysicalPlan> visitPipeDeleteLogicalView(
       final PipeDeleteLogicalViewPlan pipeDeleteLogicalViewPlan,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     try {
       final PathPatternTree intersectedTree =
           pattern.getIntersection(
@@ -257,7 +257,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
   @Override
   public Optional<ConfigPhysicalPlan> visitPipeAlterEncodingCompressor(
       final PipeAlterEncodingCompressorPlan pipeAlterEncodingCompressorPlan,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     try {
       final PathPatternTree intersectedTree =
           pattern.getIntersection(
@@ -281,7 +281,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
   @Override
   public Optional<ConfigPhysicalPlan> visitPipeDeactivateTemplate(
       final PipeDeactivateTemplatePlan pipeDeactivateTemplatePlan,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     final Map<PartialPath, List<Template>> newTemplateSetInfo =
         pipeDeactivateTemplatePlan.getTemplateSetInfo().entrySet().stream()
             .flatMap(
@@ -304,7 +304,7 @@ public class PipeConfigPhysicalPlanTreePatternParseVisitor
 
   @Override
   public Optional<ConfigPhysicalPlan> visitTTL(
-      final SetTTLPlan setTTLPlan, final UnionIoTDBTreePattern pattern) {
+      final SetTTLPlan setTTLPlan, final IoTDBTreePatternOperations pattern) {
     final PartialPath partialPath = new PartialPath(setTTLPlan.getPathPattern());
     final List<PartialPath> intersectionList =
         pattern.matchPrefixPath(partialPath.getFullPath())
diff --git a/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/manager/pipe/source/PipeConfigPhysicalPlanTreePatternParseVisitorTest.java b/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/manager/pipe/source/PipeConfigPhysicalPlanTreePatternParseVisitorTest.java
index 442351cc19d..155713539a7 100644
--- a/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/manager/pipe/source/PipeConfigPhysicalPlanTreePatternParseVisitorTest.java
+++ b/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/manager/pipe/source/PipeConfigPhysicalPlanTreePatternParseVisitorTest.java
@@ -23,6 +23,7 @@ import org.apache.iotdb.commons.exception.IllegalPathException;
 import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.path.PathPatternTree;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePattern;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlanType;
 import org.apache.iotdb.confignode.consensus.request.write.auth.AuthorTreePlan;
@@ -55,11 +56,11 @@ import java.util.List;
 
 public class PipeConfigPhysicalPlanTreePatternParseVisitorTest {
 
-  private final UnionIoTDBTreePattern prefixPathPattern =
+  private final IoTDBTreePatternOperations prefixPathPattern =
       new UnionIoTDBTreePattern(new IoTDBTreePattern("root.db.device.**"));
-  private final UnionIoTDBTreePattern fullPathPattern =
+  private final IoTDBTreePatternOperations fullPathPattern =
       new UnionIoTDBTreePattern(new IoTDBTreePattern("root.db.device.s1"));
-  private final UnionIoTDBTreePattern multiplePathPattern =
+  private final IoTDBTreePatternOperations multiplePathPattern =
       new UnionIoTDBTreePattern(
           Arrays.asList(
               new IoTDBTreePattern("root.db.device.s1"),
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/connection/PipeEventCollector.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/connection/PipeEventCollector.java
index f979d4763b5..f119070c891 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/connection/PipeEventCollector.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/connection/PipeEventCollector.java
@@ -22,7 +22,7 @@ package org.apache.iotdb.db.pipe.agent.task.connection;
 import org.apache.iotdb.commons.audit.UserEntity;
 import org.apache.iotdb.commons.pipe.agent.task.connection.UnboundedBlockingPendingQueue;
 import org.apache.iotdb.commons.pipe.agent.task.progress.PipeEventCommitManager;
-import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.event.EnrichedEvent;
 import org.apache.iotdb.commons.pipe.event.ProgressReportEvent;
 import org.apache.iotdb.db.pipe.agent.PipeDataNodeAgent;
@@ -172,7 +172,7 @@ public class PipeEventCollector implements EventCollector {
     (deleteDataEvent.getDeleteDataNode() instanceof DeleteDataNode
             ? IoTDBSchemaRegionSource.TREE_PATTERN_PARSE_VISITOR.process(
                 deleteDataEvent.getDeleteDataNode(),
-                (UnionIoTDBTreePattern) deleteDataEvent.getTreePattern())
+                (IoTDBTreePatternOperations) deleteDataEvent.getTreePattern())
             : IoTDBSchemaRegionSource.TABLE_PATTERN_PARSE_VISITOR
                 .process(deleteDataEvent.getDeleteDataNode(), deleteDataEvent.getTablePattern())
                 .flatMap(
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/TsFileInsertionEventParserProvider.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/TsFileInsertionEventParserProvider.java
index 8afd1627790..5632ab81226 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/TsFileInsertionEventParserProvider.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/parser/TsFileInsertionEventParserProvider.java
@@ -21,9 +21,9 @@ package org.apache.iotdb.db.pipe.event.common.tsfile.parser;
 
 import org.apache.iotdb.commons.pipe.agent.task.meta.PipeTaskMeta;
 import org.apache.iotdb.commons.pipe.config.PipeConfig;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TablePattern;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TreePattern;
-import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.db.pipe.event.common.tsfile.PipeTsFileInsertionEvent;
 import org.apache.iotdb.db.pipe.event.common.tsfile.parser.query.TsFileInsertionEventQueryParser;
 import org.apache.iotdb.db.pipe.event.common.tsfile.parser.scan.TsFileInsertionEventScanParser;
@@ -114,8 +114,8 @@ public class TsFileInsertionEventParserProvider {
           isWithMod);
     }
 
-    if (treePattern instanceof UnionIoTDBTreePattern
-        && !((UnionIoTDBTreePattern) treePattern).mayMatchMultipleTimeSeriesInOneDevice()) {
+    if (treePattern instanceof IoTDBTreePatternOperations
+        && !((IoTDBTreePatternOperations) treePattern).mayMatchMultipleTimeSeriesInOneDevice()) {
       // If the pattern matches only one time series in one device, use query container here
       // because there is no timestamps merge overhead.
       //
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
index 4096f5f931b..8a9ceb61c93 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
@@ -28,9 +28,9 @@ import org.apache.iotdb.commons.exception.pipe.PipeRuntimeOutOfMemoryCriticalExc
 import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.pipe.config.PipeConfig;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePattern;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TablePattern;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TreePattern;
-import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.commons.pipe.receiver.IoTDBFileReceiver;
 import org.apache.iotdb.commons.pipe.receiver.PipeReceiverStatusHandler;
 import org.apache.iotdb.commons.pipe.resource.log.PipeLogger;
@@ -609,12 +609,11 @@ public class IoTDBDataNodeReceiver extends IoTDBFileReceiver {
             parameters.get(ColumnHeaderConstant.TYPE));
     final boolean isTreeModelDataAllowedToBeCaptured =
         parameters.containsKey(PipeTransferFileSealReqV2.TREE);
-    final List<TreePattern> treePatterns =
-        TreePattern.parseMultiplePatterns(
+    final TreePattern treePattern =
+        TreePattern.parsePatternFromString(
             parameters.get(ColumnHeaderConstant.PATH_PATTERN),
+            isTreeModelDataAllowedToBeCaptured,
             p -> new IoTDBTreePattern(isTreeModelDataAllowedToBeCaptured, p));
-    final TreePattern treePattern =
-        TreePattern.buildUnionPattern(isTreeModelDataAllowedToBeCaptured, treePatterns);
     final TablePattern tablePattern =
         new TablePattern(
             parameters.containsKey(PipeTransferFileSealReqV2.TABLE),
@@ -636,7 +635,7 @@ public class IoTDBDataNodeReceiver extends IoTDBFileReceiver {
         // Here we apply the statements as many as possible
         // Even if there are failed statements
         STATEMENT_TREE_PATTERN_PARSE_VISITOR
-            .process(originalStatement, (UnionIoTDBTreePattern) treePattern)
+            .process(originalStatement, (IoTDBTreePatternOperations) treePattern)
             .flatMap(parsedStatement -> batchVisitor.process(parsedStatement, null))
             .ifPresent(statement -> results.add(executeStatementAndClassifyExceptions(statement)));
       } else if (treeOrTableStatement
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTreePatternParseVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTreePatternParseVisitor.java
index aa11fd69efa..64f11c0630e 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTreePatternParseVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTreePatternParseVisitor.java
@@ -19,8 +19,8 @@
 
 package org.apache.iotdb.db.pipe.receiver.visitor;
 
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TreePattern;
-import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.db.queryengine.plan.statement.Statement;
 import org.apache.iotdb.db.queryengine.plan.statement.StatementNode;
 import org.apache.iotdb.db.queryengine.plan.statement.StatementVisitor;
@@ -37,12 +37,12 @@ import java.util.stream.IntStream;
 
 /**
  * The {@link PipeStatementTreePatternParseVisitor} will transform the schema {@link Statement}s
- * using {@link UnionIoTDBTreePattern}. Rule:
+ * using {@link IoTDBTreePatternOperations}. Rule:
  *
  * <p>1. All patterns in the output {@link Statement} will be the intersection of the original
- * {@link Statement}'s patterns and the given {@link UnionIoTDBTreePattern}.
+ * {@link Statement}'s patterns and the given {@link IoTDBTreePatternOperations}.
  *
- * <p>2. If a pattern does not intersect with the {@link UnionIoTDBTreePattern}, it's dropped.
+ * <p>2. If a pattern does not intersect with the {@link IoTDBTreePatternOperations}, it's dropped.
  *
  * <p>3. If all the patterns in the {@link Statement} is dropped, the {@link Statement} is dropped.
  *
@@ -50,16 +50,16 @@ import java.util.stream.IntStream;
  * from the {@link SRStatementGenerator} and will no longer be used.
  */
 public class PipeStatementTreePatternParseVisitor
-    extends StatementVisitor<Optional<Statement>, UnionIoTDBTreePattern> {
+    extends StatementVisitor<Optional<Statement>, IoTDBTreePatternOperations> {
   @Override
   public Optional<Statement> visitNode(
-      final StatementNode statement, final UnionIoTDBTreePattern pattern) {
+      final StatementNode statement, final IoTDBTreePatternOperations pattern) {
     return Optional.of((Statement) statement);
   }
 
   @Override
   public Optional<Statement> visitCreateTimeseries(
-      final CreateTimeSeriesStatement statement, final UnionIoTDBTreePattern pattern) {
+      final CreateTimeSeriesStatement statement, final IoTDBTreePatternOperations pattern) {
     return pattern.matchesMeasurement(
             statement.getPath().getIDeviceID(), statement.getPath().getMeasurement())
         ? Optional.of(statement)
@@ -68,7 +68,7 @@ public class PipeStatementTreePatternParseVisitor
 
   @Override
   public Optional<Statement> visitCreateAlignedTimeseries(
-      final CreateAlignedTimeSeriesStatement statement, final UnionIoTDBTreePattern pattern) {
+      final CreateAlignedTimeSeriesStatement statement, final IoTDBTreePatternOperations pattern) {
     final int[] filteredIndexes =
         IntStream.range(0, statement.getMeasurements().size())
             .filter(
@@ -109,7 +109,7 @@ public class PipeStatementTreePatternParseVisitor
   @Override
   public Optional<Statement> visitAlterTimeSeries(
       final AlterTimeSeriesStatement alterTimeSeriesStatement,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     return pattern.matchesMeasurement(
             alterTimeSeriesStatement.getPath().getIDeviceID(),
             alterTimeSeriesStatement.getPath().getMeasurement())
@@ -120,7 +120,7 @@ public class PipeStatementTreePatternParseVisitor
   @Override
   public Optional<Statement> visitActivateTemplate(
       final ActivateTemplateStatement activateTemplateStatement,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     return pattern.matchDevice(activateTemplateStatement.getPath().getFullPath())
         ? Optional.of(activateTemplateStatement)
         : Optional.empty();
@@ -129,7 +129,7 @@ public class PipeStatementTreePatternParseVisitor
   @Override
   public Optional<Statement> visitCreateLogicalView(
       final CreateLogicalViewStatement createLogicalViewStatement,
-      final UnionIoTDBTreePattern pattern) {
+      final IoTDBTreePatternOperations pattern) {
     final int[] filteredIndexes =
         IntStream.range(0, createLogicalViewStatement.getTargetPathList().size())
             .filter(
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/IoTDBDataRegionSource.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/IoTDBDataRegionSource.java
index 6931726157e..4e69b47cc8d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/IoTDBDataRegionSource.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/dataregion/IoTDBDataRegionSource.java
@@ -23,8 +23,8 @@ import org.apache.iotdb.commons.consensus.DataRegionId;
 import org.apache.iotdb.commons.pipe.agent.task.PipeTaskAgent;
 import org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant;
 import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TreePattern;
-import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.commons.pipe.source.IoTDBSource;
 import org.apache.iotdb.consensus.ConsensusFactory;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
@@ -300,8 +300,8 @@ public class IoTDBDataRegionSource extends IoTDBSource {
     }
 
     if (shouldExtractDeletion
-        && !(treePattern instanceof UnionIoTDBTreePattern
-            && (((UnionIoTDBTreePattern) treePattern).isPrefixOrFullPath()))) {
+        && !(treePattern instanceof IoTDBTreePatternOperations
+            && (((IoTDBTreePatternOperations) treePattern).isPrefixOrFullPath()))) {
       throw new IllegalArgumentException(
           String.format(
               "The path pattern %s is not valid for the source. Only prefix or full path is allowed.",
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/schemaregion/PipePlanTreePatternParseVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/schemaregion/PipePlanTreePatternParseVisitor.java
index b3f4aa3f88c..041c19b8330 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/schemaregion/PipePlanTreePatternParseVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/schemaregion/PipePlanTreePatternParseVisitor.java
@@ -21,8 +21,8 @@ package org.apache.iotdb.db.pipe.source.schemaregion;
 
 import org.apache.iotdb.commons.path.MeasurementPath;
 import org.apache.iotdb.commons.path.PartialPath;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TreePattern;
-import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.commons.schema.view.viewExpression.ViewExpression;
 import org.apache.iotdb.db.pipe.event.common.schema.PipeSchemaRegionWritePlanEvent;
 import org.apache.iotdb.db.queryengine.plan.planner.plan.node.PlanNode;
@@ -55,12 +55,12 @@ import java.util.stream.IntStream;
 
 /**
  * The {@link PipePlanTreePatternParseVisitor} will transform the schema {@link PlanNode}s using
- * {@link UnionIoTDBTreePattern}. Rule:
+ * {@link IoTDBTreePatternOperations}. Rule:
  *
  * <p>1. All patterns in the output {@link PlanNode} will be the intersection of the original {@link
- * PlanNode}'s patterns and the given {@link UnionIoTDBTreePattern}.
+ * PlanNode}'s patterns and the given {@link IoTDBTreePatternOperations}.
  *
- * <p>2. If a pattern does not intersect with the {@link UnionIoTDBTreePattern}, it's dropped.
+ * <p>2. If a pattern does not intersect with the {@link IoTDBTreePatternOperations}, it's dropped.
  *
  * <p>3. If all the patterns in the {@link PlanNode} is dropped, the {@link PlanNode} is dropped.
  *
@@ -68,15 +68,16 @@ import java.util.stream.IntStream;
  * one is used in the {@link PipeSchemaRegionWritePlanEvent} in {@link SchemaRegionListeningQueue}.
  */
 public class PipePlanTreePatternParseVisitor
-    extends PlanVisitor<Optional<PlanNode>, UnionIoTDBTreePattern> {
+    extends PlanVisitor<Optional<PlanNode>, IoTDBTreePatternOperations> {
   @Override
-  public Optional<PlanNode> visitPlan(final PlanNode node, final UnionIoTDBTreePattern pattern) {
+  public Optional<PlanNode> visitPlan(
+      final PlanNode node, final IoTDBTreePatternOperations pattern) {
     return Optional.of(node);
   }
 
   @Override
   public Optional<PlanNode> visitCreateTimeSeries(
-      final CreateTimeSeriesNode node, final UnionIoTDBTreePattern pattern) {
+      final CreateTimeSeriesNode node, final IoTDBTreePatternOperations pattern) {
     return pattern.matchesMeasurement(
             node.getPath().getIDeviceID(), node.getPath().getMeasurement())
         ? Optional.of(node)
@@ -85,7 +86,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitCreateAlignedTimeSeries(
-      final CreateAlignedTimeSeriesNode node, final UnionIoTDBTreePattern pattern) {
+      final CreateAlignedTimeSeriesNode node, final IoTDBTreePatternOperations pattern) {
     final int[] filteredIndexes =
         IntStream.range(0, node.getMeasurements().size())
             .filter(
@@ -111,7 +112,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitCreateMultiTimeSeries(
-      final CreateMultiTimeSeriesNode node, final UnionIoTDBTreePattern pattern) {
+      final CreateMultiTimeSeriesNode node, final IoTDBTreePatternOperations pattern) {
     final Map<PartialPath, MeasurementGroup> filteredMeasurementGroupMap =
         node.getMeasurementGroupMap().entrySet().stream()
             .filter(entry -> pattern.matchPrefixPath(entry.getKey().getFullPath()))
@@ -130,7 +131,9 @@ public class PipePlanTreePatternParseVisitor
   }
 
   private static MeasurementGroup trimMeasurementGroup(
-      final IDeviceID device, final MeasurementGroup group, final UnionIoTDBTreePattern pattern) {
+      final IDeviceID device,
+      final MeasurementGroup group,
+      final IoTDBTreePatternOperations pattern) {
     final int[] filteredIndexes =
         IntStream.range(0, group.size())
             .filter(index -> pattern.matchesMeasurement(device, group.getMeasurements().get(index)))
@@ -165,7 +168,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitAlterTimeSeries(
-      final AlterTimeSeriesNode node, final UnionIoTDBTreePattern pattern) {
+      final AlterTimeSeriesNode node, final IoTDBTreePatternOperations pattern) {
     return pattern.matchesMeasurement(
             node.getPath().getIDeviceID(), node.getPath().getMeasurement())
         ? Optional.of(node)
@@ -174,7 +177,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitInternalCreateTimeSeries(
-      final InternalCreateTimeSeriesNode node, final UnionIoTDBTreePattern pattern) {
+      final InternalCreateTimeSeriesNode node, final IoTDBTreePatternOperations pattern) {
     final MeasurementGroup group =
         pattern.matchPrefixPath(node.getDevicePath().getFullPath())
             ? trimMeasurementGroup(
@@ -191,7 +194,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitActivateTemplate(
-      final ActivateTemplateNode node, final UnionIoTDBTreePattern pattern) {
+      final ActivateTemplateNode node, final IoTDBTreePatternOperations pattern) {
     return pattern.matchDevice(node.getActivatePath().getFullPath())
         ? Optional.of(node)
         : Optional.empty();
@@ -199,7 +202,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitInternalBatchActivateTemplate(
-      final InternalBatchActivateTemplateNode node, final UnionIoTDBTreePattern pattern) {
+      final InternalBatchActivateTemplateNode node, final IoTDBTreePatternOperations pattern) {
     final Map<PartialPath, Pair<Integer, Integer>> filteredTemplateActivationMap =
         node.getTemplateActivationMap().entrySet().stream()
             .filter(entry -> pattern.matchDevice(entry.getKey().getFullPath()))
@@ -213,7 +216,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitInternalCreateMultiTimeSeries(
-      final InternalCreateMultiTimeSeriesNode node, final UnionIoTDBTreePattern pattern) {
+      final InternalCreateMultiTimeSeriesNode node, final IoTDBTreePatternOperations pattern) {
     final Map<PartialPath, Pair<Boolean, MeasurementGroup>> filteredDeviceMap =
         node.getDeviceMap().entrySet().stream()
             .filter(entry -> pattern.matchPrefixPath(entry.getKey().getFullPath()))
@@ -237,7 +240,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitBatchActivateTemplate(
-      final BatchActivateTemplateNode node, final UnionIoTDBTreePattern pattern) {
+      final BatchActivateTemplateNode node, final IoTDBTreePatternOperations pattern) {
     final Map<PartialPath, Pair<Integer, Integer>> filteredTemplateActivationMap =
         node.getTemplateActivationMap().entrySet().stream()
             .filter(entry -> pattern.matchDevice(entry.getKey().getFullPath()))
@@ -250,7 +253,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitCreateLogicalView(
-      final CreateLogicalViewNode node, final UnionIoTDBTreePattern pattern) {
+      final CreateLogicalViewNode node, final IoTDBTreePatternOperations pattern) {
     final Map<PartialPath, ViewExpression> filteredViewPathToSourceMap =
         node.getViewPathToSourceExpressionMap().entrySet().stream()
             .filter(
@@ -265,7 +268,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitAlterLogicalView(
-      final AlterLogicalViewNode node, final UnionIoTDBTreePattern pattern) {
+      final AlterLogicalViewNode node, final IoTDBTreePatternOperations pattern) {
     final Map<PartialPath, ViewExpression> filteredViewPathToSourceMap =
         node.getViewPathToSourceMap().entrySet().stream()
             .filter(
@@ -280,7 +283,7 @@ public class PipePlanTreePatternParseVisitor
 
   @Override
   public Optional<PlanNode> visitDeleteData(
-      final DeleteDataNode node, final UnionIoTDBTreePattern pattern) {
+      final DeleteDataNode node, final IoTDBTreePatternOperations pattern) {
     final List<MeasurementPath> intersectedPaths =
         node.getPathList().stream()
             .map(pattern::getIntersection)
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/TreePatternCoverageTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/TreePatternCoverageTest.java
new file mode 100644
index 00000000000..dd91a34e8f9
--- /dev/null
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/pattern/TreePatternCoverageTest.java
@@ -0,0 +1,133 @@
+/*
+ * 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.pipe.pattern;
+
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePattern;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.PrefixTreePattern;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.TreePattern;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
+import org.apache.iotdb.pipe.api.exception.PipeException;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertThrows;
+
+/**
+ * Test class for {@link TreePattern#checkAndLogPatternCoverage(TreePattern, TreePattern)}. It
+ * verifies the returned counts for different coverage scenarios.
+ */
+public class TreePatternCoverageTest {
+
+  // ========================================================================
+  // Helper Methods
+  // ========================================================================
+
+  private IoTDBTreePattern iotdb(final String pattern) {
+    return new IoTDBTreePattern(true, pattern);
+  }
+
+  private PrefixTreePattern prefix(final String pattern) {
+    return new PrefixTreePattern(true, pattern);
+  }
+
+  private UnionIoTDBTreePattern union(final IoTDBTreePattern... patterns) {
+    return new UnionIoTDBTreePattern(true, Arrays.asList(patterns));
+  }
+
+  // ========================================================================
+  // Test Cases
+  // ========================================================================
+
+  @Test
+  public void testFullCoverageIoTDB() {
+    final TreePattern inclusion = iotdb("root.a.b.c");
+    final TreePattern exclusion = iotdb("root.a.**");
+
+    // Verify that a PipeException is thrown
+    final PipeException e =
+        assertThrows(
+            PipeException.class,
+            () -> TreePattern.checkAndLogPatternCoverage(inclusion, exclusion));
+  }
+
+  @Test
+  public void testPartialCoverageIoTDB() {
+    final TreePattern inclusion =
+        union(
+            iotdb("root.a.b.c"), // covered
+            iotdb("root.x.y.z") // not covered
+            );
+    final TreePattern exclusion = iotdb("root.a.**"); // only covers the first one
+
+    // 2 inclusion paths, 1 covered
+    final int[] counts = TreePattern.checkAndLogPatternCoverage(inclusion, exclusion);
+    assertArrayEquals(new int[] {1, 2}, counts);
+  }
+
+  @Test
+  public void testNoCoverage() {
+    final TreePattern inclusion = iotdb("root.a.b.c");
+    final TreePattern exclusion = iotdb("root.x.y.z");
+
+    // 1 inclusion path, 0 covered
+    final int[] counts = TreePattern.checkAndLogPatternCoverage(inclusion, exclusion);
+    assertArrayEquals(new int[] {0, 1}, counts);
+  }
+
+  @Test
+  public void testFullCoveragePrefix() {
+    // Prefix "root.a.b" corresponds to 4 variants
+    // (root.a.b, root.a.b*, root.a.b.**, root.a.b*.**)
+    final TreePattern inclusion = prefix("root.a.b");
+    // IoTDB "root.a.**" should cover all 4 variants
+    final TreePattern exclusion = iotdb("root.a.**");
+
+    // Verify that a PipeException is thrown
+    final PipeException e =
+        assertThrows(
+            PipeException.class,
+            () -> TreePattern.checkAndLogPatternCoverage(inclusion, exclusion));
+  }
+
+  @Test
+  public void testPartialCoveragePrefix() {
+    // Prefix "root.a.b" corresponds to 4 variants
+    final TreePattern inclusion = prefix("root.a.b");
+    // IoTDB "root.a.b" only includes the exact "root.a.b" path
+    final TreePattern exclusion = iotdb("root.a.b");
+
+    // 4 inclusion paths, 1 covered
+    final int[] counts = TreePattern.checkAndLogPatternCoverage(inclusion, exclusion);
+    assertArrayEquals(new int[] {1, 4}, counts);
+  }
+
+  @Test
+  public void testPrefixNoCoverage() {
+    final TreePattern inclusion = prefix("root.a.b");
+    final TreePattern exclusion = iotdb("root.x.y.z");
+
+    // 4 inclusion paths, 0 covered
+    final int[] counts = TreePattern.checkAndLogPatternCoverage(inclusion, exclusion);
+    assertArrayEquals(new int[] {0, 4}, counts);
+  }
+}
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/PipeStatementTreePatternParseVisitorTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/PipeStatementTreePatternParseVisitorTest.java
index 85ae98ac26a..2dc0a8b9332 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/PipeStatementTreePatternParseVisitorTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/PipeStatementTreePatternParseVisitorTest.java
@@ -23,7 +23,9 @@ import org.apache.iotdb.commons.exception.IllegalPathException;
 import org.apache.iotdb.commons.path.MeasurementPath;
 import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePattern;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.WithExclusionIoTDBTreePattern;
 import org.apache.iotdb.commons.schema.view.viewExpression.leaf.TimeSeriesViewOperand;
 import org.apache.iotdb.db.pipe.receiver.visitor.PipeStatementTreePatternParseVisitor;
 import org.apache.iotdb.db.queryengine.plan.statement.metadata.AlterTimeSeriesStatement;
@@ -44,27 +46,44 @@ import java.util.Map;
 
 public class PipeStatementTreePatternParseVisitorTest {
 
-  private final UnionIoTDBTreePattern prefixPathPattern =
+  private final IoTDBTreePatternOperations prefixPathPattern =
       new UnionIoTDBTreePattern(new IoTDBTreePattern("root.db.device.**"));
-  private final UnionIoTDBTreePattern fullPathPattern =
+  private final IoTDBTreePatternOperations fullPathPattern =
       new UnionIoTDBTreePattern(new IoTDBTreePattern("root.db.device.s1"));
-  private final UnionIoTDBTreePattern multiplePathPattern =
+  private final IoTDBTreePatternOperations multiplePathPattern =
       new UnionIoTDBTreePattern(
           Arrays.asList(
               new IoTDBTreePattern("root.db.device.s1"),
               new IoTDBTreePattern("root.db.device.s2")));
+  private final IoTDBTreePatternOperations exclusionPattern =
+      new WithExclusionIoTDBTreePattern(
+          new UnionIoTDBTreePattern(
+              new IoTDBTreePattern("root.db.device.**")), // Inclusion: root.db.device.**
+          new UnionIoTDBTreePattern(
+              new IoTDBTreePattern("root.db.device.s2")) // Exclusion: root.db.device.s2
+          );
 
   @Test
   public void testCreateTimeSeries() throws IllegalPathException {
-    final CreateTimeSeriesStatement createTimeSeriesStatement = new CreateTimeSeriesStatement();
-    createTimeSeriesStatement.setPath(new MeasurementPath("root.db.device.s1"));
-    createTimeSeriesStatement.setDataType(TSDataType.FLOAT);
-    createTimeSeriesStatement.setEncoding(TSEncoding.RLE);
-    createTimeSeriesStatement.setCompressor(CompressionType.SNAPPY);
-    createTimeSeriesStatement.setProps(Collections.emptyMap());
-    createTimeSeriesStatement.setTags(Collections.emptyMap());
-    createTimeSeriesStatement.setAttributes(Collections.emptyMap());
-    createTimeSeriesStatement.setAlias("a1");
+    final CreateTimeSeriesStatement createTimeSeriesStatementS1 = new CreateTimeSeriesStatement();
+    createTimeSeriesStatementS1.setPath(new MeasurementPath("root.db.device.s1"));
+    createTimeSeriesStatementS1.setDataType(TSDataType.FLOAT);
+    createTimeSeriesStatementS1.setEncoding(TSEncoding.RLE);
+    createTimeSeriesStatementS1.setCompressor(CompressionType.SNAPPY);
+    createTimeSeriesStatementS1.setProps(Collections.emptyMap());
+    createTimeSeriesStatementS1.setTags(Collections.emptyMap());
+    createTimeSeriesStatementS1.setAttributes(Collections.emptyMap());
+    createTimeSeriesStatementS1.setAlias("a1");
+
+    final CreateTimeSeriesStatement createTimeSeriesStatementS2 = new CreateTimeSeriesStatement();
+    createTimeSeriesStatementS2.setPath(new MeasurementPath("root.db.device.s2"));
+    createTimeSeriesStatementS2.setDataType(TSDataType.INT32);
+    createTimeSeriesStatementS2.setEncoding(TSEncoding.PLAIN);
+    createTimeSeriesStatementS2.setCompressor(CompressionType.SNAPPY);
+    createTimeSeriesStatementS2.setProps(Collections.emptyMap());
+    createTimeSeriesStatementS2.setTags(Collections.emptyMap());
+    createTimeSeriesStatementS2.setAttributes(Collections.emptyMap());
+    createTimeSeriesStatementS2.setAlias("a2");
 
     final CreateTimeSeriesStatement createTimeSeriesStatementToFilter =
         new CreateTimeSeriesStatement();
@@ -75,90 +94,128 @@ public class PipeStatementTreePatternParseVisitorTest {
     createTimeSeriesStatementToFilter.setProps(Collections.emptyMap());
     createTimeSeriesStatementToFilter.setTags(Collections.emptyMap());
     createTimeSeriesStatementToFilter.setAttributes(Collections.emptyMap());
-    createTimeSeriesStatementToFilter.setAlias("a2");
+    createTimeSeriesStatementToFilter.setAlias("a3");
 
     Assert.assertEquals(
-        createTimeSeriesStatement,
+        createTimeSeriesStatementS1,
         new PipeStatementTreePatternParseVisitor()
-            .visitCreateTimeseries(createTimeSeriesStatement, prefixPathPattern)
+            .visitCreateTimeseries(createTimeSeriesStatementS1, prefixPathPattern)
             .orElseThrow(AssertionError::new));
     Assert.assertFalse(
         new PipeStatementTreePatternParseVisitor()
             .visitCreateTimeseries(createTimeSeriesStatementToFilter, prefixPathPattern)
             .isPresent());
+
     Assert.assertEquals(
-        createTimeSeriesStatement,
+        createTimeSeriesStatementS1,
         new PipeStatementTreePatternParseVisitor()
-            .visitCreateTimeseries(createTimeSeriesStatement, multiplePathPattern)
+            .visitCreateTimeseries(createTimeSeriesStatementS1, multiplePathPattern)
             .orElseThrow(AssertionError::new));
     Assert.assertFalse(
         new PipeStatementTreePatternParseVisitor()
             .visitCreateTimeseries(createTimeSeriesStatementToFilter, multiplePathPattern)
             .isPresent());
+
+    Assert.assertEquals(
+        createTimeSeriesStatementS1,
+        new PipeStatementTreePatternParseVisitor()
+            .visitCreateTimeseries(createTimeSeriesStatementS1, exclusionPattern)
+            .orElseThrow(AssertionError::new));
+    Assert.assertFalse(
+        new PipeStatementTreePatternParseVisitor()
+            .visitCreateTimeseries(createTimeSeriesStatementS2, exclusionPattern)
+            .isPresent());
+    Assert.assertFalse(
+        new PipeStatementTreePatternParseVisitor()
+            .visitCreateTimeseries(createTimeSeriesStatementToFilter, exclusionPattern)
+            .isPresent());
   }
 
   @Test
   public void testCreateAlignedTimeSeries() throws IllegalPathException {
-    final CreateAlignedTimeSeriesStatement expectedCreateAlignedTimeSeriesStatement =
-        new CreateAlignedTimeSeriesStatement();
-    expectedCreateAlignedTimeSeriesStatement.setDevicePath(new PartialPath("root.db.device"));
-    expectedCreateAlignedTimeSeriesStatement.setMeasurements(Collections.singletonList("s1"));
-    expectedCreateAlignedTimeSeriesStatement.setDataTypes(
-        Collections.singletonList(TSDataType.FLOAT));
-    expectedCreateAlignedTimeSeriesStatement.setEncodings(
-        Collections.singletonList(TSEncoding.RLE));
-    expectedCreateAlignedTimeSeriesStatement.setCompressors(
-        Collections.singletonList(CompressionType.SNAPPY));
-    expectedCreateAlignedTimeSeriesStatement.setTagsList(
-        Collections.singletonList(Collections.emptyMap()));
-    expectedCreateAlignedTimeSeriesStatement.setAttributesList(
-        Collections.singletonList(Collections.emptyMap()));
-    expectedCreateAlignedTimeSeriesStatement.setAliasList(Collections.singletonList("a1"));
-
-    final CreateAlignedTimeSeriesStatement originalCreateAlignedTimeSeriesStatement =
-        new CreateAlignedTimeSeriesStatement();
-    originalCreateAlignedTimeSeriesStatement.setDevicePath(new PartialPath("root.db.device"));
-    originalCreateAlignedTimeSeriesStatement.setMeasurements(Arrays.asList("s1", "s2"));
-    originalCreateAlignedTimeSeriesStatement.setDataTypes(
-        Arrays.asList(TSDataType.FLOAT, TSDataType.BOOLEAN));
-    originalCreateAlignedTimeSeriesStatement.setEncodings(
-        Arrays.asList(TSEncoding.RLE, TSEncoding.PLAIN));
-    originalCreateAlignedTimeSeriesStatement.setCompressors(
-        Arrays.asList(CompressionType.SNAPPY, CompressionType.SNAPPY));
-    originalCreateAlignedTimeSeriesStatement.setTagsList(
-        Arrays.asList(Collections.emptyMap(), Collections.emptyMap()));
-    originalCreateAlignedTimeSeriesStatement.setAttributesList(
-        Arrays.asList(Collections.emptyMap(), Collections.emptyMap()));
-    originalCreateAlignedTimeSeriesStatement.setAliasList(Arrays.asList("a1", "a2"));
+    final CreateAlignedTimeSeriesStatement expectedS1Only = new CreateAlignedTimeSeriesStatement();
+    expectedS1Only.setDevicePath(new PartialPath("root.db.device"));
+    expectedS1Only.setMeasurements(Collections.singletonList("s1"));
+    expectedS1Only.setDataTypes(Collections.singletonList(TSDataType.FLOAT));
+    expectedS1Only.setEncodings(Collections.singletonList(TSEncoding.RLE));
+    expectedS1Only.setCompressors(Collections.singletonList(CompressionType.SNAPPY));
+    expectedS1Only.setTagsList(Collections.singletonList(Collections.emptyMap()));
+    expectedS1Only.setAttributesList(Collections.singletonList(Collections.emptyMap()));
+    expectedS1Only.setAliasList(Collections.singletonList("a1"));
+
+    final CreateAlignedTimeSeriesStatement originalS1S2 = new CreateAlignedTimeSeriesStatement();
+    originalS1S2.setDevicePath(new PartialPath("root.db.device"));
+    originalS1S2.setMeasurements(Arrays.asList("s1", "s2"));
+    originalS1S2.setDataTypes(Arrays.asList(TSDataType.FLOAT, TSDataType.BOOLEAN));
+    originalS1S2.setEncodings(Arrays.asList(TSEncoding.RLE, TSEncoding.PLAIN));
+    originalS1S2.setCompressors(Arrays.asList(CompressionType.SNAPPY, CompressionType.SNAPPY));
+    originalS1S2.setTagsList(Arrays.asList(Collections.emptyMap(), Collections.emptyMap()));
+    originalS1S2.setAttributesList(Arrays.asList(Collections.emptyMap(), Collections.emptyMap()));
+    originalS1S2.setAliasList(Arrays.asList("a1", "a2"));
+
+    final CreateAlignedTimeSeriesStatement originalS1S2S3 = new CreateAlignedTimeSeriesStatement();
+    originalS1S2S3.setDevicePath(new PartialPath("root.db.device"));
+    originalS1S2S3.setMeasurements(Arrays.asList("s1", "s2", "s3"));
+    originalS1S2S3.setDataTypes(
+        Arrays.asList(TSDataType.FLOAT, TSDataType.BOOLEAN, TSDataType.INT32));
+    originalS1S2S3.setEncodings(Arrays.asList(TSEncoding.RLE, TSEncoding.PLAIN, TSEncoding.RLE));
+    originalS1S2S3.setCompressors(
+        Arrays.asList(CompressionType.SNAPPY, CompressionType.SNAPPY, CompressionType.SNAPPY));
+    originalS1S2S3.setTagsList(
+        Arrays.asList(Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap()));
+    originalS1S2S3.setAttributesList(
+        Arrays.asList(Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap()));
+    originalS1S2S3.setAliasList(Arrays.asList("a1", "a2", "a3"));
+
+    Assert.assertEquals(
+        expectedS1Only,
+        new PipeStatementTreePatternParseVisitor()
+            .visitCreateAlignedTimeseries(originalS1S2, fullPathPattern)
+            .orElseThrow(AssertionError::new));
 
     Assert.assertEquals(
-        expectedCreateAlignedTimeSeriesStatement,
+        originalS1S2,
         new PipeStatementTreePatternParseVisitor()
-            .visitCreateAlignedTimeseries(originalCreateAlignedTimeSeriesStatement, fullPathPattern)
+            .visitCreateAlignedTimeseries(originalS1S2S3, multiplePathPattern)
             .orElseThrow(AssertionError::new));
 
+    final CreateAlignedTimeSeriesStatement expectedS1S3 = new CreateAlignedTimeSeriesStatement();
+    expectedS1S3.setDevicePath(new PartialPath("root.db.device"));
+    expectedS1S3.setMeasurements(Arrays.asList("s1", "s3"));
+    expectedS1S3.setDataTypes(Arrays.asList(TSDataType.FLOAT, TSDataType.INT32));
+    expectedS1S3.setEncodings(Arrays.asList(TSEncoding.RLE, TSEncoding.RLE));
+    expectedS1S3.setCompressors(Arrays.asList(CompressionType.SNAPPY, CompressionType.SNAPPY));
+    expectedS1S3.setTagsList(Arrays.asList(Collections.emptyMap(), Collections.emptyMap()));
+    expectedS1S3.setAttributesList(Arrays.asList(Collections.emptyMap(), Collections.emptyMap()));
+    expectedS1S3.setAliasList(Arrays.asList("a1", "a3"));
+
     Assert.assertEquals(
-        originalCreateAlignedTimeSeriesStatement,
+        expectedS1S3,
         new PipeStatementTreePatternParseVisitor()
-            .visitCreateAlignedTimeseries(
-                originalCreateAlignedTimeSeriesStatement, multiplePathPattern)
+            .visitCreateAlignedTimeseries(originalS1S2S3, exclusionPattern)
             .orElseThrow(AssertionError::new));
   }
 
   @Test
   public void testAlterTimeSeries() throws IllegalPathException {
-    final AlterTimeSeriesStatement alterTimeSeriesStatement = new AlterTimeSeriesStatement(true);
-
     final Map<String, String> attributeMap = Collections.singletonMap("k1", "v1");
-    alterTimeSeriesStatement.setPath(new MeasurementPath("root.db.device.s1"));
-    alterTimeSeriesStatement.setAlterMap(attributeMap);
-    alterTimeSeriesStatement.setTagsMap(Collections.emptyMap());
-    alterTimeSeriesStatement.setAttributesMap(attributeMap);
-    alterTimeSeriesStatement.setAlias("");
+
+    final AlterTimeSeriesStatement alterTimeSeriesStatementS1 = new AlterTimeSeriesStatement(true);
+    alterTimeSeriesStatementS1.setPath(new MeasurementPath("root.db.device.s1"));
+    alterTimeSeriesStatementS1.setAlterMap(attributeMap);
+    alterTimeSeriesStatementS1.setTagsMap(Collections.emptyMap());
+    alterTimeSeriesStatementS1.setAttributesMap(attributeMap);
+    alterTimeSeriesStatementS1.setAlias("");
+
+    final AlterTimeSeriesStatement alterTimeSeriesStatementS2 = new AlterTimeSeriesStatement(true);
+    alterTimeSeriesStatementS2.setPath(new MeasurementPath("root.db.device.s2")); // Different path
+    alterTimeSeriesStatementS2.setAlterMap(attributeMap);
+    alterTimeSeriesStatementS2.setTagsMap(Collections.emptyMap());
+    alterTimeSeriesStatementS2.setAttributesMap(attributeMap);
+    alterTimeSeriesStatementS2.setAlias("");
 
     final AlterTimeSeriesStatement alterTimeSeriesStatementToFilter =
         new AlterTimeSeriesStatement(true);
-
     alterTimeSeriesStatementToFilter.setPath(new MeasurementPath("root.db1.device.s1"));
     alterTimeSeriesStatementToFilter.setAlterMap(attributeMap);
     alterTimeSeriesStatementToFilter.setTagsMap(Collections.emptyMap());
@@ -166,23 +223,38 @@ public class PipeStatementTreePatternParseVisitorTest {
     alterTimeSeriesStatementToFilter.setAlias("");
 
     Assert.assertEquals(
-        alterTimeSeriesStatement,
+        alterTimeSeriesStatementS1,
         new PipeStatementTreePatternParseVisitor()
-            .visitAlterTimeSeries(alterTimeSeriesStatement, fullPathPattern)
+            .visitAlterTimeSeries(alterTimeSeriesStatementS1, fullPathPattern)
             .orElseThrow(AssertionError::new));
     Assert.assertFalse(
         new PipeStatementTreePatternParseVisitor()
             .visitAlterTimeSeries(alterTimeSeriesStatementToFilter, prefixPathPattern)
             .isPresent());
+
     Assert.assertEquals(
-        alterTimeSeriesStatement,
+        alterTimeSeriesStatementS1,
         new PipeStatementTreePatternParseVisitor()
-            .visitAlterTimeSeries(alterTimeSeriesStatement, multiplePathPattern)
+            .visitAlterTimeSeries(alterTimeSeriesStatementS1, multiplePathPattern)
             .orElseThrow(AssertionError::new));
     Assert.assertFalse(
         new PipeStatementTreePatternParseVisitor()
             .visitAlterTimeSeries(alterTimeSeriesStatementToFilter, multiplePathPattern)
             .isPresent());
+
+    Assert.assertEquals(
+        alterTimeSeriesStatementS1,
+        new PipeStatementTreePatternParseVisitor()
+            .visitAlterTimeSeries(alterTimeSeriesStatementS1, exclusionPattern)
+            .orElseThrow(AssertionError::new));
+    Assert.assertFalse(
+        new PipeStatementTreePatternParseVisitor()
+            .visitAlterTimeSeries(alterTimeSeriesStatementS2, exclusionPattern)
+            .isPresent());
+    Assert.assertFalse(
+        new PipeStatementTreePatternParseVisitor()
+            .visitAlterTimeSeries(alterTimeSeriesStatementToFilter, exclusionPattern)
+            .isPresent());
   }
 
   @Test
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/source/PipePlanTreePatternParseVisitorTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/source/PipePlanTreePatternParseVisitorTest.java
index f4aa8f56a7e..8aebe3ea0f7 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/source/PipePlanTreePatternParseVisitorTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/source/PipePlanTreePatternParseVisitorTest.java
@@ -23,6 +23,7 @@ import org.apache.iotdb.commons.exception.IllegalPathException;
 import org.apache.iotdb.commons.path.MeasurementPath;
 import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePattern;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.commons.schema.view.viewExpression.ViewExpression;
 import org.apache.iotdb.commons.schema.view.viewExpression.leaf.TimeSeriesViewOperand;
@@ -57,11 +58,11 @@ import java.util.Map;
 
 public class PipePlanTreePatternParseVisitorTest {
 
-  private final UnionIoTDBTreePattern prefixPathPattern =
+  private final IoTDBTreePatternOperations prefixPathPattern =
       new UnionIoTDBTreePattern(new IoTDBTreePattern("root.db.device.**"));
-  private final UnionIoTDBTreePattern fullPathPattern =
+  private final IoTDBTreePatternOperations fullPathPattern =
       new UnionIoTDBTreePattern(new IoTDBTreePattern("root.db.device.s1"));
-  private final UnionIoTDBTreePattern multiplePathPattern =
+  private final IoTDBTreePatternOperations multiplePathPattern =
       new UnionIoTDBTreePattern(
           Arrays.asList(
               new IoTDBTreePattern("root.db.device.s1"),
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/constant/PipeSourceConstant.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/constant/PipeSourceConstant.java
index 95eb6cb8955..d13bdf7d046 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/constant/PipeSourceConstant.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/constant/PipeSourceConstant.java
@@ -60,6 +60,11 @@ public class PipeSourceConstant {
   public static final String EXTRACTOR_PATTERN_FORMAT_IOTDB_VALUE = "iotdb";
   public static final String EXTRACTOR_PATTERN_PREFIX_DEFAULT_VALUE = "root";
   public static final String EXTRACTOR_PATTERN_IOTDB_DEFAULT_VALUE = "root.**";
+  public static final String EXTRACTOR_PATTERN_EXCLUSION_KEY = "extractor.pattern.exclusion";
+  public static final String SOURCE_PATTERN_EXCLUSION_KEY = "source.pattern.exclusion";
+  public static final String EXTRACTOR_PATH_EXCLUSION_KEY = "extractor.path.exclusion";
+  public static final String SOURCE_PATH_EXCLUSION_KEY = "source.path.exclusion";
+
   public static final String EXTRACTOR_DATABASE_NAME_KEY = "extractor.database-name";
   public static final String SOURCE_DATABASE_NAME_KEY = "source.database-name";
   public static final String EXTRACTOR_TABLE_NAME_KEY = "extractor.table-name";
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java
index 80e7df9ee5d..38d7aafccc7 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePattern.java
@@ -36,14 +36,17 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
 
-public class IoTDBTreePattern extends SingleTreePattern {
+public class IoTDBTreePattern extends IoTDBTreePatternOperations {
 
+  private final String pattern;
   private final PartialPath patternPartialPath;
+
   private static volatile DevicePathGetter devicePathGetter = PartialPath::new;
   private static volatile MeasurementPathGetter measurementPathGetter = MeasurementPath::new;
 
   public IoTDBTreePattern(final boolean isTreeModelDataAllowedToBeCaptured, final String pattern) {
-    super(isTreeModelDataAllowedToBeCaptured, pattern);
+    super(isTreeModelDataAllowedToBeCaptured);
+    this.pattern = pattern != null ? pattern : getDefaultPattern();
 
     try {
       patternPartialPath = new PartialPath(getPattern());
@@ -56,11 +59,22 @@ public class IoTDBTreePattern extends SingleTreePattern {
     this(true, pattern);
   }
 
-  @Override
-  public String getDefaultPattern() {
+  private String getDefaultPattern() {
     return PipeSourceConstant.EXTRACTOR_PATTERN_IOTDB_DEFAULT_VALUE;
   }
 
+  //////////////////////////// Tree Pattern Operations ////////////////////////////
+
+  @Override
+  public String getPattern() {
+    return pattern;
+  }
+
+  @Override
+  public boolean isRoot() {
+    return Objects.isNull(pattern) || this.pattern.equals(this.getDefaultPattern());
+  }
+
   @Override
   public boolean isLegal() {
     if (!pattern.startsWith("root")) {
@@ -129,12 +143,20 @@ public class IoTDBTreePattern extends SingleTreePattern {
     }
   }
 
+  @Override
+  public List<PartialPath> getBaseInclusionPaths() {
+    return Collections.singletonList(patternPartialPath);
+  }
+
+  //////////////////////////// IoTDB Tree Pattern Operations ////////////////////////////
+
   /**
    * Check if the {@link TreePattern} matches the given prefix path. In schema transmission, this
    * can be used to detect whether the given path can act as a parent path of the {@link
    * TreePattern}, and to transmit possibly used schemas like database creation and template
    * setting.
    */
+  @Override
   public boolean matchPrefixPath(final String path) {
     try {
       return patternPartialPath.matchPrefixPath(new PartialPath(path));
@@ -146,6 +168,7 @@ public class IoTDBTreePattern extends SingleTreePattern {
   /**
    * This is the precise form of the device overlap and is used only be device template transfer.
    */
+  @Override
   public boolean matchDevice(final String devicePath) {
     try {
       return patternPartialPath.overlapWith(new MeasurementPath(devicePath, "*"));
@@ -158,6 +181,7 @@ public class IoTDBTreePattern extends SingleTreePattern {
    * Return if the given tail node matches the pattern's tail node. Caller shall ensure that it is a
    * prefix or full path pattern.
    */
+  @Override
   public boolean matchTailNode(final String tailNode) {
     return !isFullPath() || patternPartialPath.getTailNode().equals(tailNode);
   }
@@ -166,6 +190,7 @@ public class IoTDBTreePattern extends SingleTreePattern {
    * Get the intersection of the given {@link PartialPath} and the {@link TreePattern}, Only used by
    * schema transmission. Caller shall ensure that it is a prefix or full path pattern.
    */
+  @Override
   public List<PartialPath> getIntersection(final PartialPath partialPath) {
     if (isFullPath()) {
       return partialPath.matchFullPath(patternPartialPath)
@@ -179,6 +204,7 @@ public class IoTDBTreePattern extends SingleTreePattern {
    * Get the intersection of the given {@link PathPatternTree} and the {@link TreePattern}. Only
    * used by schema transmission. Caller shall ensure that it is a prefix or full path pattern.
    */
+  @Override
   public PathPatternTree getIntersection(final PathPatternTree patternTree) {
     final PathPatternTree thisPatternTree = new PathPatternTree();
     thisPatternTree.appendPathPattern(patternPartialPath);
@@ -186,7 +212,17 @@ public class IoTDBTreePattern extends SingleTreePattern {
     return patternTree.intersectWithFullPathPrefixTree(thisPatternTree);
   }
 
-  public boolean isPrefix() {
+  @Override
+  public boolean isPrefixOrFullPath() {
+    return isPrefix() || isFullPath();
+  }
+
+  @Override
+  public boolean mayMatchMultipleTimeSeriesInOneDevice() {
+    return PathPatternUtil.hasWildcard(patternPartialPath.getTailNode());
+  }
+
+  private boolean isPrefix() {
     return PathPatternUtil.isMultiLevelMatchWildcard(patternPartialPath.getTailNode())
         && !new PartialPath(
                 Arrays.copyOfRange(
@@ -194,13 +230,11 @@ public class IoTDBTreePattern extends SingleTreePattern {
             .hasWildcard();
   }
 
-  public boolean isFullPath() {
+  private boolean isFullPath() {
     return !patternPartialPath.hasWildcard();
   }
 
-  public boolean mayMatchMultipleTimeSeriesInOneDevice() {
-    return PathPatternUtil.hasWildcard(patternPartialPath.getTailNode());
-  }
+  //////////////////////////// Getter ////////////////////////////
 
   public static void setDevicePathGetter(final DevicePathGetter devicePathGetter) {
     IoTDBTreePattern.devicePathGetter = devicePathGetter;
@@ -210,11 +244,6 @@ public class IoTDBTreePattern extends SingleTreePattern {
     IoTDBTreePattern.measurementPathGetter = measurementPathGetter;
   }
 
-  @Override
-  public String toString() {
-    return "IoTDBPipePattern" + super.toString();
-  }
-
   public interface DevicePathGetter {
     PartialPath apply(final IDeviceID deviceId) throws IllegalPathException;
   }
@@ -223,4 +252,15 @@ public class IoTDBTreePattern extends SingleTreePattern {
     MeasurementPath apply(final IDeviceID deviceId, final String measurement)
         throws IllegalPathException;
   }
+
+  //////////////////////////// Object ////////////////////////////
+
+  @Override
+  public String toString() {
+    return "IoTDBTreePattern{pattern='"
+        + pattern
+        + "', isTreeModelDataAllowedToBeCaptured="
+        + isTreeModelDataAllowedToBeCaptured
+        + '}';
+  }
 }
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePatternOperations.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePatternOperations.java
new file mode 100644
index 00000000000..1d99c0d90a2
--- /dev/null
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/IoTDBTreePatternOperations.java
@@ -0,0 +1,52 @@
+/*
+ * 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.pipe.datastructure.pattern;
+
+import org.apache.iotdb.commons.path.PartialPath;
+import org.apache.iotdb.commons.path.PathPatternTree;
+
+import java.util.List;
+
+/**
+ * An interface for TreePattern classes that support IoTDB-specific path matching operations, such
+ * as those used by schema-aware visitors.
+ */
+public abstract class IoTDBTreePatternOperations extends TreePattern {
+
+  protected IoTDBTreePatternOperations(final boolean isTreeModelDataAllowedToBeCaptured) {
+    super(isTreeModelDataAllowedToBeCaptured);
+  }
+
+  //////////////////////////// IoTDB Pattern Operations ////////////////////////////
+
+  public abstract boolean matchPrefixPath(final String path);
+
+  public abstract boolean matchDevice(final String devicePath);
+
+  public abstract boolean matchTailNode(final String tailNode);
+
+  public abstract List<PartialPath> getIntersection(final PartialPath partialPath);
+
+  public abstract PathPatternTree getIntersection(final PathPatternTree patternTree);
+
+  public abstract boolean isPrefixOrFullPath();
+
+  public abstract boolean mayMatchMultipleTimeSeriesInOneDevice();
+}
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/PrefixTreePattern.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/PrefixTreePattern.java
index 5a3763afaae..73d50393fb6 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/PrefixTreePattern.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/PrefixTreePattern.java
@@ -19,7 +19,9 @@
 
 package org.apache.iotdb.commons.pipe.datastructure.pattern;
 
+import org.apache.iotdb.commons.conf.IoTDBConstant;
 import org.apache.iotdb.commons.exception.IllegalPathException;
+import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant;
 import org.apache.iotdb.commons.utils.PathUtils;
 
@@ -27,23 +29,39 @@ import org.apache.tsfile.common.constant.TsFileConstant;
 import org.apache.tsfile.external.commons.lang3.StringUtils;
 import org.apache.tsfile.file.metadata.IDeviceID;
 
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
 
-public class PrefixTreePattern extends SingleTreePattern {
+public class PrefixTreePattern extends TreePattern {
+
+  private final String pattern;
 
   public PrefixTreePattern(final boolean isTreeModelDataAllowedToBeCaptured, final String pattern) {
-    super(isTreeModelDataAllowedToBeCaptured, pattern);
+    super(isTreeModelDataAllowedToBeCaptured);
+    this.pattern = pattern != null ? pattern : getDefaultPattern();
   }
 
   public PrefixTreePattern(final String pattern) {
     this(true, pattern);
   }
 
-  @Override
-  public String getDefaultPattern() {
+  private String getDefaultPattern() {
     return PipeSourceConstant.EXTRACTOR_PATTERN_PREFIX_DEFAULT_VALUE;
   }
 
+  @Override
+  public String getPattern() {
+    return pattern;
+  }
+
+  @Override
+  public boolean isRoot() {
+    return Objects.isNull(pattern) || this.pattern.equals(this.getDefaultPattern());
+  }
+
   @Override
   public boolean isLegal() {
     if (!pattern.startsWith("root")) {
@@ -131,8 +149,50 @@ public class PrefixTreePattern extends SingleTreePattern {
         && dotAndMeasurement.startsWith(pattern.substring(deviceStr.length()));
   }
 
+  @Override
+  public List<PartialPath> getBaseInclusionPaths() {
+    if (isRoot()) {
+      return Collections.singletonList(new PartialPath(new String[] {"root", "**"}));
+    }
+
+    final List<PartialPath> paths = new ArrayList<>();
+    try {
+      // 1. "root.d1"
+      paths.add(new PartialPath(pattern));
+    } catch (final IllegalPathException ignored) {
+    }
+    try {
+      // 2. "root.d1*"
+      paths.add(new PartialPath(pattern + "*"));
+    } catch (final IllegalPathException ignored) {
+    }
+    try {
+      // 3. "root.d1.**"
+      paths.add(
+          new PartialPath(
+              pattern + TsFileConstant.PATH_SEPARATOR + IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD));
+    } catch (final IllegalPathException ignored) {
+    }
+    try {
+      // 4. "root.d1*.**"
+      paths.add(
+          new PartialPath(
+              pattern
+                  + "*"
+                  + TsFileConstant.PATH_SEPARATOR
+                  + IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD));
+    } catch (final IllegalPathException ignored) {
+    }
+
+    return paths;
+  }
+
   @Override
   public String toString() {
-    return "PrefixPipePattern" + super.toString();
+    return "PrefixTreePattern{pattern='"
+        + pattern
+        + "', isTreeModelDataAllowedToBeCaptured="
+        + isTreeModelDataAllowedToBeCaptured
+        + '}';
   }
 }
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/SingleTreePattern.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/SingleTreePattern.java
deleted file mode 100644
index b88e760d76a..00000000000
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/SingleTreePattern.java
+++ /dev/null
@@ -1,59 +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.commons.pipe.datastructure.pattern;
-
-import java.util.Objects;
-
-public abstract class SingleTreePattern extends TreePattern {
-
-  protected final String pattern;
-
-  protected SingleTreePattern(
-      final boolean isTreeModelDataAllowedToBeCaptured, final String pattern) {
-    super(isTreeModelDataAllowedToBeCaptured);
-    this.pattern = pattern != null ? pattern : getDefaultPattern();
-  }
-
-  @Override
-  public boolean isSingle() {
-    return true;
-  }
-
-  @Override
-  public String getPattern() {
-    return pattern;
-  }
-
-  @Override
-  public boolean isRoot() {
-    return Objects.isNull(pattern) || this.pattern.equals(this.getDefaultPattern());
-  }
-
-  public abstract String getDefaultPattern();
-
-  @Override
-  public String toString() {
-    return "{pattern='"
-        + pattern
-        + "', isTreeModelDataAllowedToBeCaptured="
-        + isTreeModelDataAllowedToBeCaptured
-        + '}';
-  }
-}
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/TreePattern.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/TreePattern.java
index cc5997582d4..e9b0fbe2180 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/TreePattern.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/TreePattern.java
@@ -19,9 +19,11 @@
 
 package org.apache.iotdb.commons.pipe.datastructure.pattern;
 
+import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant;
 import org.apache.iotdb.commons.pipe.config.constant.SystemConstant;
 import org.apache.iotdb.pipe.api.customizer.parameter.PipeParameters;
+import org.apache.iotdb.pipe.api.exception.PipeException;
 
 import org.apache.tsfile.file.metadata.IDeviceID;
 import org.slf4j.Logger;
@@ -35,12 +37,16 @@ import java.util.Objects;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
+import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.EXTRACTOR_PATH_EXCLUSION_KEY;
 import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.EXTRACTOR_PATH_KEY;
+import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.EXTRACTOR_PATTERN_EXCLUSION_KEY;
 import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.EXTRACTOR_PATTERN_FORMAT_IOTDB_VALUE;
 import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.EXTRACTOR_PATTERN_FORMAT_KEY;
 import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.EXTRACTOR_PATTERN_FORMAT_PREFIX_VALUE;
 import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.EXTRACTOR_PATTERN_KEY;
+import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.SOURCE_PATH_EXCLUSION_KEY;
 import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.SOURCE_PATH_KEY;
+import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.SOURCE_PATTERN_EXCLUSION_KEY;
 import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.SOURCE_PATTERN_FORMAT_KEY;
 import static org.apache.iotdb.commons.pipe.config.constant.PipeSourceConstant.SOURCE_PATTERN_KEY;
 
@@ -58,6 +64,64 @@ public abstract class TreePattern {
     return isTreeModelDataAllowedToBeCaptured;
   }
 
+  //////////////////////////// Interface ////////////////////////////
+
+  public abstract String getPattern();
+
+  public abstract boolean isRoot();
+
+  /** Check if this pattern is legal. Different pattern type may have different rules. */
+  public abstract boolean isLegal();
+
+  /** Check if this pattern matches all time-series under a database. */
+  public abstract boolean coversDb(final String db);
+
+  /** Check if a device's all measurements are covered by this pattern. */
+  public abstract boolean coversDevice(final IDeviceID device);
+
+  /**
+   * Check if a database may have some measurements matched by the pattern.
+   *
+   * @return {@code true} if the pattern may overlap with the database, {@code false} otherwise.
+   */
+  public abstract boolean mayOverlapWithDb(final String db);
+
+  /**
+   * Check if a device may have some measurements matched by the pattern.
+   *
+   * <p>NOTE1: this is only called when {@link TreePattern#coversDevice} is {@code false}.
+   *
+   * <p>NOTE2: this is just a loose check and may have false positives. To further check if a
+   * measurement matches the pattern, please use {@link TreePattern#matchesMeasurement} after this.
+   */
+  public abstract boolean mayOverlapWithDevice(final IDeviceID device);
+
+  /**
+   * Check if a full path with device and measurement can be matched by pattern.
+   *
+   * <p>NOTE: this is only called when {@link TreePattern#mayOverlapWithDevice} is {@code true}.
+   */
+  public abstract boolean matchesMeasurement(final IDeviceID device, final String measurement);
+
+  /**
+   * Get all 'base' PartialPath patterns that this pattern represents, for the purpose of checking
+   * pattern coverage.
+   *
+   * <p>For IoTDB patterns, it's their direct PartialPath.
+   *
+   * <p>For Prefix patterns (e.g., "root.d1"), it's approximated as a union of PartialPaths to model
+   * its string-based matching: "root.d1", "root.d1*", "root.d1.**", and "root.d1*.**".
+   *
+   * <p>For Union patterns, it's a list from all sub-patterns.
+   *
+   * <p>For Exclusion patterns, it's the *effective* set of paths.
+   *
+   * @return A list of PartialPaths representing the inclusion paths.
+   */
+  public abstract List<PartialPath> getBaseInclusionPaths();
+
+  //////////////////////////// Utilities ////////////////////////////
+
   public static <T> List<T> applyIndexesOnList(
       final int[] filteredIndexes, final List<T> originalList) {
     return Objects.nonNull(originalList)
@@ -66,7 +130,8 @@ public abstract class TreePattern {
   }
 
   /**
-   * Interpret from source parameters and get a {@link TreePattern}.
+   * Interpret from source parameters and get a {@link TreePattern}. This method parses both
+   * inclusion and exclusion patterns.
    *
    * @return The interpreted {@link TreePattern} which is not {@code null}.
    */
@@ -75,9 +140,165 @@ public abstract class TreePattern {
     final boolean isTreeModelDataAllowedToBeCaptured =
         isTreeModelDataAllowToBeCaptured(sourceParameters);
 
-    final String path = sourceParameters.getStringByKeys(EXTRACTOR_PATH_KEY, SOURCE_PATH_KEY);
-    final String pattern =
-        sourceParameters.getStringByKeys(EXTRACTOR_PATTERN_KEY, SOURCE_PATTERN_KEY);
+    // 1. Define the default inclusion pattern (matches all, "root.**")
+    // This is used if no inclusion patterns are specified.
+    final TreePattern defaultInclusionPattern =
+        buildUnionPattern(
+            isTreeModelDataAllowedToBeCaptured,
+            Collections.singletonList(
+                new IoTDBTreePattern(isTreeModelDataAllowedToBeCaptured, null)));
+
+    // 2. Parse INCLUSION patterns using the helper
+    final TreePattern inclusionPattern =
+        parsePatternUnion(
+            sourceParameters,
+            isTreeModelDataAllowedToBeCaptured,
+            // 'path' keys (IoTDB wildcard)
+            EXTRACTOR_PATH_KEY,
+            SOURCE_PATH_KEY,
+            // 'pattern' keys (Prefix or IoTDB via format)
+            EXTRACTOR_PATTERN_KEY,
+            SOURCE_PATTERN_KEY,
+            // Default pattern if no keys are found
+            defaultInclusionPattern);
+
+    // 3. Parse EXCLUSION patterns using the helper
+    final TreePattern exclusionPattern =
+        parsePatternUnion(
+            sourceParameters,
+            isTreeModelDataAllowedToBeCaptured,
+            // 'path.exclusion' keys (IoTDB wildcard)
+            EXTRACTOR_PATH_EXCLUSION_KEY,
+            SOURCE_PATH_EXCLUSION_KEY,
+            // 'pattern.exclusion' keys (Prefix)
+            EXTRACTOR_PATTERN_EXCLUSION_KEY,
+            SOURCE_PATTERN_EXCLUSION_KEY,
+            // Default for exclusion is "match nothing" (null)
+            null);
+
+    // 4. Combine inclusion and exclusion
+    if (exclusionPattern == null) {
+      // No exclusion defined, return the inclusion pattern directly
+      return inclusionPattern;
+    } else {
+      // If both inclusion and exclusion patterns support IoTDB operations,
+      // use the specialized ExclusionIoTDBTreePattern
+      if (inclusionPattern instanceof IoTDBTreePatternOperations
+          && exclusionPattern instanceof IoTDBTreePatternOperations) {
+        return new WithExclusionIoTDBTreePattern(
+            isTreeModelDataAllowedToBeCaptured,
+            (IoTDBTreePatternOperations) inclusionPattern,
+            (IoTDBTreePatternOperations) exclusionPattern);
+      }
+      // Both are defined, wrap them in an ExclusionTreePattern
+      return new WithExclusionTreePattern(
+          isTreeModelDataAllowedToBeCaptured, inclusionPattern, exclusionPattern);
+    }
+  }
+
+  /**
+   * The main entry point for parsing a pattern string. This method can handle simple patterns
+   * ("root.a"), union patterns ("root.a,root.b"), and exclusion patterns ("INCLUSION(root.a),
+   * EXCLUSION(root.b)").
+   */
+  public static TreePattern parsePatternFromString(
+      final String patternString,
+      final boolean isTreeModelDataAllowedToBeCaptured,
+      final Function<String, TreePattern> basePatternSupplier) {
+    final String trimmedPattern = (patternString == null) ? "" : patternString.trim();
+    if (trimmedPattern.isEmpty()) {
+      return basePatternSupplier.apply("");
+    }
+
+    // 1. Check if it's an Exclusion pattern
+    if (trimmedPattern.startsWith("INCLUSION(") && trimmedPattern.endsWith(")")) {
+      // Find the closing parenthesis for "INCLUSION(...)"
+      final int inclusionEndIndex =
+          findMatchingParenthesis(trimmedPattern, "INCLUSION(".length() - 1);
+      if (inclusionEndIndex == -1) {
+        // Malformed, treat as a normal pattern
+        return buildUnionPattern(
+            isTreeModelDataAllowedToBeCaptured,
+            parseMultiplePatterns(trimmedPattern, basePatternSupplier));
+      }
+
+      // Look for the ", EXCLUSION(" part
+      final String remaining = trimmedPattern.substring(inclusionEndIndex + 1).trim();
+      if (!remaining.startsWith(", EXCLUSION(")) {
+        // Malformed, treat as a normal pattern
+        return buildUnionPattern(
+            isTreeModelDataAllowedToBeCaptured,
+            parseMultiplePatterns(trimmedPattern, basePatternSupplier));
+      }
+
+      try {
+        // Extract the string inside INCLUSION(...)
+        final String inclusionSubstring =
+            trimmedPattern.substring("INCLUSION(".length(), inclusionEndIndex);
+
+        // Extract the string inside EXCLUSION(...)
+        final String exclusionSubstring =
+            trimmedPattern.substring(
+                inclusionEndIndex + ", EXCLUSION(".length() + 1, trimmedPattern.length() - 1);
+
+        // 2. Parse recursively
+        final TreePattern inclusionPattern =
+            parsePatternFromString(
+                inclusionSubstring, isTreeModelDataAllowedToBeCaptured, basePatternSupplier);
+        final TreePattern exclusionPattern =
+            parsePatternFromString(
+                exclusionSubstring, isTreeModelDataAllowedToBeCaptured, basePatternSupplier);
+
+        // 3. Build ExclusionTreePattern
+        if (inclusionPattern instanceof IoTDBTreePatternOperations
+            && exclusionPattern instanceof IoTDBTreePatternOperations) {
+          return new WithExclusionIoTDBTreePattern(
+              isTreeModelDataAllowedToBeCaptured,
+              (IoTDBTreePatternOperations) inclusionPattern,
+              (IoTDBTreePatternOperations) exclusionPattern);
+        }
+        return new WithExclusionTreePattern(
+            isTreeModelDataAllowedToBeCaptured, inclusionPattern, exclusionPattern);
+      } catch (final Exception e) {
+        // Error during parsing (e.g., index out of bounds), treat as a normal pattern
+        return buildUnionPattern(
+            isTreeModelDataAllowedToBeCaptured,
+            parseMultiplePatterns(trimmedPattern, basePatternSupplier));
+      }
+    }
+
+    // 4. Not an Exclusion pattern, treat as a normal pattern
+    return buildUnionPattern(
+        isTreeModelDataAllowedToBeCaptured,
+        parseMultiplePatterns(trimmedPattern, basePatternSupplier));
+  }
+
+  /**
+   * A private helper method to parse a set of 'path' and 'pattern' keys into a single union
+   * TreePattern. This contains the original logic of parsePipePatternFromSourceParameters.
+   *
+   * @param sourceParameters The source parameters.
+   * @param isTreeModelDataAllowedToBeCaptured Flag for TreePattern constructor.
+   * @param extractorPathKey Key for extractor path (e.g., "extractor.path").
+   * @param sourcePathKey Key for source path (e.g., "source.path").
+   * @param extractorPatternKey Key for extractor pattern (e.g., "extractor.pattern").
+   * @param sourcePatternKey Key for source pattern (e.g., "source.pattern").
+   * @param defaultPattern The pattern to return if both path and pattern are null. If this
+   *     parameter is null, this method returns null.
+   * @return The parsed TreePattern, or defaultPattern, or null if defaultPattern is null and no
+   *     patterns are specified.
+   */
+  private static TreePattern parsePatternUnion(
+      final PipeParameters sourceParameters,
+      final boolean isTreeModelDataAllowedToBeCaptured,
+      final String extractorPathKey,
+      final String sourcePathKey,
+      final String extractorPatternKey,
+      final String sourcePatternKey,
+      final TreePattern defaultPattern) {
+
+    final String path = sourceParameters.getStringByKeys(extractorPathKey, sourcePathKey);
+    final String pattern = sourceParameters.getStringByKeys(extractorPatternKey, sourcePatternKey);
 
     // 1. If both "source.path" and "source.pattern" are specified, their union will be used.
     if (path != null && pattern != null) {
@@ -110,10 +331,8 @@ public abstract class TreePattern {
     }
 
     // 4. If neither "source.path" nor "source.pattern" is specified,
-    // this pipe source will match all data.
-    return buildUnionPattern(
-        isTreeModelDataAllowedToBeCaptured,
-        Collections.singletonList(new IoTDBTreePattern(isTreeModelDataAllowedToBeCaptured, null)));
+    // return the provided default pattern (which may be null).
+    return defaultPattern;
   }
 
   /**
@@ -153,7 +372,7 @@ public abstract class TreePattern {
     }
   }
 
-  public static List<TreePattern> parseMultiplePatterns(
+  private static List<TreePattern> parseMultiplePatterns(
       final String pattern, final Function<String, TreePattern> patternSupplier) {
     if (pattern.isEmpty()) {
       return Collections.singletonList(patternSupplier.apply(pattern));
@@ -191,7 +410,7 @@ public abstract class TreePattern {
    * are IoTDBTreePattern, it returns an IoTDBUnionTreePattern. Otherwise, it returns a general
    * UnionTreePattern.
    */
-  public static TreePattern buildUnionPattern(
+  private static TreePattern buildUnionPattern(
       final boolean isTreeModelDataAllowedToBeCaptured, final List<TreePattern> patterns) {
     // Check if all instances in the list are of type IoTDBTreePattern
     boolean allIoTDB = true;
@@ -214,6 +433,28 @@ public abstract class TreePattern {
     }
   }
 
+  /** Helper method to find the matching closing parenthesis, respecting backticks. */
+  private static int findMatchingParenthesis(final String text, final int openParenIndex) {
+    int depth = 1;
+    boolean inBackticks = false;
+
+    for (int i = openParenIndex + 1; i < text.length(); i++) {
+      final char c = text.charAt(i);
+
+      if (c == '`') {
+        inBackticks = !inBackticks;
+      } else if (c == '(' && !inBackticks) {
+        depth++;
+      } else if (c == ')' && !inBackticks) {
+        depth--;
+        if (depth == 0) {
+          return i; // Found the matching closing parenthesis
+        }
+      }
+    }
+    return -1; // Not found
+  }
+
   public static boolean isTreeModelDataAllowToBeCaptured(final PipeParameters sourceParameters) {
     return sourceParameters.getBooleanOrDefault(
             Arrays.asList(
@@ -230,42 +471,86 @@ public abstract class TreePattern {
                 .equals(SystemConstant.SQL_DIALECT_TREE_VALUE));
   }
 
-  public abstract boolean isSingle();
-
-  public abstract String getPattern();
-
-  public abstract boolean isRoot();
-
-  /** Check if this pattern is legal. Different pattern type may have different rules. */
-  public abstract boolean isLegal();
-
-  /** Check if this pattern matches all time-series under a database. */
-  public abstract boolean coversDb(final String db);
-
-  /** Check if a device's all measurements are covered by this pattern. */
-  public abstract boolean coversDevice(final IDeviceID device);
-
   /**
-   * Check if a database may have some measurements matched by the pattern.
+   * Checks if the exclusion pattern fully or partially covers the inclusion pattern and logs a
+   * warning or throws an exception.
    *
-   * @return {@code true} if the pattern may overlap with the database, {@code false} otherwise.
-   */
-  public abstract boolean mayOverlapWithDb(final String db);
-
-  /**
-   * Check if a device may have some measurements matched by the pattern.
+   * <p>This check uses the 'base' inclusion paths from both patterns. It is intended to catch
+   * configuration errors where an exclusion rule negates all or part of an inclusion rule.
    *
-   * <p>NOTE1: this is only called when {@link TreePattern#coversDevice} is {@code false}.
+   * <p>If the exclusion pattern *fully* covers the inclusion pattern (and the inclusion pattern is
+   * not empty), this method will throw a {@link PipeException} to prevent the creation of a pipe
+   * that matches nothing.
    *
-   * <p>NOTE2: this is just a loose check and may have false positives. To further check if a
-   * measurement matches the pattern, please use {@link TreePattern#matchesMeasurement} after this.
-   */
-  public abstract boolean mayOverlapWithDevice(final IDeviceID device);
-
-  /**
-   * Check if a full path with device and measurement can be matched by pattern.
+   * <p>If the exclusion pattern *partially* covers the inclusion pattern, a WARN log will be
+   * generated.
    *
-   * <p>NOTE: this is only called when {@link TreePattern#mayOverlapWithDevice} is {@code true}.
+   * @param inclusion The inclusion pattern.
+   * @param exclusion The exclusion pattern.
+   * @return An int array `[coveredCount, totalInclusionPaths]` for testing non-failing scenarios.
+   * @throws PipeException If the inclusion pattern is fully covered by the exclusion pattern.
    */
-  public abstract boolean matchesMeasurement(final IDeviceID device, final String measurement);
+  public static int[] checkAndLogPatternCoverage(
+      final TreePattern inclusion, final TreePattern exclusion) throws PipeException {
+    if (inclusion == null || exclusion == null) {
+      return new int[] {0, 0};
+    }
+
+    final List<PartialPath> inclusionPaths;
+    final List<PartialPath> exclusionPaths;
+    int coveredCount = 0;
+
+    try {
+      // Get the list of individual paths from both patterns
+      inclusionPaths = inclusion.getBaseInclusionPaths();
+      exclusionPaths = exclusion.getBaseInclusionPaths();
+
+      if (inclusionPaths.isEmpty() || exclusionPaths.isEmpty()) {
+        // Nothing to check
+        return new int[] {0, inclusionPaths.size()};
+      }
+
+      for (final PartialPath incPath : inclusionPaths) {
+        // Check if *any* exclusion path includes this inclusion path
+        final boolean isCovered =
+            exclusionPaths.stream().anyMatch(excPath -> excPath.include(incPath));
+        if (isCovered) {
+          coveredCount++;
+        }
+      }
+    } catch (final Exception e) {
+      // This check is best-effort. Do not fail construction.
+      LOGGER.warn(
+          "Pipe: Failed to perform pattern coverage check for inclusion [{}] and exclusion [{}].",
+          inclusion.getPattern(),
+          exclusion.getPattern(),
+          e);
+      // Return -1 to indicate failure in tests
+      return new int[] {-1, -1};
+    }
+
+    if (coveredCount == inclusionPaths.size() && !inclusionPaths.isEmpty()) {
+      // All inclusion paths are covered by the exclusion
+      final String msg =
+          String.format(
+              "Pipe: The provided exclusion pattern fully covers the inclusion pattern. "
+                  + "This pipe pattern will match nothing. "
+                  + "Inclusion: [%s], Exclusion: [%s]",
+              inclusion.getPattern(), exclusion.getPattern());
+      LOGGER.warn(msg);
+      throw new PipeException(msg);
+    } else if (coveredCount > 0) {
+      // Some inclusion paths are covered
+      LOGGER.warn(
+          "Pipe: The provided exclusion pattern covers {} out of {} inclusion paths. "
+              + "These paths will be excluded. "
+              + "Inclusion: [{}], Exclusion: [{}]",
+          coveredCount,
+          inclusionPaths.size(),
+          inclusion.getPattern(),
+          exclusion.getPattern());
+    }
+
+    return new int[] {coveredCount, inclusionPaths.size()};
+  }
 }
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/UnionIoTDBTreePattern.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/UnionIoTDBTreePattern.java
index a44f4c9d647..1d047ed89b8 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/UnionIoTDBTreePattern.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/UnionIoTDBTreePattern.java
@@ -35,7 +35,7 @@ import java.util.stream.Collectors;
  * Represents a union of multiple {@link IoTDBTreePattern}s. This specialized class ensures type
  * safety and provides access to methods specific to IoTDBTreePattern, such as getIntersection.
  */
-public class UnionIoTDBTreePattern extends TreePattern {
+public class UnionIoTDBTreePattern extends IoTDBTreePatternOperations {
 
   private final List<IoTDBTreePattern> patterns;
 
@@ -55,100 +55,109 @@ public class UnionIoTDBTreePattern extends TreePattern {
     this.patterns = Collections.singletonList(pattern);
   }
 
-  // **********************************************************************
-  // IoTDBTreePattern-specific aggregated methods
-  // **********************************************************************
+  //////////////////////////// Tree Pattern Operations ////////////////////////////
 
-  public boolean matchPrefixPath(final String path) {
-    return patterns.stream().anyMatch(p -> p.matchPrefixPath(path));
+  @Override
+  public String getPattern() {
+    return patterns.stream().map(TreePattern::getPattern).collect(Collectors.joining(","));
   }
 
-  public boolean matchDevice(final String devicePath) {
-    return patterns.stream().anyMatch(p -> p.matchDevice(devicePath));
+  @Override
+  public boolean isRoot() {
+    return patterns.stream().anyMatch(TreePattern::isRoot);
   }
 
-  public boolean matchTailNode(final String tailNode) {
-    return patterns.stream().anyMatch(p -> p.matchTailNode(tailNode));
+  @Override
+  public boolean isLegal() {
+    return patterns.stream().allMatch(TreePattern::isLegal);
   }
 
-  public List<PartialPath> getIntersection(final PartialPath partialPath) {
-    final Set<PartialPath> uniqueIntersections = new LinkedHashSet<>();
-    for (final IoTDBTreePattern pattern : patterns) {
-      uniqueIntersections.addAll(pattern.getIntersection(partialPath));
-    }
-    return new ArrayList<>(uniqueIntersections);
+  @Override
+  public boolean coversDb(final String db) {
+    return patterns.stream().anyMatch(p -> p.coversDb(db));
   }
 
-  public PathPatternTree getIntersection(final PathPatternTree patternTree) {
-    final PathPatternTree resultTree = new PathPatternTree();
-    for (final IoTDBTreePattern pattern : patterns) {
-      final PathPatternTree intersection = pattern.getIntersection(patternTree);
-      if (intersection.isEmpty()) {
-        continue;
-      }
-      intersection.getAllPathPatterns().forEach(resultTree::appendPathPattern);
-    }
-    resultTree.constructTree();
-    return resultTree;
+  @Override
+  public boolean coversDevice(final IDeviceID device) {
+    return patterns.stream().anyMatch(p -> p.coversDevice(device));
   }
 
-  public boolean isPrefixOrFullPath() {
-    return patterns.stream().allMatch(p -> p.isPrefix() || p.isFullPath());
+  @Override
+  public boolean mayOverlapWithDb(final String db) {
+    return patterns.stream().anyMatch(p -> p.mayOverlapWithDb(db));
   }
 
-  public boolean mayMatchMultipleTimeSeriesInOneDevice() {
-    return patterns.stream().anyMatch(IoTDBTreePattern::mayMatchMultipleTimeSeriesInOneDevice);
+  @Override
+  public boolean mayOverlapWithDevice(final IDeviceID device) {
+    return patterns.stream().anyMatch(p -> p.mayOverlapWithDevice(device));
   }
 
-  // **********************************************************************
-  // Implementation of abstract methods from TreePattern
-  // **********************************************************************
-
   @Override
-  public boolean isSingle() {
-    return patterns.size() == 1;
+  public boolean matchesMeasurement(final IDeviceID device, final String measurement) {
+    return patterns.stream().anyMatch(p -> p.matchesMeasurement(device, measurement));
   }
 
   @Override
-  public String getPattern() {
-    return patterns.stream().map(TreePattern::getPattern).collect(Collectors.joining(","));
+  public List<PartialPath> getBaseInclusionPaths() {
+    final List<PartialPath> paths = new ArrayList<>();
+    for (final TreePattern p : patterns) {
+      paths.addAll(p.getBaseInclusionPaths());
+    }
+    return paths;
   }
 
+  //////////////////////////// IoTDB Tree Pattern Operations ////////////////////////////
+
   @Override
-  public boolean isRoot() {
-    return patterns.stream().anyMatch(TreePattern::isRoot);
+  public boolean matchPrefixPath(final String path) {
+    return patterns.stream().anyMatch(p -> p.matchPrefixPath(path));
   }
 
   @Override
-  public boolean isLegal() {
-    return patterns.stream().allMatch(TreePattern::isLegal);
+  public boolean matchDevice(final String devicePath) {
+    return patterns.stream().anyMatch(p -> p.matchDevice(devicePath));
   }
 
   @Override
-  public boolean coversDb(final String db) {
-    return patterns.stream().anyMatch(p -> p.coversDb(db));
+  public boolean matchTailNode(final String tailNode) {
+    return patterns.stream().anyMatch(p -> p.matchTailNode(tailNode));
   }
 
   @Override
-  public boolean coversDevice(final IDeviceID device) {
-    return patterns.stream().anyMatch(p -> p.coversDevice(device));
+  public List<PartialPath> getIntersection(final PartialPath partialPath) {
+    final Set<PartialPath> uniqueIntersections = new LinkedHashSet<>();
+    for (final IoTDBTreePattern pattern : patterns) {
+      uniqueIntersections.addAll(pattern.getIntersection(partialPath));
+    }
+    return new ArrayList<>(uniqueIntersections);
   }
 
   @Override
-  public boolean mayOverlapWithDb(final String db) {
-    return patterns.stream().anyMatch(p -> p.mayOverlapWithDb(db));
+  public PathPatternTree getIntersection(final PathPatternTree patternTree) {
+    final PathPatternTree resultTree = new PathPatternTree();
+    for (final IoTDBTreePattern pattern : patterns) {
+      final PathPatternTree intersection = pattern.getIntersection(patternTree);
+      if (intersection.isEmpty()) {
+        continue;
+      }
+      intersection.getAllPathPatterns().forEach(resultTree::appendPathPattern);
+    }
+    resultTree.constructTree();
+    return resultTree;
   }
 
   @Override
-  public boolean mayOverlapWithDevice(final IDeviceID device) {
-    return patterns.stream().anyMatch(p -> p.mayOverlapWithDevice(device));
+  public boolean isPrefixOrFullPath() {
+    return patterns.stream().allMatch(IoTDBTreePattern::isPrefixOrFullPath);
   }
 
   @Override
-  public boolean matchesMeasurement(final IDeviceID device, final String measurement) {
-    return patterns.stream().anyMatch(p -> p.matchesMeasurement(device, measurement));
+  public boolean mayMatchMultipleTimeSeriesInOneDevice() {
+    return patterns.stream().anyMatch(IoTDBTreePattern::mayMatchMultipleTimeSeriesInOneDevice);
   }
 
+  //////////////////////////// Object ////////////////////////////
+
   @Override
   public String toString() {
     return "UnionIoTDBTreePattern{"
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/UnionTreePattern.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/UnionTreePattern.java
index e43a18ad738..161dfc46f33 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/UnionTreePattern.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/UnionTreePattern.java
@@ -19,8 +19,11 @@
 
 package org.apache.iotdb.commons.pipe.datastructure.pattern;
 
+import org.apache.iotdb.commons.path.PartialPath;
+
 import org.apache.tsfile.file.metadata.IDeviceID;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -38,11 +41,6 @@ public class UnionTreePattern extends TreePattern {
     this.patterns = patterns;
   }
 
-  @Override
-  public boolean isSingle() {
-    return patterns.size() == 1;
-  }
-
   @Override
   public String getPattern() {
     return patterns.stream().map(TreePattern::getPattern).collect(Collectors.joining(","));
@@ -83,6 +81,15 @@ public class UnionTreePattern extends TreePattern {
     return patterns.stream().anyMatch(p -> p.matchesMeasurement(device, measurement));
   }
 
+  @Override
+  public List<PartialPath> getBaseInclusionPaths() {
+    final List<PartialPath> paths = new ArrayList<>();
+    for (final TreePattern p : patterns) {
+      paths.addAll(p.getBaseInclusionPaths());
+    }
+    return paths;
+  }
+
   @Override
   public String toString() {
     return "UnionTreePattern{"
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/WithExclusionIoTDBTreePattern.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/WithExclusionIoTDBTreePattern.java
new file mode 100644
index 00000000000..f2e580e9cdf
--- /dev/null
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/WithExclusionIoTDBTreePattern.java
@@ -0,0 +1,213 @@
+/*
+ * 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.pipe.datastructure.pattern;
+
+import org.apache.iotdb.commons.path.PartialPath;
+import org.apache.iotdb.commons.path.PathPatternTree;
+
+import org.apache.tsfile.file.metadata.IDeviceID;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Represents an exclusion pattern specifically for IoTDB-operation-aware patterns. It holds an
+ * inclusion and exclusion pattern, both implementing {@link IoTDBTreePatternOperations}.
+ *
+ * <p>The logic is: "Matches inclusion AND NOT exclusion" for all methods.
+ */
+public class WithExclusionIoTDBTreePattern extends IoTDBTreePatternOperations {
+
+  private final IoTDBTreePatternOperations inclusionPattern;
+  private final IoTDBTreePatternOperations exclusionPattern;
+
+  public WithExclusionIoTDBTreePattern(
+      final boolean isTreeModelDataAllowedToBeCaptured,
+      final IoTDBTreePatternOperations inclusionPattern,
+      final IoTDBTreePatternOperations exclusionPattern) {
+    super(isTreeModelDataAllowedToBeCaptured);
+    this.inclusionPattern = inclusionPattern;
+    this.exclusionPattern = exclusionPattern;
+
+    TreePattern.checkAndLogPatternCoverage(inclusionPattern, exclusionPattern);
+  }
+
+  public WithExclusionIoTDBTreePattern(
+      final IoTDBTreePatternOperations inclusionPattern,
+      final IoTDBTreePatternOperations exclusionPattern) {
+    this(true, inclusionPattern, exclusionPattern);
+  }
+
+  //////////////////////////// Tree Pattern Operations ////////////////////////////
+
+  @Override
+  public String getPattern() {
+    return "INCLUSION("
+        + inclusionPattern.getPattern()
+        + "), EXCLUSION("
+        + exclusionPattern.getPattern()
+        + ")";
+  }
+
+  @Override
+  public boolean isRoot() {
+    // Since the exclusion is not empty, the whole pattern is always not root because it may more or
+    // less filter some data.
+    return false;
+  }
+
+  @Override
+  public boolean isLegal() {
+    return inclusionPattern.isLegal() && exclusionPattern.isLegal();
+  }
+
+  @Override
+  public boolean coversDb(final String db) {
+    return inclusionPattern.coversDb(db) && !exclusionPattern.mayOverlapWithDb(db);
+  }
+
+  @Override
+  public boolean coversDevice(final IDeviceID device) {
+    return inclusionPattern.coversDevice(device) && !exclusionPattern.mayOverlapWithDevice(device);
+  }
+
+  @Override
+  public boolean mayOverlapWithDb(final String db) {
+    return inclusionPattern.mayOverlapWithDb(db) && !exclusionPattern.coversDb(db);
+  }
+
+  @Override
+  public boolean mayOverlapWithDevice(final IDeviceID device) {
+    return inclusionPattern.mayOverlapWithDevice(device) && !exclusionPattern.coversDevice(device);
+  }
+
+  @Override
+  public boolean matchesMeasurement(final IDeviceID device, final String measurement) {
+    return inclusionPattern.matchesMeasurement(device, measurement)
+        && !exclusionPattern.matchesMeasurement(device, measurement);
+  }
+
+  @Override
+  public List<PartialPath> getBaseInclusionPaths() {
+    throw new UnsupportedOperationException();
+  }
+
+  //////////////////////////// IoTDB Tree Pattern Operations ////////////////////////////
+
+  @Override
+  public boolean matchPrefixPath(final String path) {
+    return inclusionPattern.matchPrefixPath(path) && !exclusionPattern.matchPrefixPath(path);
+  }
+
+  @Override
+  public boolean matchDevice(final String devicePath) {
+    return inclusionPattern.matchDevice(devicePath) && !exclusionPattern.matchDevice(devicePath);
+  }
+
+  @Override
+  public boolean matchTailNode(final String tailNode) {
+    return inclusionPattern.matchTailNode(tailNode) && !exclusionPattern.matchTailNode(tailNode);
+  }
+
+  @Override
+  public List<PartialPath> getIntersection(final PartialPath partialPath) {
+    // 1. Calculate Intersection(Input, Inclusion)
+    final List<PartialPath> inclusionIntersections = inclusionPattern.getIntersection(partialPath);
+    if (inclusionIntersections.isEmpty()) {
+      return Collections.emptyList();
+    }
+
+    // 2. Calculate Intersection(Input, Exclusion)
+    final List<PartialPath> exclusionIntersections = exclusionPattern.getIntersection(partialPath);
+    if (exclusionIntersections.isEmpty()) {
+      // Optimization: No exclusion intersection, return inclusion intersection directly
+      return inclusionIntersections;
+    }
+
+    // 3. Perform the "Subtraction"
+    // Filter out paths from inclusionIntersections that are fully covered by any path
+    // in exclusionIntersections.
+    return inclusionIntersections.stream()
+        .filter(
+            incPath ->
+                exclusionIntersections.stream().noneMatch(excPath -> excPath.include(incPath)))
+        .collect(Collectors.toList());
+  }
+
+  @Override
+  public PathPatternTree getIntersection(final PathPatternTree patternTree) {
+    // 1. Calculate Intersection(Input, Inclusion)
+    final PathPatternTree inclusionIntersectionTree = inclusionPattern.getIntersection(patternTree);
+    if (inclusionIntersectionTree.isEmpty()) {
+      return inclusionIntersectionTree; // Return empty tree
+    }
+
+    // 2. Calculate Intersection(Input, Exclusion)
+    final PathPatternTree exclusionIntersectionTree = exclusionPattern.getIntersection(patternTree);
+    if (exclusionIntersectionTree.isEmpty()) {
+      // Optimization: No exclusion intersection, return inclusion intersection directly
+      return inclusionIntersectionTree;
+    }
+
+    // 3. Perform the "Subtraction"
+    final List<PartialPath> inclusionPaths = inclusionIntersectionTree.getAllPathPatterns();
+    final List<PartialPath> exclusionPaths = exclusionIntersectionTree.getAllPathPatterns();
+
+    final PathPatternTree finalResultTree = new PathPatternTree();
+    for (final PartialPath incPath : inclusionPaths) {
+      // Check if the current inclusion path is covered by *any* exclusion path pattern
+      boolean excluded = exclusionPaths.stream().anyMatch(excPath -> excPath.include(incPath));
+
+      if (!excluded) {
+        finalResultTree.appendPathPattern(incPath); // Add non-excluded path to the result tree
+      }
+    }
+
+    finalResultTree.constructTree();
+    return finalResultTree;
+  }
+
+  @Override
+  public boolean isPrefixOrFullPath() {
+    // Both must be prefix/full-path for the exclusion logic to be sound
+    return inclusionPattern.isPrefixOrFullPath() && exclusionPattern.isPrefixOrFullPath();
+  }
+
+  @Override
+  public boolean mayMatchMultipleTimeSeriesInOneDevice() {
+    // If inclusion might, the result might (even if exclusion trims it)
+    return inclusionPattern.mayMatchMultipleTimeSeriesInOneDevice();
+  }
+
+  //////////////////////////// Object ////////////////////////////
+
+  @Override
+  public String toString() {
+    return "ExclusionIoTDBTreePattern{"
+        + "inclusionPattern="
+        + inclusionPattern
+        + ", exclusionPattern="
+        + exclusionPattern
+        + ", isTreeModelDataAllowedToBeCaptured="
+        + isTreeModelDataAllowedToBeCaptured
+        + '}';
+  }
+}
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/WithExclusionTreePattern.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/WithExclusionTreePattern.java
new file mode 100644
index 00000000000..0cf1d0d1179
--- /dev/null
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/pattern/WithExclusionTreePattern.java
@@ -0,0 +1,119 @@
+/*
+ * 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.pipe.datastructure.pattern;
+
+import org.apache.iotdb.commons.path.PartialPath;
+
+import org.apache.tsfile.file.metadata.IDeviceID;
+
+import java.util.List;
+
+/**
+ * Represents a pattern that includes data matched by an inclusion pattern, except for data matched
+ * by an exclusion pattern.
+ *
+ * <p>The logic implemented in the methods is: "Matches the inclusion pattern AND NOT the exclusion
+ * pattern."
+ */
+public class WithExclusionTreePattern extends TreePattern {
+
+  private final TreePattern inclusionPattern;
+  private final TreePattern exclusionPattern;
+
+  public WithExclusionTreePattern(
+      final boolean isTreeModelDataAllowedToBeCaptured,
+      final TreePattern inclusionPattern,
+      final TreePattern exclusionPattern) {
+    super(isTreeModelDataAllowedToBeCaptured);
+    this.inclusionPattern = inclusionPattern;
+    this.exclusionPattern = exclusionPattern;
+
+    TreePattern.checkAndLogPatternCoverage(inclusionPattern, exclusionPattern);
+  }
+
+  @Override
+  public String getPattern() {
+    return "INCLUSION("
+        + inclusionPattern.getPattern()
+        + "), EXCLUSION("
+        + exclusionPattern.getPattern()
+        + ")";
+  }
+
+  @Override
+  public boolean isRoot() {
+    // Since the exclusion is not empty, the whole pattern is always not root because it may more or
+    // less filter some data.
+    return false;
+  }
+
+  @Override
+  public boolean isLegal() {
+    return inclusionPattern.isLegal() && exclusionPattern.isLegal();
+  }
+
+  @Override
+  public boolean coversDb(final String db) {
+    // Covers DB if inclusion covers it AND exclusion doesn't overlap at all.
+    return inclusionPattern.coversDb(db) && !exclusionPattern.mayOverlapWithDb(db);
+  }
+
+  @Override
+  public boolean coversDevice(final IDeviceID device) {
+    // Covers device if inclusion covers it AND exclusion doesn't overlap at all.
+    return inclusionPattern.coversDevice(device) && !exclusionPattern.mayOverlapWithDevice(device);
+  }
+
+  @Override
+  public boolean mayOverlapWithDb(final String db) {
+    // May overlap if inclusion overlaps AND exclusion doesn't fully cover it.
+    return inclusionPattern.mayOverlapWithDb(db) && !exclusionPattern.coversDb(db);
+  }
+
+  @Override
+  public boolean mayOverlapWithDevice(final IDeviceID device) {
+    // May overlap if inclusion overlaps AND exclusion doesn't fully cover it.
+    return inclusionPattern.mayOverlapWithDevice(device) && !exclusionPattern.coversDevice(device);
+  }
+
+  @Override
+  public boolean matchesMeasurement(final IDeviceID device, final String measurement) {
+    // The core logic: Must match inclusion AND NOT match exclusion.
+    return inclusionPattern.matchesMeasurement(device, measurement)
+        && !exclusionPattern.matchesMeasurement(device, measurement);
+  }
+
+  @Override
+  public List<PartialPath> getBaseInclusionPaths() {
+    throw new UnsupportedOperationException();
+  }
+
+  @Override
+  public String toString() {
+    return "ExclusionTreePattern{"
+        + "inclusionPattern="
+        + inclusionPattern
+        + ", exclusionPattern="
+        + exclusionPattern
+        + ", isTreeModelDataAllowedToBeCaptured="
+        + isTreeModelDataAllowedToBeCaptured
+        + '}';
+  }
+}
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/source/IoTDBNonDataRegionSource.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/source/IoTDBNonDataRegionSource.java
index acb0ae825ac..80e24451936 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/source/IoTDBNonDataRegionSource.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/source/IoTDBNonDataRegionSource.java
@@ -24,9 +24,9 @@ import org.apache.iotdb.commons.consensus.index.impl.MetaProgressIndex;
 import org.apache.iotdb.commons.consensus.index.impl.MinimumProgressIndex;
 import org.apache.iotdb.commons.exception.IllegalPathException;
 import org.apache.iotdb.commons.exception.auth.AccessDeniedException;
+import org.apache.iotdb.commons.pipe.datastructure.pattern.IoTDBTreePatternOperations;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TablePattern;
 import org.apache.iotdb.commons.pipe.datastructure.pattern.TreePattern;
-import org.apache.iotdb.commons.pipe.datastructure.pattern.UnionIoTDBTreePattern;
 import org.apache.iotdb.commons.pipe.datastructure.queue.ConcurrentIterableLinkedQueue;
 import org.apache.iotdb.commons.pipe.datastructure.queue.listening.AbstractPipeListeningQueue;
 import org.apache.iotdb.commons.pipe.event.EnrichedEvent;
@@ -53,7 +53,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 @TableModel
 public abstract class IoTDBNonDataRegionSource extends IoTDBSource {
 
-  protected UnionIoTDBTreePattern treePattern;
+  protected IoTDBTreePatternOperations treePattern;
   protected TablePattern tablePattern;
 
   private List<PipeSnapshotEvent> historicalEvents = new LinkedList<>();
@@ -78,14 +78,14 @@ public abstract class IoTDBNonDataRegionSource extends IoTDBSource {
 
     final TreePattern pattern = TreePattern.parsePipePatternFromSourceParameters(parameters);
 
-    if (!(pattern instanceof UnionIoTDBTreePattern
-        && (((UnionIoTDBTreePattern) pattern).isPrefixOrFullPath()))) {
+    if (!(pattern instanceof IoTDBTreePatternOperations
+        && (((IoTDBTreePatternOperations) pattern).isPrefixOrFullPath()))) {
       throw new IllegalArgumentException(
           String.format(
               "The path pattern %s is not valid for the source. Only prefix or full path is allowed.",
               pattern.getPattern()));
     }
-    treePattern = (UnionIoTDBTreePattern) pattern;
+    treePattern = (IoTDBTreePatternOperations) pattern;
     tablePattern = TablePattern.parsePipePatternFromSourceParameters(parameters);
   }
 
@@ -178,7 +178,7 @@ public abstract class IoTDBNonDataRegionSource extends IoTDBSource {
                       pipeName,
                       creationTime,
                       pipeTaskMeta,
-                      treePattern,
+                      (TreePattern) treePattern,
                       tablePattern,
                       userId,
                       userName,
@@ -241,7 +241,7 @@ public abstract class IoTDBNonDataRegionSource extends IoTDBSource {
                 pipeName,
                 creationTime,
                 pipeTaskMeta,
-                treePattern,
+                (TreePattern) treePattern,
                 tablePattern,
                 userId,
                 userName,


(iotdb) 44/45: [AINode] Delete poetry.lock for easier maintain different operating systems (#16793)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit a1b2287f91efa91ecb3dac3a9c672bb3da40fc28
Author: Yongzao <yo...@apache.org>
AuthorDate: Tue Nov 25 19:43:14 2025 +0800

    [AINode] Delete poetry.lock for easier maintain different operating systems (#16793)
    
    (cherry picked from commit 50f92e48cf6f34cb29d733ba3df586c6ff62b481)
---
 iotdb-core/ainode/.gitignore      |    3 +
 iotdb-core/ainode/build_binary.py |    8 +
 iotdb-core/ainode/poetry.lock     | 2331 -------------------------------------
 3 files changed, 11 insertions(+), 2331 deletions(-)

diff --git a/iotdb-core/ainode/.gitignore b/iotdb-core/ainode/.gitignore
index bdb2698ec78..e4947e516d3 100644
--- a/iotdb-core/ainode/.gitignore
+++ b/iotdb-core/ainode/.gitignore
@@ -14,6 +14,9 @@
 # generated by maven
 /iotdb/ainode/conf/
 
+# generated by poetry
+poetry.lock
+
 # generated by pyinstaller
 /dist/
 /build/
diff --git a/iotdb-core/ainode/build_binary.py b/iotdb-core/ainode/build_binary.py
index ff99fda0933..01b0ef67e8f 100644
--- a/iotdb-core/ainode/build_binary.py
+++ b/iotdb-core/ainode/build_binary.py
@@ -434,6 +434,14 @@ def install_dependencies(venv_python, venv_dir, script_dir):
     verify_poetry_env()  # Verify after lock
 
     print("Running poetry install...")
+    subprocess.run(
+        [str(poetry_exe), "lock"],
+        cwd=str(script_dir),
+        env=venv_env,
+        check=True,
+        capture_output=True,
+        text=True,
+    )
     verify_poetry_env()  # Verify before install
     result = subprocess.run(
         [str(poetry_exe), "install"],
diff --git a/iotdb-core/ainode/poetry.lock b/iotdb-core/ainode/poetry.lock
deleted file mode 100644
index a2d8ce581f1..00000000000
--- a/iotdb-core/ainode/poetry.lock
+++ /dev/null
@@ -1,2331 +0,0 @@
-# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand.
-
-[[package]]
-name = "alembic"
-version = "1.16.5"
-description = "A database migration tool for SQLAlchemy."
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "alembic-1.16.5-py3-none-any.whl", hash = "sha256:e845dfe090c5ffa7b92593ae6687c5cb1a101e91fa53868497dbd79847f9dbe3"},
-    {file = "alembic-1.16.5.tar.gz", hash = "sha256:a88bb7f6e513bd4301ecf4c7f2206fe93f9913f9b48dac3b78babde2d6fe765e"},
-]
-
-[package.dependencies]
-Mako = "*"
-SQLAlchemy = ">=1.4.0"
-typing-extensions = ">=4.12"
-
-[package.extras]
-tz = ["tzdata"]
-
-[[package]]
-name = "altgraph"
-version = "0.17.4"
-description = "Python graph (network) package"
-optional = false
-python-versions = "*"
-groups = ["main"]
-files = [
-    {file = "altgraph-0.17.4-py2.py3-none-any.whl", hash = "sha256:642743b4750de17e655e6711601b077bc6598dbfa3ba5fa2b2a35ce12b508dff"},
-    {file = "altgraph-0.17.4.tar.gz", hash = "sha256:1b5afbb98f6c4dcadb2e2ae6ab9fa994bbb8c1d75f4fa96d340f9437ae454406"},
-]
-
-[[package]]
-name = "black"
-version = "25.1.0"
-description = "The uncompromising code formatter."
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "black-25.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:759e7ec1e050a15f89b770cefbf91ebee8917aac5c20483bc2d80a6c3a04df32"},
-    {file = "black-25.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e519ecf93120f34243e6b0054db49c00a35f84f195d5bce7e9f5cfc578fc2da"},
-    {file = "black-25.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:055e59b198df7ac0b7efca5ad7ff2516bca343276c466be72eb04a3bcc1f82d7"},
-    {file = "black-25.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:db8ea9917d6f8fc62abd90d944920d95e73c83a5ee3383493e35d271aca872e9"},
-    {file = "black-25.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a39337598244de4bae26475f77dda852ea00a93bd4c728e09eacd827ec929df0"},
-    {file = "black-25.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:96c1c7cd856bba8e20094e36e0f948718dc688dba4a9d78c3adde52b9e6c2299"},
-    {file = "black-25.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bce2e264d59c91e52d8000d507eb20a9aca4a778731a08cfff7e5ac4a4bb7096"},
-    {file = "black-25.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:172b1dbff09f86ce6f4eb8edf9dede08b1fce58ba194c87d7a4f1a5aa2f5b3c2"},
-    {file = "black-25.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4b60580e829091e6f9238c848ea6750efed72140b91b048770b64e74fe04908b"},
-    {file = "black-25.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e2978f6df243b155ef5fa7e558a43037c3079093ed5d10fd84c43900f2d8ecc"},
-    {file = "black-25.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3b48735872ec535027d979e8dcb20bf4f70b5ac75a8ea99f127c106a7d7aba9f"},
-    {file = "black-25.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:ea0213189960bda9cf99be5b8c8ce66bb054af5e9e861249cd23471bd7b0b3ba"},
-    {file = "black-25.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8f0b18a02996a836cc9c9c78e5babec10930862827b1b724ddfe98ccf2f2fe4f"},
-    {file = "black-25.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:afebb7098bfbc70037a053b91ae8437c3857482d3a690fefc03e9ff7aa9a5fd3"},
-    {file = "black-25.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:030b9759066a4ee5e5aca28c3c77f9c64789cdd4de8ac1df642c40b708be6171"},
-    {file = "black-25.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:a22f402b410566e2d1c950708c77ebf5ebd5d0d88a6a2e87c86d9fb48afa0d18"},
-    {file = "black-25.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a1ee0a0c330f7b5130ce0caed9936a904793576ef4d2b98c40835d6a65afa6a0"},
-    {file = "black-25.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3df5f1bf91d36002b0a75389ca8663510cf0531cca8aa5c1ef695b46d98655f"},
-    {file = "black-25.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d9e6827d563a2c820772b32ce8a42828dc6790f095f441beef18f96aa6f8294e"},
-    {file = "black-25.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:bacabb307dca5ebaf9c118d2d2f6903da0d62c9faa82bd21a33eecc319559355"},
-    {file = "black-25.1.0-py3-none-any.whl", hash = "sha256:95e8176dae143ba9097f351d174fdaf0ccd29efb414b362ae3fd72bf0f710717"},
-    {file = "black-25.1.0.tar.gz", hash = "sha256:33496d5cd1222ad73391352b4ae8da15253c5de89b93a80b3e2c8d9a19ec2666"},
-]
-
-[package.dependencies]
-click = ">=8.0.0"
-mypy-extensions = ">=0.4.3"
-packaging = ">=22.0"
-pathspec = ">=0.9.0"
-platformdirs = ">=2"
-
-[package.extras]
-colorama = ["colorama (>=0.4.3)"]
-d = ["aiohttp (>=3.10)"]
-jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"]
-uvloop = ["uvloop (>=0.15.2)"]
-
-[[package]]
-name = "certifi"
-version = "2025.8.3"
-description = "Python package for providing Mozilla's CA Bundle."
-optional = false
-python-versions = ">=3.7"
-groups = ["main"]
-files = [
-    {file = "certifi-2025.8.3-py3-none-any.whl", hash = "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5"},
-    {file = "certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407"},
-]
-
-[[package]]
-name = "charset-normalizer"
-version = "3.4.3"
-description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
-optional = false
-python-versions = ">=3.7"
-groups = ["main"]
-files = [
-    {file = "charset_normalizer-3.4.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fb7f67a1bfa6e40b438170ebdc8158b78dc465a5a67b6dde178a46987b244a72"},
-    {file = "charset_normalizer-3.4.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cc9370a2da1ac13f0153780040f465839e6cccb4a1e44810124b4e22483c93fe"},
-    {file = "charset_normalizer-3.4.3-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:07a0eae9e2787b586e129fdcbe1af6997f8d0e5abaa0bc98c0e20e124d67e601"},
-    {file = "charset_normalizer-3.4.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:74d77e25adda8581ffc1c720f1c81ca082921329452eba58b16233ab1842141c"},
-    {file = "charset_normalizer-3.4.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d0e909868420b7049dafd3a31d45125b31143eec59235311fc4c57ea26a4acd2"},
-    {file = "charset_normalizer-3.4.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c6f162aabe9a91a309510d74eeb6507fab5fff92337a15acbe77753d88d9dcf0"},
-    {file = "charset_normalizer-3.4.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:4ca4c094de7771a98d7fbd67d9e5dbf1eb73efa4f744a730437d8a3a5cf994f0"},
-    {file = "charset_normalizer-3.4.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:02425242e96bcf29a49711b0ca9f37e451da7c70562bc10e8ed992a5a7a25cc0"},
-    {file = "charset_normalizer-3.4.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:78deba4d8f9590fe4dae384aeff04082510a709957e968753ff3c48399f6f92a"},
-    {file = "charset_normalizer-3.4.3-cp310-cp310-win32.whl", hash = "sha256:d79c198e27580c8e958906f803e63cddb77653731be08851c7df0b1a14a8fc0f"},
-    {file = "charset_normalizer-3.4.3-cp310-cp310-win_amd64.whl", hash = "sha256:c6e490913a46fa054e03699c70019ab869e990270597018cef1d8562132c2669"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b256ee2e749283ef3ddcff51a675ff43798d92d746d1a6e4631bf8c707d22d0b"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:13faeacfe61784e2559e690fc53fa4c5ae97c6fcedb8eb6fb8d0a15b475d2c64"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:00237675befef519d9af72169d8604a067d92755e84fe76492fef5441db05b91"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:585f3b2a80fbd26b048a0be90c5aae8f06605d3c92615911c3a2b03a8a3b796f"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e78314bdc32fa80696f72fa16dc61168fda4d6a0c014e0380f9d02f0e5d8a07"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:96b2b3d1a83ad55310de8c7b4a2d04d9277d5591f40761274856635acc5fcb30"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:939578d9d8fd4299220161fdd76e86c6a251987476f5243e8864a7844476ba14"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:fd10de089bcdcd1be95a2f73dbe6254798ec1bda9f450d5828c96f93e2536b9c"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1e8ac75d72fa3775e0b7cb7e4629cec13b7514d928d15ef8ea06bca03ef01cae"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-win32.whl", hash = "sha256:6cf8fd4c04756b6b60146d98cd8a77d0cdae0e1ca20329da2ac85eed779b6849"},
-    {file = "charset_normalizer-3.4.3-cp311-cp311-win_amd64.whl", hash = "sha256:31a9a6f775f9bcd865d88ee350f0ffb0e25936a7f930ca98995c05abf1faf21c"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:e28e334d3ff134e88989d90ba04b47d84382a828c061d0d1027b1b12a62b39b1"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0cacf8f7297b0c4fcb74227692ca46b4a5852f8f4f24b3c766dd94a1075c4884"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c6fd51128a41297f5409deab284fecbe5305ebd7e5a1f959bee1c054622b7018"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3cfb2aad70f2c6debfbcb717f23b7eb55febc0bb23dcffc0f076009da10c6392"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1606f4a55c0fd363d754049cdf400175ee96c992b1f8018b993941f221221c5f"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:027b776c26d38b7f15b26a5da1044f376455fb3766df8fc38563b4efbc515154"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:42e5088973e56e31e4fa58eb6bd709e42fc03799c11c42929592889a2e54c491"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:cc34f233c9e71701040d772aa7490318673aa7164a0efe3172b2981218c26d93"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:320e8e66157cc4e247d9ddca8e21f427efc7a04bbd0ac8a9faf56583fa543f9f"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-win32.whl", hash = "sha256:fb6fecfd65564f208cbf0fba07f107fb661bcd1a7c389edbced3f7a493f70e37"},
-    {file = "charset_normalizer-3.4.3-cp312-cp312-win_amd64.whl", hash = "sha256:86df271bf921c2ee3818f0522e9a5b8092ca2ad8b065ece5d7d9d0e9f4849bcc"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:14c2a87c65b351109f6abfc424cab3927b3bdece6f706e4d12faaf3d52ee5efe"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:41d1fc408ff5fdfb910200ec0e74abc40387bccb3252f3f27c0676731df2b2c8"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1bb60174149316da1c35fa5233681f7c0f9f514509b8e399ab70fea5f17e45c9"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:30d006f98569de3459c2fc1f2acde170b7b2bd265dc1943e87e1a4efe1b67c31"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:416175faf02e4b0810f1f38bcb54682878a4af94059a1cd63b8747244420801f"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6aab0f181c486f973bc7262a97f5aca3ee7e1437011ef0c2ec04b5a11d16c927"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:fdabf8315679312cfa71302f9bd509ded4f2f263fb5b765cf1433b39106c3cc9"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:bd28b817ea8c70215401f657edef3a8aa83c29d447fb0b622c35403780ba11d5"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:18343b2d246dc6761a249ba1fb13f9ee9a2bcd95decc767319506056ea4ad4dc"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-win32.whl", hash = "sha256:6fb70de56f1859a3f71261cbe41005f56a7842cc348d3aeb26237560bfa5e0ce"},
-    {file = "charset_normalizer-3.4.3-cp313-cp313-win_amd64.whl", hash = "sha256:cf1ebb7d78e1ad8ec2a8c4732c7be2e736f6e5123a4146c5b89c9d1f585f8cef"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3cd35b7e8aedeb9e34c41385fda4f73ba609e561faedfae0a9e75e44ac558a15"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b89bc04de1d83006373429975f8ef9e7932534b8cc9ca582e4db7d20d91816db"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2001a39612b241dae17b4687898843f254f8748b796a2e16f1051a17078d991d"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8dcfc373f888e4fb39a7bc57e93e3b845e7f462dacc008d9749568b1c4ece096"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:18b97b8404387b96cdbd30ad660f6407799126d26a39ca65729162fd810a99aa"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ccf600859c183d70eb47e05a44cd80a4ce77394d1ac0f79dbd2dd90a69a3a049"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:53cd68b185d98dde4ad8990e56a58dea83a4162161b1ea9272e5c9182ce415e0"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:30a96e1e1f865f78b030d65241c1ee850cdf422d869e9028e2fc1d5e4db73b92"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d716a916938e03231e86e43782ca7878fb602a125a91e7acb8b5112e2e96ac16"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-win32.whl", hash = "sha256:c6dbd0ccdda3a2ba7c2ecd9d77b37f3b5831687d8dc1b6ca5f56a4880cc7b7ce"},
-    {file = "charset_normalizer-3.4.3-cp314-cp314-win_amd64.whl", hash = "sha256:73dc19b562516fc9bcf6e5d6e596df0b4eb98d87e4f79f3ae71840e6ed21361c"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:0f2be7e0cf7754b9a30eb01f4295cc3d4358a479843b31f328afd210e2c7598c"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c60e092517a73c632ec38e290eba714e9627abe9d301c8c8a12ec32c314a2a4b"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:252098c8c7a873e17dd696ed98bbe91dbacd571da4b87df3736768efa7a792e4"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3653fad4fe3ed447a596ae8638b437f827234f01a8cd801842e43f3d0a6b281b"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8999f965f922ae054125286faf9f11bc6932184b93011d138925a1773830bbe9"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d95bfb53c211b57198bb91c46dd5a2d8018b3af446583aab40074bf7988401cb"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:5b413b0b1bfd94dbf4023ad6945889f374cd24e3f62de58d6bb102c4d9ae534a"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:b5e3b2d152e74e100a9e9573837aba24aab611d39428ded46f4e4022ea7d1942"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:a2d08ac246bb48479170408d6c19f6385fa743e7157d716e144cad849b2dd94b"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-win32.whl", hash = "sha256:ec557499516fc90fd374bf2e32349a2887a876fbf162c160e3c01b6849eaf557"},
-    {file = "charset_normalizer-3.4.3-cp38-cp38-win_amd64.whl", hash = "sha256:5d8d01eac18c423815ed4f4a2ec3b439d654e55ee4ad610e153cf02faf67ea40"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:70bfc5f2c318afece2f5838ea5e4c3febada0be750fcf4775641052bbba14d05"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:23b6b24d74478dc833444cbd927c338349d6ae852ba53a0d02a2de1fce45b96e"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:34a7f768e3f985abdb42841e20e17b330ad3aaf4bb7e7aeeb73db2e70f077b99"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fb731e5deb0c7ef82d698b0f4c5bb724633ee2a489401594c5c88b02e6cb15f7"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:257f26fed7d7ff59921b78244f3cd93ed2af1800ff048c33f624c87475819dd7"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1ef99f0456d3d46a50945c98de1774da86f8e992ab5c77865ea8b8195341fc19"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:2c322db9c8c89009a990ef07c3bcc9f011a3269bc06782f916cd3d9eed7c9312"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:511729f456829ef86ac41ca78c63a5cb55240ed23b4b737faca0eb1abb1c41bc"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:88ab34806dea0671532d3f82d82b85e8fc23d7b2dd12fa837978dad9bb392a34"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-win32.whl", hash = "sha256:16a8770207946ac75703458e2c743631c79c59c5890c80011d536248f8eaa432"},
-    {file = "charset_normalizer-3.4.3-cp39-cp39-win_amd64.whl", hash = "sha256:d22dbedd33326a4a5190dd4fe9e9e693ef12160c77382d9e87919bce54f3d4ca"},
-    {file = "charset_normalizer-3.4.3-py3-none-any.whl", hash = "sha256:ce571ab16d890d23b5c278547ba694193a45011ff86a9162a71307ed9f86759a"},
-    {file = "charset_normalizer-3.4.3.tar.gz", hash = "sha256:6fce4b8500244f6fcb71465d4a4930d132ba9ab8e71a7859e6a5d59851068d14"},
-]
-
-[[package]]
-name = "click"
-version = "8.3.0"
-description = "Composable command line interface toolkit"
-optional = false
-python-versions = ">=3.10"
-groups = ["main"]
-files = [
-    {file = "click-8.3.0-py3-none-any.whl", hash = "sha256:9b9f285302c6e3064f4330c05f05b81945b2a39544279343e6e7c5f27a9baddc"},
-    {file = "click-8.3.0.tar.gz", hash = "sha256:e7b8232224eba16f4ebe410c25ced9f7875cb5f3263ffc93cc3e8da705e229c4"},
-]
-
-[package.dependencies]
-colorama = {version = "*", markers = "platform_system == \"Windows\""}
-
-[[package]]
-name = "colorama"
-version = "0.4.6"
-description = "Cross-platform colored terminal text."
-optional = false
-python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
-groups = ["main"]
-markers = "platform_system == \"Windows\" or sys_platform == \"win32\""
-files = [
-    {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
-    {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
-]
-
-[[package]]
-name = "colorlog"
-version = "6.9.0"
-description = "Add colours to the output of Python's logging module."
-optional = false
-python-versions = ">=3.6"
-groups = ["main"]
-files = [
-    {file = "colorlog-6.9.0-py3-none-any.whl", hash = "sha256:5906e71acd67cb07a71e779c47c4bcb45fb8c2993eebe9e5adcd6a6f1b283eff"},
-    {file = "colorlog-6.9.0.tar.gz", hash = "sha256:bfba54a1b93b94f54e1f4fe48395725a3d92fd2a4af702f6bd70946bdc0c6ac2"},
-]
-
-[package.dependencies]
-colorama = {version = "*", markers = "sys_platform == \"win32\""}
-
-[package.extras]
-development = ["black", "flake8", "mypy", "pytest", "types-colorama"]
-
-[[package]]
-name = "dynaconf"
-version = "3.2.11"
-description = "The dynamic configurator for your Python Project"
-optional = false
-python-versions = ">=3.8"
-groups = ["main"]
-files = [
-    {file = "dynaconf-3.2.11-py2.py3-none-any.whl", hash = "sha256:660de90879d4da236f79195692a7d197957224d7acf922bcc6899187dc7b4a27"},
-    {file = "dynaconf-3.2.11.tar.gz", hash = "sha256:4cfc6a730c533bf1a1d0bf266ae202133a22236bb3227d23eff4b8542d4034a5"},
-]
-
-[package.extras]
-all = ["configobj", "hvac", "redis", "ruamel.yaml"]
-configobj = ["configobj"]
-ini = ["configobj"]
-redis = ["redis"]
-test = ["configobj", "django", "flask (>=0.12)", "hvac (>=1.1.0)", "pytest", "pytest-cov", "pytest-mock", "pytest-xdist", "python-dotenv", "radon", "redis", "toml"]
-toml = ["toml"]
-vault = ["hvac"]
-yaml = ["ruamel.yaml"]
-
-[[package]]
-name = "einops"
-version = "0.8.1"
-description = "A new flavour of deep learning operations"
-optional = false
-python-versions = ">=3.8"
-groups = ["main"]
-files = [
-    {file = "einops-0.8.1-py3-none-any.whl", hash = "sha256:919387eb55330f5757c6bea9165c5ff5cfe63a642682ea788a6d472576d81737"},
-    {file = "einops-0.8.1.tar.gz", hash = "sha256:de5d960a7a761225532e0f1959e5315ebeafc0cd43394732f103ca44b9837e84"},
-]
-
-[[package]]
-name = "filelock"
-version = "3.19.1"
-description = "A platform independent file lock."
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "filelock-3.19.1-py3-none-any.whl", hash = "sha256:d38e30481def20772f5baf097c122c3babc4fcdb7e14e57049eb9d88c6dc017d"},
-    {file = "filelock-3.19.1.tar.gz", hash = "sha256:66eda1888b0171c998b35be2bcc0f6d75c388a7ce20c3f3f37aa8e96c2dddf58"},
-]
-
-[[package]]
-name = "fsspec"
-version = "2025.9.0"
-description = "File-system specification"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "fsspec-2025.9.0-py3-none-any.whl", hash = "sha256:530dc2a2af60a414a832059574df4a6e10cce927f6f4a78209390fe38955cfb7"},
-    {file = "fsspec-2025.9.0.tar.gz", hash = "sha256:19fd429483d25d28b65ec68f9f4adc16c17ea2c7c7bf54ec61360d478fb19c19"},
-]
-
-[package.extras]
-abfs = ["adlfs"]
-adl = ["adlfs"]
-arrow = ["pyarrow (>=1)"]
-dask = ["dask", "distributed"]
-dev = ["pre-commit", "ruff (>=0.5)"]
-doc = ["numpydoc", "sphinx", "sphinx-design", "sphinx-rtd-theme", "yarl"]
-dropbox = ["dropbox", "dropboxdrivefs", "requests"]
-full = ["adlfs", "aiohttp (!=4.0.0a0,!=4.0.0a1)", "dask", "distributed", "dropbox", "dropboxdrivefs", "fusepy", "gcsfs", "libarchive-c", "ocifs", "panel", "paramiko", "pyarrow (>=1)", "pygit2", "requests", "s3fs", "smbprotocol", "tqdm"]
-fuse = ["fusepy"]
-gcs = ["gcsfs"]
-git = ["pygit2"]
-github = ["requests"]
-gs = ["gcsfs"]
-gui = ["panel"]
-hdfs = ["pyarrow (>=1)"]
-http = ["aiohttp (!=4.0.0a0,!=4.0.0a1)"]
-libarchive = ["libarchive-c"]
-oci = ["ocifs"]
-s3 = ["s3fs"]
-sftp = ["paramiko"]
-smb = ["smbprotocol"]
-ssh = ["paramiko"]
-test = ["aiohttp (!=4.0.0a0,!=4.0.0a1)", "numpy", "pytest", "pytest-asyncio (!=0.22.0)", "pytest-benchmark", "pytest-cov", "pytest-mock", "pytest-recording", "pytest-rerunfailures", "requests"]
-test-downstream = ["aiobotocore (>=2.5.4,<3.0.0)", "dask[dataframe,test]", "moto[server] (>4,<5)", "pytest-timeout", "xarray"]
-test-full = ["adlfs", "aiohttp (!=4.0.0a0,!=4.0.0a1)", "cloudpickle", "dask", "distributed", "dropbox", "dropboxdrivefs", "fastparquet", "fusepy", "gcsfs", "jinja2", "kerchunk", "libarchive-c", "lz4", "notebook", "numpy", "ocifs", "pandas", "panel", "paramiko", "pyarrow", "pyarrow (>=1)", "pyftpdlib", "pygit2", "pytest", "pytest-asyncio (!=0.22.0)", "pytest-benchmark", "pytest-cov", "pytest-mock", "pytest-recording", "pytest-rerunfailures", "python-snappy", "requests", "smbprotocol", "tq [...]
-tqdm = ["tqdm"]
-
-[[package]]
-name = "greenlet"
-version = "3.2.4"
-description = "Lightweight in-process concurrent programming"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-markers = "platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\""
-files = [
-    {file = "greenlet-3.2.4-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:8c68325b0d0acf8d91dde4e6f930967dd52a5302cd4062932a6b2e7c2969f47c"},
-    {file = "greenlet-3.2.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:94385f101946790ae13da500603491f04a76b6e4c059dab271b3ce2e283b2590"},
-    {file = "greenlet-3.2.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:f10fd42b5ee276335863712fa3da6608e93f70629c631bf77145021600abc23c"},
-    {file = "greenlet-3.2.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:c8c9e331e58180d0d83c5b7999255721b725913ff6bc6cf39fa2a45841a4fd4b"},
-    {file = "greenlet-3.2.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:58b97143c9cc7b86fc458f215bd0932f1757ce649e05b640fea2e79b54cedb31"},
-    {file = "greenlet-3.2.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c2ca18a03a8cfb5b25bc1cbe20f3d9a4c80d8c3b13ba3df49ac3961af0b1018d"},
-    {file = "greenlet-3.2.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:9fe0a28a7b952a21e2c062cd5756d34354117796c6d9215a87f55e38d15402c5"},
-    {file = "greenlet-3.2.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8854167e06950ca75b898b104b63cc646573aa5fef1353d4508ecdd1ee76254f"},
-    {file = "greenlet-3.2.4-cp310-cp310-win_amd64.whl", hash = "sha256:73f49b5368b5359d04e18d15828eecc1806033db5233397748f4ca813ff1056c"},
-    {file = "greenlet-3.2.4-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:96378df1de302bc38e99c3a9aa311967b7dc80ced1dcc6f171e99842987882a2"},
-    {file = "greenlet-3.2.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:1ee8fae0519a337f2329cb78bd7a8e128ec0f881073d43f023c7b8d4831d5246"},
-    {file = "greenlet-3.2.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:94abf90142c2a18151632371140b3dba4dee031633fe614cb592dbb6c9e17bc3"},
-    {file = "greenlet-3.2.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:4d1378601b85e2e5171b99be8d2dc85f594c79967599328f95c1dc1a40f1c633"},
-    {file = "greenlet-3.2.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0db5594dce18db94f7d1650d7489909b57afde4c580806b8d9203b6e79cdc079"},
-    {file = "greenlet-3.2.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2523e5246274f54fdadbce8494458a2ebdcdbc7b802318466ac5606d3cded1f8"},
-    {file = "greenlet-3.2.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1987de92fec508535687fb807a5cea1560f6196285a4cde35c100b8cd632cc52"},
-    {file = "greenlet-3.2.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:55e9c5affaa6775e2c6b67659f3a71684de4c549b3dd9afca3bc773533d284fa"},
-    {file = "greenlet-3.2.4-cp311-cp311-win_amd64.whl", hash = "sha256:9c40adce87eaa9ddb593ccb0fa6a07caf34015a29bf8d344811665b573138db9"},
-    {file = "greenlet-3.2.4-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:3b67ca49f54cede0186854a008109d6ee71f66bd57bb36abd6d0a0267b540cdd"},
-    {file = "greenlet-3.2.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ddf9164e7a5b08e9d22511526865780a576f19ddd00d62f8a665949327fde8bb"},
-    {file = "greenlet-3.2.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:f28588772bb5fb869a8eb331374ec06f24a83a9c25bfa1f38b6993afe9c1e968"},
-    {file = "greenlet-3.2.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:5c9320971821a7cb77cfab8d956fa8e39cd07ca44b6070db358ceb7f8797c8c9"},
-    {file = "greenlet-3.2.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c60a6d84229b271d44b70fb6e5fa23781abb5d742af7b808ae3f6efd7c9c60f6"},
-    {file = "greenlet-3.2.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3b3812d8d0c9579967815af437d96623f45c0f2ae5f04e366de62a12d83a8fb0"},
-    {file = "greenlet-3.2.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:abbf57b5a870d30c4675928c37278493044d7c14378350b3aa5d484fa65575f0"},
-    {file = "greenlet-3.2.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:20fb936b4652b6e307b8f347665e2c615540d4b42b3b4c8a321d8286da7e520f"},
-    {file = "greenlet-3.2.4-cp312-cp312-win_amd64.whl", hash = "sha256:a7d4e128405eea3814a12cc2605e0e6aedb4035bf32697f72deca74de4105e02"},
-    {file = "greenlet-3.2.4-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:1a921e542453fe531144e91e1feedf12e07351b1cf6c9e8a3325ea600a715a31"},
-    {file = "greenlet-3.2.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cd3c8e693bff0fff6ba55f140bf390fa92c994083f838fece0f63be121334945"},
-    {file = "greenlet-3.2.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:710638eb93b1fa52823aa91bf75326f9ecdfd5e0466f00789246a5280f4ba0fc"},
-    {file = "greenlet-3.2.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:c5111ccdc9c88f423426df3fd1811bfc40ed66264d35aa373420a34377efc98a"},
-    {file = "greenlet-3.2.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d76383238584e9711e20ebe14db6c88ddcedc1829a9ad31a584389463b5aa504"},
-    {file = "greenlet-3.2.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:23768528f2911bcd7e475210822ffb5254ed10d71f4028387e5a99b4c6699671"},
-    {file = "greenlet-3.2.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:00fadb3fedccc447f517ee0d3fd8fe49eae949e1cd0f6a611818f4f6fb7dc83b"},
-    {file = "greenlet-3.2.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:d25c5091190f2dc0eaa3f950252122edbbadbb682aa7b1ef2f8af0f8c0afefae"},
-    {file = "greenlet-3.2.4-cp313-cp313-win_amd64.whl", hash = "sha256:554b03b6e73aaabec3745364d6239e9e012d64c68ccd0b8430c64ccc14939a8b"},
-    {file = "greenlet-3.2.4-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:49a30d5fda2507ae77be16479bdb62a660fa51b1eb4928b524975b3bde77b3c0"},
-    {file = "greenlet-3.2.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:299fd615cd8fc86267b47597123e3f43ad79c9d8a22bebdce535e53550763e2f"},
-    {file = "greenlet-3.2.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:c17b6b34111ea72fc5a4e4beec9711d2226285f0386ea83477cbb97c30a3f3a5"},
-    {file = "greenlet-3.2.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b4a1870c51720687af7fa3e7cda6d08d801dae660f75a76f3845b642b4da6ee1"},
-    {file = "greenlet-3.2.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:061dc4cf2c34852b052a8620d40f36324554bc192be474b9e9770e8c042fd735"},
-    {file = "greenlet-3.2.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:44358b9bf66c8576a9f57a590d5f5d6e72fa4228b763d0e43fee6d3b06d3a337"},
-    {file = "greenlet-3.2.4-cp314-cp314-win_amd64.whl", hash = "sha256:e37ab26028f12dbb0ff65f29a8d3d44a765c61e729647bf2ddfbbed621726f01"},
-    {file = "greenlet-3.2.4-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:b6a7c19cf0d2742d0809a4c05975db036fdff50cd294a93632d6a310bf9ac02c"},
-    {file = "greenlet-3.2.4-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:27890167f55d2387576d1f41d9487ef171849ea0359ce1510ca6e06c8bece11d"},
-    {file = "greenlet-3.2.4-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:18d9260df2b5fbf41ae5139e1be4e796d99655f023a636cd0e11e6406cca7d58"},
-    {file = "greenlet-3.2.4-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:671df96c1f23c4a0d4077a325483c1503c96a1b7d9db26592ae770daa41233d4"},
-    {file = "greenlet-3.2.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:16458c245a38991aa19676900d48bd1a6f2ce3e16595051a4db9d012154e8433"},
-    {file = "greenlet-3.2.4-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c9913f1a30e4526f432991f89ae263459b1c64d1608c0d22a5c79c287b3c70df"},
-    {file = "greenlet-3.2.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b90654e092f928f110e0007f572007c9727b5265f7632c2fa7415b4689351594"},
-    {file = "greenlet-3.2.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:81701fd84f26330f0d5f4944d4e92e61afe6319dcd9775e39396e39d7c3e5f98"},
-    {file = "greenlet-3.2.4-cp39-cp39-win32.whl", hash = "sha256:65458b409c1ed459ea899e939f0e1cdb14f58dbc803f2f93c5eab5694d32671b"},
-    {file = "greenlet-3.2.4-cp39-cp39-win_amd64.whl", hash = "sha256:d2e685ade4dafd447ede19c31277a224a239a0a1a4eca4e6390efedf20260cfb"},
-    {file = "greenlet-3.2.4.tar.gz", hash = "sha256:0dca0d95ff849f9a364385f36ab49f50065d76964944638be9691e1832e9f86d"},
-]
-
-[package.extras]
-docs = ["Sphinx", "furo"]
-test = ["objgraph", "psutil", "setuptools"]
-
-[[package]]
-name = "hf-xet"
-version = "1.1.10"
-description = "Fast transfer of large files with the Hugging Face Hub."
-optional = false
-python-versions = ">=3.8"
-groups = ["main"]
-files = [
-    {file = "hf_xet-1.1.10-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:686083aca1a6669bc85c21c0563551cbcdaa5cf7876a91f3d074a030b577231d"},
-    {file = "hf_xet-1.1.10-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:71081925383b66b24eedff3013f8e6bbd41215c3338be4b94ba75fd75b21513b"},
-    {file = "hf_xet-1.1.10-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b6bceb6361c80c1cc42b5a7b4e3efd90e64630bcf11224dcac50ef30a47e435"},
-    {file = "hf_xet-1.1.10-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:eae7c1fc8a664e54753ffc235e11427ca61f4b0477d757cc4eb9ae374b69f09c"},
-    {file = "hf_xet-1.1.10-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:0a0005fd08f002180f7a12d4e13b22be277725bc23ed0529f8add5c7a6309c06"},
-    {file = "hf_xet-1.1.10-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:f900481cf6e362a6c549c61ff77468bd59d6dd082f3170a36acfef2eb6a6793f"},
-    {file = "hf_xet-1.1.10-cp37-abi3-win_amd64.whl", hash = "sha256:5f54b19cc347c13235ae7ee98b330c26dd65ef1df47e5316ffb1e87713ca7045"},
-    {file = "hf_xet-1.1.10.tar.gz", hash = "sha256:408aef343800a2102374a883f283ff29068055c111f003ff840733d3b715bb97"},
-]
-
-[package.extras]
-tests = ["pytest"]
-
-[[package]]
-name = "huggingface-hub"
-version = "0.34.6"
-description = "Client library to download and publish models, datasets and other repos on the huggingface.co hub"
-optional = false
-python-versions = ">=3.8.0"
-groups = ["main"]
-files = [
-    {file = "huggingface_hub-0.34.6-py3-none-any.whl", hash = "sha256:3387ec9045f9dc5b5715e4e7392c25b0d23fd539eb925111a1b301e60f2b4883"},
-    {file = "huggingface_hub-0.34.6.tar.gz", hash = "sha256:d0824eb012e37594357bb1790dfbe26c8f45eed7e701c1cdae02539e0c06f3f8"},
-]
-
-[package.dependencies]
-filelock = "*"
-fsspec = ">=2023.5.0"
-hf-xet = {version = ">=1.1.3,<2.0.0", markers = "platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"arm64\" or platform_machine == \"aarch64\""}
-packaging = ">=20.9"
-pyyaml = ">=5.1"
-requests = "*"
-tqdm = ">=4.42.1"
-typing-extensions = ">=3.7.4.3"
-
-[package.extras]
-all = ["InquirerPy (==0.3.4)", "Jinja2", "Pillow", "aiohttp", "authlib (>=1.3.2)", "fastapi", "gradio (>=4.0.0)", "httpx", "itsdangerous", "jedi", "libcst (>=1.4.0)", "mypy (==1.15.0) ; python_version >= \"3.9\"", "mypy (>=1.14.1,<1.15.0) ; python_version == \"3.8\"", "numpy", "pytest (>=8.1.1,<8.2.2)", "pytest-asyncio", "pytest-cov", "pytest-env", "pytest-mock", "pytest-rerunfailures", "pytest-vcr", "pytest-xdist", "ruff (>=0.9.0)", "soundfile", "types-PyYAML", "types-requests", "types- [...]
-cli = ["InquirerPy (==0.3.4)"]
-dev = ["InquirerPy (==0.3.4)", "Jinja2", "Pillow", "aiohttp", "authlib (>=1.3.2)", "fastapi", "gradio (>=4.0.0)", "httpx", "itsdangerous", "jedi", "libcst (>=1.4.0)", "mypy (==1.15.0) ; python_version >= \"3.9\"", "mypy (>=1.14.1,<1.15.0) ; python_version == \"3.8\"", "numpy", "pytest (>=8.1.1,<8.2.2)", "pytest-asyncio", "pytest-cov", "pytest-env", "pytest-mock", "pytest-rerunfailures", "pytest-vcr", "pytest-xdist", "ruff (>=0.9.0)", "soundfile", "types-PyYAML", "types-requests", "types- [...]
-fastai = ["fastai (>=2.4)", "fastcore (>=1.3.27)", "toml"]
-hf-transfer = ["hf-transfer (>=0.1.4)"]
-hf-xet = ["hf-xet (>=1.1.2,<2.0.0)"]
-inference = ["aiohttp"]
-mcp = ["aiohttp", "mcp (>=1.8.0)", "typer"]
-oauth = ["authlib (>=1.3.2)", "fastapi", "httpx", "itsdangerous"]
-quality = ["libcst (>=1.4.0)", "mypy (==1.15.0) ; python_version >= \"3.9\"", "mypy (>=1.14.1,<1.15.0) ; python_version == \"3.8\"", "ruff (>=0.9.0)"]
-tensorflow = ["graphviz", "pydot", "tensorflow"]
-tensorflow-testing = ["keras (<3.0)", "tensorflow"]
-testing = ["InquirerPy (==0.3.4)", "Jinja2", "Pillow", "aiohttp", "authlib (>=1.3.2)", "fastapi", "gradio (>=4.0.0)", "httpx", "itsdangerous", "jedi", "numpy", "pytest (>=8.1.1,<8.2.2)", "pytest-asyncio", "pytest-cov", "pytest-env", "pytest-mock", "pytest-rerunfailures", "pytest-vcr", "pytest-xdist", "soundfile", "urllib3 (<2.0)"]
-torch = ["safetensors[torch]", "torch"]
-typing = ["types-PyYAML", "types-requests", "types-simplejson", "types-toml", "types-tqdm", "types-urllib3", "typing-extensions (>=4.8.0)"]
-
-[[package]]
-name = "idna"
-version = "3.10"
-description = "Internationalized Domain Names in Applications (IDNA)"
-optional = false
-python-versions = ">=3.6"
-groups = ["main"]
-files = [
-    {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"},
-    {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"},
-]
-
-[package.extras]
-all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]
-
-[[package]]
-name = "isort"
-version = "6.0.1"
-description = "A Python utility / library to sort Python imports."
-optional = false
-python-versions = ">=3.9.0"
-groups = ["main"]
-files = [
-    {file = "isort-6.0.1-py3-none-any.whl", hash = "sha256:2dc5d7f65c9678d94c88dfc29161a320eec67328bc97aad576874cb4be1e9615"},
-    {file = "isort-6.0.1.tar.gz", hash = "sha256:1cb5df28dfbc742e490c5e41bad6da41b805b0a8be7bc93cd0fb2a8a890ac450"},
-]
-
-[package.extras]
-colors = ["colorama"]
-plugins = ["setuptools"]
-
-[[package]]
-name = "jinja2"
-version = "3.1.6"
-description = "A very fast and expressive template engine."
-optional = false
-python-versions = ">=3.7"
-groups = ["main"]
-files = [
-    {file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"},
-    {file = "jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"},
-]
-
-[package.dependencies]
-MarkupSafe = ">=2.0"
-
-[package.extras]
-i18n = ["Babel (>=2.7)"]
-
-[[package]]
-name = "joblib"
-version = "1.5.2"
-description = "Lightweight pipelining with Python functions"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "joblib-1.5.2-py3-none-any.whl", hash = "sha256:4e1f0bdbb987e6d843c70cf43714cb276623def372df3c22fe5266b2670bc241"},
-    {file = "joblib-1.5.2.tar.gz", hash = "sha256:3faa5c39054b2f03ca547da9b2f52fde67c06240c31853f306aea97f13647b55"},
-]
-
-[[package]]
-name = "lightning-utilities"
-version = "0.15.2"
-description = "Lightning toolbox for across the our ecosystem."
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "lightning_utilities-0.15.2-py3-none-any.whl", hash = "sha256:ad3ab1703775044bbf880dbf7ddaaac899396c96315f3aa1779cec9d618a9841"},
-    {file = "lightning_utilities-0.15.2.tar.gz", hash = "sha256:cdf12f530214a63dacefd713f180d1ecf5d165338101617b4742e8f22c032e24"},
-]
-
-[package.dependencies]
-packaging = ">=17.1"
-setuptools = "*"
-typing_extensions = "*"
-
-[package.extras]
-cli = ["jsonargparse[signatures] (>=4.38.0)", "tomlkit"]
-docs = ["requests (>=2.0.0)"]
-typing = ["mypy (>=1.0.0)", "types-setuptools"]
-
-[[package]]
-name = "macholib"
-version = "1.16.3"
-description = "Mach-O header analysis and editing"
-optional = false
-python-versions = "*"
-groups = ["main"]
-markers = "sys_platform == \"darwin\""
-files = [
-    {file = "macholib-1.16.3-py2.py3-none-any.whl", hash = "sha256:0e315d7583d38b8c77e815b1ecbdbf504a8258d8b3e17b61165c6feb60d18f2c"},
-    {file = "macholib-1.16.3.tar.gz", hash = "sha256:07ae9e15e8e4cd9a788013d81f5908b3609aa76f9b1421bae9c4d7606ec86a30"},
-]
-
-[package.dependencies]
-altgraph = ">=0.17"
-
-[[package]]
-name = "mako"
-version = "1.3.10"
-description = "A super-fast templating language that borrows the best ideas from the existing templating languages."
-optional = false
-python-versions = ">=3.8"
-groups = ["main"]
-files = [
-    {file = "mako-1.3.10-py3-none-any.whl", hash = "sha256:baef24a52fc4fc514a0887ac600f9f1cff3d82c61d4d700a1fa84d597b88db59"},
-    {file = "mako-1.3.10.tar.gz", hash = "sha256:99579a6f39583fa7e5630a28c3c1f440e4e97a414b80372649c0ce338da2ea28"},
-]
-
-[package.dependencies]
-MarkupSafe = ">=0.9.2"
-
-[package.extras]
-babel = ["Babel"]
-lingua = ["lingua"]
-testing = ["pytest"]
-
-[[package]]
-name = "markupsafe"
-version = "3.0.3"
-description = "Safely add untrusted strings to HTML/XML markup."
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "markupsafe-3.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2f981d352f04553a7171b8e44369f2af4055f888dfb147d55e42d29e29e74559"},
-    {file = "markupsafe-3.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e1c1493fb6e50ab01d20a22826e57520f1284df32f2d8601fdd90b6304601419"},
-    {file = "markupsafe-3.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1ba88449deb3de88bd40044603fafffb7bc2b055d626a330323a9ed736661695"},
-    {file = "markupsafe-3.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f42d0984e947b8adf7dd6dde396e720934d12c506ce84eea8476409563607591"},
-    {file = "markupsafe-3.0.3-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c0c0b3ade1c0b13b936d7970b1d37a57acde9199dc2aecc4c336773e1d86049c"},
-    {file = "markupsafe-3.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:0303439a41979d9e74d18ff5e2dd8c43ed6c6001fd40e5bf2e43f7bd9bbc523f"},
-    {file = "markupsafe-3.0.3-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:d2ee202e79d8ed691ceebae8e0486bd9a2cd4794cec4824e1c99b6f5009502f6"},
-    {file = "markupsafe-3.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:177b5253b2834fe3678cb4a5f0059808258584c559193998be2601324fdeafb1"},
-    {file = "markupsafe-3.0.3-cp310-cp310-win32.whl", hash = "sha256:2a15a08b17dd94c53a1da0438822d70ebcd13f8c3a95abe3a9ef9f11a94830aa"},
-    {file = "markupsafe-3.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:c4ffb7ebf07cfe8931028e3e4c85f0357459a3f9f9490886198848f4fa002ec8"},
-    {file = "markupsafe-3.0.3-cp310-cp310-win_arm64.whl", hash = "sha256:e2103a929dfa2fcaf9bb4e7c091983a49c9ac3b19c9061b6d5427dd7d14d81a1"},
-    {file = "markupsafe-3.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad"},
-    {file = "markupsafe-3.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bd4cd07944443f5a265608cc6aab442e4f74dff8088b0dfc8238647b8f6ae9a"},
-    {file = "markupsafe-3.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b5420a1d9450023228968e7e6a9ce57f65d148ab56d2313fcd589eee96a7a50"},
-    {file = "markupsafe-3.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0bf2a864d67e76e5c9a34dc26ec616a66b9888e25e7b9460e1c76d3293bd9dbf"},
-    {file = "markupsafe-3.0.3-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bc51efed119bc9cfdf792cdeaa4d67e8f6fcccab66ed4bfdd6bde3e59bfcbb2f"},
-    {file = "markupsafe-3.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:068f375c472b3e7acbe2d5318dea141359e6900156b5b2ba06a30b169086b91a"},
-    {file = "markupsafe-3.0.3-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:7be7b61bb172e1ed687f1754f8e7484f1c8019780f6f6b0786e76bb01c2ae115"},
-    {file = "markupsafe-3.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a"},
-    {file = "markupsafe-3.0.3-cp311-cp311-win32.whl", hash = "sha256:0db14f5dafddbb6d9208827849fad01f1a2609380add406671a26386cdf15a19"},
-    {file = "markupsafe-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:de8a88e63464af587c950061a5e6a67d3632e36df62b986892331d4620a35c01"},
-    {file = "markupsafe-3.0.3-cp311-cp311-win_arm64.whl", hash = "sha256:3b562dd9e9ea93f13d53989d23a7e775fdfd1066c33494ff43f5418bc8c58a5c"},
-    {file = "markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e"},
-    {file = "markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce"},
-    {file = "markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d"},
-    {file = "markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d"},
-    {file = "markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a"},
-    {file = "markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b"},
-    {file = "markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f"},
-    {file = "markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b"},
-    {file = "markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d"},
-    {file = "markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c"},
-    {file = "markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f"},
-    {file = "markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795"},
-    {file = "markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219"},
-    {file = "markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6"},
-    {file = "markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676"},
-    {file = "markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9"},
-    {file = "markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1"},
-    {file = "markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc"},
-    {file = "markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12"},
-    {file = "markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed"},
-    {file = "markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5"},
-    {file = "markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218"},
-    {file = "markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287"},
-    {file = "markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe"},
-    {file = "markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026"},
-    {file = "markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737"},
-    {file = "markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97"},
-    {file = "markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d"},
-    {file = "markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda"},
-    {file = "markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf"},
-    {file = "markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe"},
-    {file = "markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9"},
-    {file = "markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581"},
-    {file = "markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9"},
-    {file = "markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa"},
-    {file = "markupsafe-3.0.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:15d939a21d546304880945ca1ecb8a039db6b4dc49b2c5a400387cdae6a62e26"},
-    {file = "markupsafe-3.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f71a396b3bf33ecaa1626c255855702aca4d3d9fea5e051b41ac59a9c1c41edc"},
-    {file = "markupsafe-3.0.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f4b68347f8c5eab4a13419215bdfd7f8c9b19f2b25520968adfad23eb0ce60c"},
-    {file = "markupsafe-3.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e8fc20152abba6b83724d7ff268c249fa196d8259ff481f3b1476383f8f24e42"},
-    {file = "markupsafe-3.0.3-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:949b8d66bc381ee8b007cd945914c721d9aba8e27f71959d750a46f7c282b20b"},
-    {file = "markupsafe-3.0.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:3537e01efc9d4dccdf77221fb1cb3b8e1a38d5428920e0657ce299b20324d758"},
-    {file = "markupsafe-3.0.3-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:591ae9f2a647529ca990bc681daebdd52c8791ff06c2bfa05b65163e28102ef2"},
-    {file = "markupsafe-3.0.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a320721ab5a1aba0a233739394eb907f8c8da5c98c9181d1161e77a0c8e36f2d"},
-    {file = "markupsafe-3.0.3-cp39-cp39-win32.whl", hash = "sha256:df2449253ef108a379b8b5d6b43f4b1a8e81a061d6537becd5582fba5f9196d7"},
-    {file = "markupsafe-3.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:7c3fb7d25180895632e5d3148dbdc29ea38ccb7fd210aa27acbd1201a1902c6e"},
-    {file = "markupsafe-3.0.3-cp39-cp39-win_arm64.whl", hash = "sha256:38664109c14ffc9e7437e86b4dceb442b0096dfe3541d7864d9cbe1da4cf36c8"},
-    {file = "markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698"},
-]
-
-[[package]]
-name = "mpmath"
-version = "1.3.0"
-description = "Python library for arbitrary-precision floating-point arithmetic"
-optional = false
-python-versions = "*"
-groups = ["main"]
-files = [
-    {file = "mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c"},
-    {file = "mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f"},
-]
-
-[package.extras]
-develop = ["codecov", "pycodestyle", "pytest (>=4.6)", "pytest-cov", "wheel"]
-docs = ["sphinx"]
-gmpy = ["gmpy2 (>=2.1.0a4) ; platform_python_implementation != \"PyPy\""]
-tests = ["pytest (>=4.6)"]
-
-[[package]]
-name = "mypy-extensions"
-version = "1.1.0"
-description = "Type system extensions for programs checked with the mypy type checker."
-optional = false
-python-versions = ">=3.8"
-groups = ["main"]
-files = [
-    {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"},
-    {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"},
-]
-
-[[package]]
-name = "networkx"
-version = "3.5"
-description = "Python package for creating and manipulating graphs and networks"
-optional = false
-python-versions = ">=3.11"
-groups = ["main"]
-files = [
-    {file = "networkx-3.5-py3-none-any.whl", hash = "sha256:0030d386a9a06dee3565298b4a734b68589749a544acbb6c412dc9e2489ec6ec"},
-    {file = "networkx-3.5.tar.gz", hash = "sha256:d4c6f9cf81f52d69230866796b82afbccdec3db7ae4fbd1b65ea750feed50037"},
-]
-
-[package.extras]
-default = ["matplotlib (>=3.8)", "numpy (>=1.25)", "pandas (>=2.0)", "scipy (>=1.11.2)"]
-developer = ["mypy (>=1.15)", "pre-commit (>=4.1)"]
-doc = ["intersphinx-registry", "myst-nb (>=1.1)", "numpydoc (>=1.8.0)", "pillow (>=10)", "pydata-sphinx-theme (>=0.16)", "sphinx (>=8.0)", "sphinx-gallery (>=0.18)", "texext (>=0.6.7)"]
-example = ["cairocffi (>=1.7)", "contextily (>=1.6)", "igraph (>=0.11)", "momepy (>=0.7.2)", "osmnx (>=2.0.0)", "scikit-learn (>=1.5)", "seaborn (>=0.13)"]
-extra = ["lxml (>=4.6)", "pydot (>=3.0.1)", "pygraphviz (>=1.14)", "sympy (>=1.10)"]
-test = ["pytest (>=7.2)", "pytest-cov (>=4.0)", "pytest-xdist (>=3.0)"]
-test-extras = ["pytest-mpl", "pytest-randomly"]
-
-[[package]]
-name = "numpy"
-version = "2.3.3"
-description = "Fundamental package for array computing in Python"
-optional = false
-python-versions = ">=3.11"
-groups = ["main"]
-files = [
-    {file = "numpy-2.3.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0ffc4f5caba7dfcbe944ed674b7eef683c7e94874046454bb79ed7ee0236f59d"},
-    {file = "numpy-2.3.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e7e946c7170858a0295f79a60214424caac2ffdb0063d4d79cb681f9aa0aa569"},
-    {file = "numpy-2.3.3-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:cd4260f64bc794c3390a63bf0728220dd1a68170c169088a1e0dfa2fde1be12f"},
-    {file = "numpy-2.3.3-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:f0ddb4b96a87b6728df9362135e764eac3cfa674499943ebc44ce96c478ab125"},
-    {file = "numpy-2.3.3-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:afd07d377f478344ec6ca2b8d4ca08ae8bd44706763d1efb56397de606393f48"},
-    {file = "numpy-2.3.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bc92a5dedcc53857249ca51ef29f5e5f2f8c513e22cfb90faeb20343b8c6f7a6"},
-    {file = "numpy-2.3.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7af05ed4dc19f308e1d9fc759f36f21921eb7bbfc82843eeec6b2a2863a0aefa"},
-    {file = "numpy-2.3.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:433bf137e338677cebdd5beac0199ac84712ad9d630b74eceeb759eaa45ddf30"},
-    {file = "numpy-2.3.3-cp311-cp311-win32.whl", hash = "sha256:eb63d443d7b4ffd1e873f8155260d7f58e7e4b095961b01c91062935c2491e57"},
-    {file = "numpy-2.3.3-cp311-cp311-win_amd64.whl", hash = "sha256:ec9d249840f6a565f58d8f913bccac2444235025bbb13e9a4681783572ee3caa"},
-    {file = "numpy-2.3.3-cp311-cp311-win_arm64.whl", hash = "sha256:74c2a948d02f88c11a3c075d9733f1ae67d97c6bdb97f2bb542f980458b257e7"},
-    {file = "numpy-2.3.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:cfdd09f9c84a1a934cde1eec2267f0a43a7cd44b2cca4ff95b7c0d14d144b0bf"},
-    {file = "numpy-2.3.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb32e3cf0f762aee47ad1ddc6672988f7f27045b0783c887190545baba73aa25"},
-    {file = "numpy-2.3.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:396b254daeb0a57b1fe0ecb5e3cff6fa79a380fa97c8f7781a6d08cd429418fe"},
-    {file = "numpy-2.3.3-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:067e3d7159a5d8f8a0b46ee11148fc35ca9b21f61e3c49fbd0a027450e65a33b"},
-    {file = "numpy-2.3.3-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1c02d0629d25d426585fb2e45a66154081b9fa677bc92a881ff1d216bc9919a8"},
-    {file = "numpy-2.3.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d9192da52b9745f7f0766531dcfa978b7763916f158bb63bdb8a1eca0068ab20"},
-    {file = "numpy-2.3.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:cd7de500a5b66319db419dc3c345244404a164beae0d0937283b907d8152e6ea"},
-    {file = "numpy-2.3.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:93d4962d8f82af58f0b2eb85daaf1b3ca23fe0a85d0be8f1f2b7bb46034e56d7"},
-    {file = "numpy-2.3.3-cp312-cp312-win32.whl", hash = "sha256:5534ed6b92f9b7dca6c0a19d6df12d41c68b991cef051d108f6dbff3babc4ebf"},
-    {file = "numpy-2.3.3-cp312-cp312-win_amd64.whl", hash = "sha256:497d7cad08e7092dba36e3d296fe4c97708c93daf26643a1ae4b03f6294d30eb"},
-    {file = "numpy-2.3.3-cp312-cp312-win_arm64.whl", hash = "sha256:ca0309a18d4dfea6fc6262a66d06c26cfe4640c3926ceec90e57791a82b6eee5"},
-    {file = "numpy-2.3.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f5415fb78995644253370985342cd03572ef8620b934da27d77377a2285955bf"},
-    {file = "numpy-2.3.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d00de139a3324e26ed5b95870ce63be7ec7352171bc69a4cf1f157a48e3eb6b7"},
-    {file = "numpy-2.3.3-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:9dc13c6a5829610cc07422bc74d3ac083bd8323f14e2827d992f9e52e22cd6a6"},
-    {file = "numpy-2.3.3-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:d79715d95f1894771eb4e60fb23f065663b2298f7d22945d66877aadf33d00c7"},
-    {file = "numpy-2.3.3-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:952cfd0748514ea7c3afc729a0fc639e61655ce4c55ab9acfab14bda4f402b4c"},
-    {file = "numpy-2.3.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5b83648633d46f77039c29078751f80da65aa64d5622a3cd62aaef9d835b6c93"},
-    {file = "numpy-2.3.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b001bae8cea1c7dfdb2ae2b017ed0a6f2102d7a70059df1e338e307a4c78a8ae"},
-    {file = "numpy-2.3.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8e9aced64054739037d42fb84c54dd38b81ee238816c948c8f3ed134665dcd86"},
-    {file = "numpy-2.3.3-cp313-cp313-win32.whl", hash = "sha256:9591e1221db3f37751e6442850429b3aabf7026d3b05542d102944ca7f00c8a8"},
-    {file = "numpy-2.3.3-cp313-cp313-win_amd64.whl", hash = "sha256:f0dadeb302887f07431910f67a14d57209ed91130be0adea2f9793f1a4f817cf"},
-    {file = "numpy-2.3.3-cp313-cp313-win_arm64.whl", hash = "sha256:3c7cf302ac6e0b76a64c4aecf1a09e51abd9b01fc7feee80f6c43e3ab1b1dbc5"},
-    {file = "numpy-2.3.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:eda59e44957d272846bb407aad19f89dc6f58fecf3504bd144f4c5cf81a7eacc"},
-    {file = "numpy-2.3.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:823d04112bc85ef5c4fda73ba24e6096c8f869931405a80aa8b0e604510a26bc"},
-    {file = "numpy-2.3.3-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:40051003e03db4041aa325da2a0971ba41cf65714e65d296397cc0e32de6018b"},
-    {file = "numpy-2.3.3-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:6ee9086235dd6ab7ae75aba5662f582a81ced49f0f1c6de4260a78d8f2d91a19"},
-    {file = "numpy-2.3.3-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:94fcaa68757c3e2e668ddadeaa86ab05499a70725811e582b6a9858dd472fb30"},
-    {file = "numpy-2.3.3-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:da1a74b90e7483d6ce5244053399a614b1d6b7bc30a60d2f570e5071f8959d3e"},
-    {file = "numpy-2.3.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:2990adf06d1ecee3b3dcbb4977dfab6e9f09807598d647f04d385d29e7a3c3d3"},
-    {file = "numpy-2.3.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:ed635ff692483b8e3f0fcaa8e7eb8a75ee71aa6d975388224f70821421800cea"},
-    {file = "numpy-2.3.3-cp313-cp313t-win32.whl", hash = "sha256:a333b4ed33d8dc2b373cc955ca57babc00cd6f9009991d9edc5ddbc1bac36bcd"},
-    {file = "numpy-2.3.3-cp313-cp313t-win_amd64.whl", hash = "sha256:4384a169c4d8f97195980815d6fcad04933a7e1ab3b530921c3fef7a1c63426d"},
-    {file = "numpy-2.3.3-cp313-cp313t-win_arm64.whl", hash = "sha256:75370986cc0bc66f4ce5110ad35aae6d182cc4ce6433c40ad151f53690130bf1"},
-    {file = "numpy-2.3.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cd052f1fa6a78dee696b58a914b7229ecfa41f0a6d96dc663c1220a55e137593"},
-    {file = "numpy-2.3.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:414a97499480067d305fcac9716c29cf4d0d76db6ebf0bf3cbce666677f12652"},
-    {file = "numpy-2.3.3-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:50a5fe69f135f88a2be9b6ca0481a68a136f6febe1916e4920e12f1a34e708a7"},
-    {file = "numpy-2.3.3-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:b912f2ed2b67a129e6a601e9d93d4fa37bef67e54cac442a2f588a54afe5c67a"},
-    {file = "numpy-2.3.3-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9e318ee0596d76d4cb3d78535dc005fa60e5ea348cd131a51e99d0bdbe0b54fe"},
-    {file = "numpy-2.3.3-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ce020080e4a52426202bdb6f7691c65bb55e49f261f31a8f506c9f6bc7450421"},
-    {file = "numpy-2.3.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e6687dc183aa55dae4a705b35f9c0f8cb178bcaa2f029b241ac5356221d5c021"},
-    {file = "numpy-2.3.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d8f3b1080782469fdc1718c4ed1d22549b5fb12af0d57d35e992158a772a37cf"},
-    {file = "numpy-2.3.3-cp314-cp314-win32.whl", hash = "sha256:cb248499b0bc3be66ebd6578b83e5acacf1d6cb2a77f2248ce0e40fbec5a76d0"},
-    {file = "numpy-2.3.3-cp314-cp314-win_amd64.whl", hash = "sha256:691808c2b26b0f002a032c73255d0bd89751425f379f7bcd22d140db593a96e8"},
-    {file = "numpy-2.3.3-cp314-cp314-win_arm64.whl", hash = "sha256:9ad12e976ca7b10f1774b03615a2a4bab8addce37ecc77394d8e986927dc0dfe"},
-    {file = "numpy-2.3.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:9cc48e09feb11e1db00b320e9d30a4151f7369afb96bd0e48d942d09da3a0d00"},
-    {file = "numpy-2.3.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:901bf6123879b7f251d3631967fd574690734236075082078e0571977c6a8e6a"},
-    {file = "numpy-2.3.3-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:7f025652034199c301049296b59fa7d52c7e625017cae4c75d8662e377bf487d"},
-    {file = "numpy-2.3.3-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:533ca5f6d325c80b6007d4d7fb1984c303553534191024ec6a524a4c92a5935a"},
-    {file = "numpy-2.3.3-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0edd58682a399824633b66885d699d7de982800053acf20be1eaa46d92009c54"},
-    {file = "numpy-2.3.3-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:367ad5d8fbec5d9296d18478804a530f1191e24ab4d75ab408346ae88045d25e"},
-    {file = "numpy-2.3.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8f6ac61a217437946a1fa48d24c47c91a0c4f725237871117dea264982128097"},
-    {file = "numpy-2.3.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:179a42101b845a816d464b6fe9a845dfaf308fdfc7925387195570789bb2c970"},
-    {file = "numpy-2.3.3-cp314-cp314t-win32.whl", hash = "sha256:1250c5d3d2562ec4174bce2e3a1523041595f9b651065e4a4473f5f48a6bc8a5"},
-    {file = "numpy-2.3.3-cp314-cp314t-win_amd64.whl", hash = "sha256:b37a0b2e5935409daebe82c1e42274d30d9dd355852529eab91dab8dcca7419f"},
-    {file = "numpy-2.3.3-cp314-cp314t-win_arm64.whl", hash = "sha256:78c9f6560dc7e6b3990e32df7ea1a50bbd0e2a111e05209963f5ddcab7073b0b"},
-    {file = "numpy-2.3.3-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:1e02c7159791cd481e1e6d5ddd766b62a4d5acf8df4d4d1afe35ee9c5c33a41e"},
-    {file = "numpy-2.3.3-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:dca2d0fc80b3893ae72197b39f69d55a3cd8b17ea1b50aa4c62de82419936150"},
-    {file = "numpy-2.3.3-pp311-pypy311_pp73-macosx_14_0_arm64.whl", hash = "sha256:99683cbe0658f8271b333a1b1b4bb3173750ad59c0c61f5bbdc5b318918fffe3"},
-    {file = "numpy-2.3.3-pp311-pypy311_pp73-macosx_14_0_x86_64.whl", hash = "sha256:d9d537a39cc9de668e5cd0e25affb17aec17b577c6b3ae8a3d866b479fbe88d0"},
-    {file = "numpy-2.3.3-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8596ba2f8af5f93b01d97563832686d20206d303024777f6dfc2e7c7c3f1850e"},
-    {file = "numpy-2.3.3-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e1ec5615b05369925bd1125f27df33f3b6c8bc10d788d5999ecd8769a1fa04db"},
-    {file = "numpy-2.3.3-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:2e267c7da5bf7309670523896df97f93f6e469fb931161f483cd6882b3b1a5dc"},
-    {file = "numpy-2.3.3.tar.gz", hash = "sha256:ddc7c39727ba62b80dfdbedf400d1c10ddfa8eefbd7ec8dcb118be8b56d31029"},
-]
-
-[[package]]
-name = "nvidia-cublas-cu12"
-version = "12.8.4.1"
-description = "CUBLAS native runtime libraries"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_cublas_cu12-12.8.4.1-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:b86f6dd8935884615a0683b663891d43781b819ac4f2ba2b0c9604676af346d0"},
-    {file = "nvidia_cublas_cu12-12.8.4.1-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:8ac4e771d5a348c551b2a426eda6193c19aa630236b418086020df5ba9667142"},
-    {file = "nvidia_cublas_cu12-12.8.4.1-py3-none-win_amd64.whl", hash = "sha256:47e9b82132fa8d2b4944e708049229601448aaad7e6f296f630f2d1a32de35af"},
-]
-
-[[package]]
-name = "nvidia-cuda-cupti-cu12"
-version = "12.8.90"
-description = "CUDA profiling tools runtime libs."
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_cuda_cupti_cu12-12.8.90-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:4412396548808ddfed3f17a467b104ba7751e6b58678a4b840675c56d21cf7ed"},
-    {file = "nvidia_cuda_cupti_cu12-12.8.90-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ea0cb07ebda26bb9b29ba82cda34849e73c166c18162d3913575b0c9db9a6182"},
-    {file = "nvidia_cuda_cupti_cu12-12.8.90-py3-none-win_amd64.whl", hash = "sha256:bb479dcdf7e6d4f8b0b01b115260399bf34154a1a2e9fe11c85c517d87efd98e"},
-]
-
-[[package]]
-name = "nvidia-cuda-nvrtc-cu12"
-version = "12.8.93"
-description = "NVRTC native runtime libraries"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_cuda_nvrtc_cu12-12.8.93-py3-none-manylinux2010_x86_64.manylinux_2_12_x86_64.whl", hash = "sha256:a7756528852ef889772a84c6cd89d41dfa74667e24cca16bb31f8f061e3e9994"},
-    {file = "nvidia_cuda_nvrtc_cu12-12.8.93-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:fc1fec1e1637854b4c0a65fb9a8346b51dd9ee69e61ebaccc82058441f15bce8"},
-    {file = "nvidia_cuda_nvrtc_cu12-12.8.93-py3-none-win_amd64.whl", hash = "sha256:7a4b6b2904850fe78e0bd179c4b655c404d4bb799ef03ddc60804247099ae909"},
-]
-
-[[package]]
-name = "nvidia-cuda-runtime-cu12"
-version = "12.8.90"
-description = "CUDA Runtime native Libraries"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_cuda_runtime_cu12-12.8.90-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:52bf7bbee900262ffefe5e9d5a2a69a30d97e2bc5bb6cc866688caa976966e3d"},
-    {file = "nvidia_cuda_runtime_cu12-12.8.90-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:adade8dcbd0edf427b7204d480d6066d33902cab2a4707dcfc48a2d0fd44ab90"},
-    {file = "nvidia_cuda_runtime_cu12-12.8.90-py3-none-win_amd64.whl", hash = "sha256:c0c6027f01505bfed6c3b21ec546f69c687689aad5f1a377554bc6ca4aa993a8"},
-]
-
-[[package]]
-name = "nvidia-cudnn-cu12"
-version = "9.10.2.21"
-description = "cuDNN runtime libraries"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_cudnn_cu12-9.10.2.21-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:c9132cc3f8958447b4910a1720036d9eff5928cc3179b0a51fb6d167c6cc87d8"},
-    {file = "nvidia_cudnn_cu12-9.10.2.21-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:949452be657fa16687d0930933f032835951ef0892b37d2d53824d1a84dc97a8"},
-    {file = "nvidia_cudnn_cu12-9.10.2.21-py3-none-win_amd64.whl", hash = "sha256:c6288de7d63e6cf62988f0923f96dc339cea362decb1bf5b3141883392a7d65e"},
-]
-
-[package.dependencies]
-nvidia-cublas-cu12 = "*"
-
-[[package]]
-name = "nvidia-cufft-cu12"
-version = "11.3.3.83"
-description = "CUFFT native runtime libraries"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_cufft_cu12-11.3.3.83-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:848ef7224d6305cdb2a4df928759dca7b1201874787083b6e7550dd6765ce69a"},
-    {file = "nvidia_cufft_cu12-11.3.3.83-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4d2dd21ec0b88cf61b62e6b43564355e5222e4a3fb394cac0db101f2dd0d4f74"},
-    {file = "nvidia_cufft_cu12-11.3.3.83-py3-none-win_amd64.whl", hash = "sha256:7a64a98ef2a7c47f905aaf8931b69a3a43f27c55530c698bb2ed7c75c0b42cb7"},
-]
-
-[package.dependencies]
-nvidia-nvjitlink-cu12 = "*"
-
-[[package]]
-name = "nvidia-cufile-cu12"
-version = "1.13.1.3"
-description = "cuFile GPUDirect libraries"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_cufile_cu12-1.13.1.3-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1d069003be650e131b21c932ec3d8969c1715379251f8d23a1860554b1cb24fc"},
-    {file = "nvidia_cufile_cu12-1.13.1.3-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:4beb6d4cce47c1a0f1013d72e02b0994730359e17801d395bdcbf20cfb3bb00a"},
-]
-
-[[package]]
-name = "nvidia-curand-cu12"
-version = "10.3.9.90"
-description = "CURAND native runtime libraries"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_curand_cu12-10.3.9.90-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:dfab99248034673b779bc6decafdc3404a8a6f502462201f2f31f11354204acd"},
-    {file = "nvidia_curand_cu12-10.3.9.90-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:b32331d4f4df5d6eefa0554c565b626c7216f87a06a4f56fab27c3b68a830ec9"},
-    {file = "nvidia_curand_cu12-10.3.9.90-py3-none-win_amd64.whl", hash = "sha256:f149a8ca457277da854f89cf282d6ef43176861926c7ac85b2a0fbd237c587ec"},
-]
-
-[[package]]
-name = "nvidia-cusolver-cu12"
-version = "11.7.3.90"
-description = "CUDA solver native runtime libraries"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_cusolver_cu12-11.7.3.90-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:db9ed69dbef9715071232caa9b69c52ac7de3a95773c2db65bdba85916e4e5c0"},
-    {file = "nvidia_cusolver_cu12-11.7.3.90-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:4376c11ad263152bd50ea295c05370360776f8c3427b30991df774f9fb26c450"},
-    {file = "nvidia_cusolver_cu12-11.7.3.90-py3-none-win_amd64.whl", hash = "sha256:4a550db115fcabc4d495eb7d39ac8b58d4ab5d8e63274d3754df1c0ad6a22d34"},
-]
-
-[package.dependencies]
-nvidia-cublas-cu12 = "*"
-nvidia-cusparse-cu12 = "*"
-nvidia-nvjitlink-cu12 = "*"
-
-[[package]]
-name = "nvidia-cusparse-cu12"
-version = "12.5.8.93"
-description = "CUSPARSE native runtime libraries"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_cusparse_cu12-12.5.8.93-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9b6c161cb130be1a07a27ea6923df8141f3c295852f4b260c65f18f3e0a091dc"},
-    {file = "nvidia_cusparse_cu12-12.5.8.93-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1ec05d76bbbd8b61b06a80e1eaf8cf4959c3d4ce8e711b65ebd0443bb0ebb13b"},
-    {file = "nvidia_cusparse_cu12-12.5.8.93-py3-none-win_amd64.whl", hash = "sha256:9a33604331cb2cac199f2e7f5104dfbb8a5a898c367a53dfda9ff2acb6b6b4dd"},
-]
-
-[package.dependencies]
-nvidia-nvjitlink-cu12 = "*"
-
-[[package]]
-name = "nvidia-cusparselt-cu12"
-version = "0.7.1"
-description = "NVIDIA cuSPARSELt"
-optional = false
-python-versions = "*"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_cusparselt_cu12-0.7.1-py3-none-manylinux2014_aarch64.whl", hash = "sha256:8878dce784d0fac90131b6817b607e803c36e629ba34dc5b433471382196b6a5"},
-    {file = "nvidia_cusparselt_cu12-0.7.1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:f1bb701d6b930d5a7cea44c19ceb973311500847f81b634d802b7b539dc55623"},
-    {file = "nvidia_cusparselt_cu12-0.7.1-py3-none-win_amd64.whl", hash = "sha256:f67fbb5831940ec829c9117b7f33807db9f9678dc2a617fbe781cac17b4e1075"},
-]
-
-[[package]]
-name = "nvidia-nccl-cu12"
-version = "2.27.3"
-description = "NVIDIA Collective Communication Library (NCCL) Runtime"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_nccl_cu12-2.27.3-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9ddf1a245abc36c550870f26d537a9b6087fb2e2e3d6e0ef03374c6fd19d984f"},
-    {file = "nvidia_nccl_cu12-2.27.3-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:adf27ccf4238253e0b826bce3ff5fa532d65fc42322c8bfdfaf28024c0fbe039"},
-]
-
-[[package]]
-name = "nvidia-nvjitlink-cu12"
-version = "12.8.93"
-description = "Nvidia JIT LTO Library"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_nvjitlink_cu12-12.8.93-py3-none-manylinux2010_x86_64.manylinux_2_12_x86_64.whl", hash = "sha256:81ff63371a7ebd6e6451970684f916be2eab07321b73c9d244dc2b4da7f73b88"},
-    {file = "nvidia_nvjitlink_cu12-12.8.93-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:adccd7161ace7261e01bb91e44e88da350895c270d23f744f0820c818b7229e7"},
-    {file = "nvidia_nvjitlink_cu12-12.8.93-py3-none-win_amd64.whl", hash = "sha256:bd93fbeeee850917903583587f4fc3a4eafa022e34572251368238ab5e6bd67f"},
-]
-
-[[package]]
-name = "nvidia-nvtx-cu12"
-version = "12.8.90"
-description = "NVIDIA Tools Extension"
-optional = false
-python-versions = ">=3"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "nvidia_nvtx_cu12-12.8.90-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d7ad891da111ebafbf7e015d34879f7112832fc239ff0d7d776b6cb685274615"},
-    {file = "nvidia_nvtx_cu12-12.8.90-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5b17e2001cc0d751a5bc2c6ec6d26ad95913324a4adb86788c944f8ce9ba441f"},
-    {file = "nvidia_nvtx_cu12-12.8.90-py3-none-win_amd64.whl", hash = "sha256:619c8304aedc69f02ea82dd244541a83c3d9d40993381b3b590f1adaed3db41e"},
-]
-
-[[package]]
-name = "optuna"
-version = "4.5.0"
-description = "A hyperparameter optimization framework"
-optional = false
-python-versions = ">=3.8"
-groups = ["main"]
-files = [
-    {file = "optuna-4.5.0-py3-none-any.whl", hash = "sha256:5b8a783e84e448b0742501bc27195344a28d2c77bd2feef5b558544d954851b0"},
-    {file = "optuna-4.5.0.tar.gz", hash = "sha256:264844da16dad744dea295057d8bc218646129c47567d52c35a201d9f99942ba"},
-]
-
-[package.dependencies]
-alembic = ">=1.5.0"
-colorlog = "*"
-numpy = "*"
-packaging = ">=20.0"
-PyYAML = "*"
-sqlalchemy = ">=1.4.2"
-tqdm = "*"
-
-[package.extras]
-benchmark = ["asv (>=0.5.0)", "cma", "virtualenv"]
-checking = ["black", "blackdoc", "flake8", "isort", "mypy", "mypy_boto3_s3", "scipy-stubs ; python_version >= \"3.10\"", "types-PyYAML", "types-redis", "types-setuptools", "types-tqdm", "typing_extensions (>=3.10.0.0)"]
-document = ["ase", "cmaes (>=0.12.0)", "fvcore", "kaleido (<0.4)", "lightgbm", "matplotlib (!=3.6.0)", "pandas", "pillow", "plotly (>=4.9.0)", "scikit-learn", "sphinx", "sphinx-copybutton", "sphinx-gallery", "sphinx-notfound-page", "sphinx_rtd_theme (>=1.2.0)", "torch", "torchvision"]
-optional = ["boto3", "cmaes (>=0.12.0)", "google-cloud-storage", "grpcio", "matplotlib (!=3.6.0)", "pandas", "plotly (>=4.9.0)", "protobuf (>=5.28.1)", "redis", "scikit-learn (>=0.24.2)", "scipy", "torch"]
-test = ["coverage", "fakeredis[lua]", "grpcio", "kaleido (<0.4)", "moto", "protobuf (>=5.28.1)", "pytest", "pytest-xdist", "scipy (>=1.9.2)", "torch"]
-
-[[package]]
-name = "packaging"
-version = "25.0"
-description = "Core utilities for Python packages"
-optional = false
-python-versions = ">=3.8"
-groups = ["main"]
-files = [
-    {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"},
-    {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"},
-]
-
-[[package]]
-name = "pandas"
-version = "2.3.3"
-description = "Powerful data structures for data analysis, time series, and statistics"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "pandas-2.3.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:376c6446ae31770764215a6c937f72d917f214b43560603cd60da6408f183b6c"},
-    {file = "pandas-2.3.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e19d192383eab2f4ceb30b412b22ea30690c9e618f78870357ae1d682912015a"},
-    {file = "pandas-2.3.3-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5caf26f64126b6c7aec964f74266f435afef1c1b13da3b0636c7518a1fa3e2b1"},
-    {file = "pandas-2.3.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dd7478f1463441ae4ca7308a70e90b33470fa593429f9d4c578dd00d1fa78838"},
-    {file = "pandas-2.3.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:4793891684806ae50d1288c9bae9330293ab4e083ccd1c5e383c34549c6e4250"},
-    {file = "pandas-2.3.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:28083c648d9a99a5dd035ec125d42439c6c1c525098c58af0fc38dd1a7a1b3d4"},
-    {file = "pandas-2.3.3-cp310-cp310-win_amd64.whl", hash = "sha256:503cf027cf9940d2ceaa1a93cfb5f8c8c7e6e90720a2850378f0b3f3b1e06826"},
-    {file = "pandas-2.3.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:602b8615ebcc4a0c1751e71840428ddebeb142ec02c786e8ad6b1ce3c8dec523"},
-    {file = "pandas-2.3.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8fe25fc7b623b0ef6b5009149627e34d2a4657e880948ec3c840e9402e5c1b45"},
-    {file = "pandas-2.3.3-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b468d3dad6ff947df92dcb32ede5b7bd41a9b3cceef0a30ed925f6d01fb8fa66"},
-    {file = "pandas-2.3.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b98560e98cb334799c0b07ca7967ac361a47326e9b4e5a7dfb5ab2b1c9d35a1b"},
-    {file = "pandas-2.3.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37b5848ba49824e5c30bedb9c830ab9b7751fd049bc7914533e01c65f79791"},
-    {file = "pandas-2.3.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:db4301b2d1f926ae677a751eb2bd0e8c5f5319c9cb3f88b0becbbb0b07b34151"},
-    {file = "pandas-2.3.3-cp311-cp311-win_amd64.whl", hash = "sha256:f086f6fe114e19d92014a1966f43a3e62285109afe874f067f5abbdcbb10e59c"},
-    {file = "pandas-2.3.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:6d21f6d74eb1725c2efaa71a2bfc661a0689579b58e9c0ca58a739ff0b002b53"},
-    {file = "pandas-2.3.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3fd2f887589c7aa868e02632612ba39acb0b8948faf5cc58f0850e165bd46f35"},
-    {file = "pandas-2.3.3-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ecaf1e12bdc03c86ad4a7ea848d66c685cb6851d807a26aa245ca3d2017a1908"},
-    {file = "pandas-2.3.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b3d11d2fda7eb164ef27ffc14b4fcab16a80e1ce67e9f57e19ec0afaf715ba89"},
-    {file = "pandas-2.3.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a68e15f780eddf2b07d242e17a04aa187a7ee12b40b930bfdd78070556550e98"},
-    {file = "pandas-2.3.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:371a4ab48e950033bcf52b6527eccb564f52dc826c02afd9a1bc0ab731bba084"},
-    {file = "pandas-2.3.3-cp312-cp312-win_amd64.whl", hash = "sha256:a16dcec078a01eeef8ee61bf64074b4e524a2a3f4b3be9326420cabe59c4778b"},
-    {file = "pandas-2.3.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:56851a737e3470de7fa88e6131f41281ed440d29a9268dcbf0002da5ac366713"},
-    {file = "pandas-2.3.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bdcd9d1167f4885211e401b3036c0c8d9e274eee67ea8d0758a256d60704cfe8"},
-    {file = "pandas-2.3.3-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e32e7cc9af0f1cc15548288a51a3b681cc2a219faa838e995f7dc53dbab1062d"},
-    {file = "pandas-2.3.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:318d77e0e42a628c04dc56bcef4b40de67918f7041c2b061af1da41dcff670ac"},
-    {file = "pandas-2.3.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4e0a175408804d566144e170d0476b15d78458795bb18f1304fb94160cabf40c"},
-    {file = "pandas-2.3.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:93c2d9ab0fc11822b5eece72ec9587e172f63cff87c00b062f6e37448ced4493"},
-    {file = "pandas-2.3.3-cp313-cp313-win_amd64.whl", hash = "sha256:f8bfc0e12dc78f777f323f55c58649591b2cd0c43534e8355c51d3fede5f4dee"},
-    {file = "pandas-2.3.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:75ea25f9529fdec2d2e93a42c523962261e567d250b0013b16210e1d40d7c2e5"},
-    {file = "pandas-2.3.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:74ecdf1d301e812db96a465a525952f4dde225fdb6d8e5a521d47e1f42041e21"},
-    {file = "pandas-2.3.3-cp313-cp313t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6435cb949cb34ec11cc9860246ccb2fdc9ecd742c12d3304989017d53f039a78"},
-    {file = "pandas-2.3.3-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:900f47d8f20860de523a1ac881c4c36d65efcb2eb850e6948140fa781736e110"},
-    {file = "pandas-2.3.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:a45c765238e2ed7d7c608fc5bc4a6f88b642f2f01e70c0c23d2224dd21829d86"},
-    {file = "pandas-2.3.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:c4fc4c21971a1a9f4bdb4c73978c7f7256caa3e62b323f70d6cb80db583350bc"},
-    {file = "pandas-2.3.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:ee15f284898e7b246df8087fc82b87b01686f98ee67d85a17b7ab44143a3a9a0"},
-    {file = "pandas-2.3.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1611aedd912e1ff81ff41c745822980c49ce4a7907537be8692c8dbc31924593"},
-    {file = "pandas-2.3.3-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6d2cefc361461662ac48810cb14365a365ce864afe85ef1f447ff5a1e99ea81c"},
-    {file = "pandas-2.3.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ee67acbbf05014ea6c763beb097e03cd629961c8a632075eeb34247120abcb4b"},
-    {file = "pandas-2.3.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c46467899aaa4da076d5abc11084634e2d197e9460643dd455ac3db5856b24d6"},
-    {file = "pandas-2.3.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:6253c72c6a1d990a410bc7de641d34053364ef8bcd3126f7e7450125887dffe3"},
-    {file = "pandas-2.3.3-cp314-cp314-win_amd64.whl", hash = "sha256:1b07204a219b3b7350abaae088f451860223a52cfb8a6c53358e7948735158e5"},
-    {file = "pandas-2.3.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:2462b1a365b6109d275250baaae7b760fd25c726aaca0054649286bcfbb3e8ec"},
-    {file = "pandas-2.3.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0242fe9a49aa8b4d78a4fa03acb397a58833ef6199e9aa40a95f027bb3a1b6e7"},
-    {file = "pandas-2.3.3-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a21d830e78df0a515db2b3d2f5570610f5e6bd2e27749770e8bb7b524b89b450"},
-    {file = "pandas-2.3.3-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2e3ebdb170b5ef78f19bfb71b0dc5dc58775032361fa188e814959b74d726dd5"},
-    {file = "pandas-2.3.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:d051c0e065b94b7a3cea50eb1ec32e912cd96dba41647eb24104b6c6c14c5788"},
-    {file = "pandas-2.3.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:3869faf4bd07b3b66a9f462417d0ca3a9df29a9f6abd5d0d0dbab15dac7abe87"},
-    {file = "pandas-2.3.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c503ba5216814e295f40711470446bc3fd00f0faea8a086cbc688808e26f92a2"},
-    {file = "pandas-2.3.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a637c5cdfa04b6d6e2ecedcb81fc52ffb0fd78ce2ebccc9ea964df9f658de8c8"},
-    {file = "pandas-2.3.3-cp39-cp39-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:854d00d556406bffe66a4c0802f334c9ad5a96b4f1f868adf036a21b11ef13ff"},
-    {file = "pandas-2.3.3-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bf1f8a81d04ca90e32a0aceb819d34dbd378a98bf923b6398b9a3ec0bf44de29"},
-    {file = "pandas-2.3.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:23ebd657a4d38268c7dfbdf089fbc31ea709d82e4923c5ffd4fbd5747133ce73"},
-    {file = "pandas-2.3.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:5554c929ccc317d41a5e3d1234f3be588248e61f08a74dd17c9eabb535777dc9"},
-    {file = "pandas-2.3.3-cp39-cp39-win_amd64.whl", hash = "sha256:d3e28b3e83862ccf4d85ff19cf8c20b2ae7e503881711ff2d534dc8f761131aa"},
-    {file = "pandas-2.3.3.tar.gz", hash = "sha256:e05e1af93b977f7eafa636d043f9f94c7ee3ac81af99c13508215942e64c993b"},
-]
-
-[package.dependencies]
-numpy = [
-    {version = ">=1.23.2", markers = "python_version == \"3.11\""},
-    {version = ">=1.26.0", markers = "python_version >= \"3.12\""},
-]
-python-dateutil = ">=2.8.2"
-pytz = ">=2020.1"
-tzdata = ">=2022.7"
-
-[package.extras]
-all = ["PyQt5 (>=5.15.9)", "SQLAlchemy (>=2.0.0)", "adbc-driver-postgresql (>=0.8.0)", "adbc-driver-sqlite (>=0.8.0)", "beautifulsoup4 (>=4.11.2)", "bottleneck (>=1.3.6)", "dataframe-api-compat (>=0.1.7)", "fastparquet (>=2022.12.0)", "fsspec (>=2022.11.0)", "gcsfs (>=2022.11.0)", "html5lib (>=1.1)", "hypothesis (>=6.46.1)", "jinja2 (>=3.1.2)", "lxml (>=4.9.2)", "matplotlib (>=3.6.3)", "numba (>=0.56.4)", "numexpr (>=2.8.4)", "odfpy (>=1.4.1)", "openpyxl (>=3.1.0)", "pandas-gbq (>=0.19.0 [...]
-aws = ["s3fs (>=2022.11.0)"]
-clipboard = ["PyQt5 (>=5.15.9)", "qtpy (>=2.3.0)"]
-compression = ["zstandard (>=0.19.0)"]
-computation = ["scipy (>=1.10.0)", "xarray (>=2022.12.0)"]
-consortium-standard = ["dataframe-api-compat (>=0.1.7)"]
-excel = ["odfpy (>=1.4.1)", "openpyxl (>=3.1.0)", "python-calamine (>=0.1.7)", "pyxlsb (>=1.0.10)", "xlrd (>=2.0.1)", "xlsxwriter (>=3.0.5)"]
-feather = ["pyarrow (>=10.0.1)"]
-fss = ["fsspec (>=2022.11.0)"]
-gcp = ["gcsfs (>=2022.11.0)", "pandas-gbq (>=0.19.0)"]
-hdf5 = ["tables (>=3.8.0)"]
-html = ["beautifulsoup4 (>=4.11.2)", "html5lib (>=1.1)", "lxml (>=4.9.2)"]
-mysql = ["SQLAlchemy (>=2.0.0)", "pymysql (>=1.0.2)"]
-output-formatting = ["jinja2 (>=3.1.2)", "tabulate (>=0.9.0)"]
-parquet = ["pyarrow (>=10.0.1)"]
-performance = ["bottleneck (>=1.3.6)", "numba (>=0.56.4)", "numexpr (>=2.8.4)"]
-plot = ["matplotlib (>=3.6.3)"]
-postgresql = ["SQLAlchemy (>=2.0.0)", "adbc-driver-postgresql (>=0.8.0)", "psycopg2 (>=2.9.6)"]
-pyarrow = ["pyarrow (>=10.0.1)"]
-spss = ["pyreadstat (>=1.2.0)"]
-sql-other = ["SQLAlchemy (>=2.0.0)", "adbc-driver-postgresql (>=0.8.0)", "adbc-driver-sqlite (>=0.8.0)"]
-test = ["hypothesis (>=6.46.1)", "pytest (>=7.3.2)", "pytest-xdist (>=2.2.0)"]
-xml = ["lxml (>=4.9.2)"]
-
-[[package]]
-name = "pathspec"
-version = "0.12.1"
-description = "Utility library for gitignore style pattern matching of file paths."
-optional = false
-python-versions = ">=3.8"
-groups = ["main"]
-files = [
-    {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"},
-    {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"},
-]
-
-[[package]]
-name = "patsy"
-version = "1.0.1"
-description = "A Python package for describing statistical models and for building design matrices."
-optional = false
-python-versions = ">=3.6"
-groups = ["main"]
-files = [
-    {file = "patsy-1.0.1-py2.py3-none-any.whl", hash = "sha256:751fb38f9e97e62312e921a1954b81e1bb2bcda4f5eeabaf94db251ee791509c"},
-    {file = "patsy-1.0.1.tar.gz", hash = "sha256:e786a9391eec818c054e359b737bbce692f051aee4c661f4141cc88fb459c0c4"},
-]
-
-[package.dependencies]
-numpy = ">=1.4"
-
-[package.extras]
-test = ["pytest", "pytest-cov", "scipy"]
-
-[[package]]
-name = "pefile"
-version = "2023.2.7"
-description = "Python PE parsing module"
-optional = false
-python-versions = ">=3.6.0"
-groups = ["main"]
-markers = "sys_platform == \"win32\""
-files = [
-    {file = "pefile-2023.2.7-py3-none-any.whl", hash = "sha256:da185cd2af68c08a6cd4481f7325ed600a88f6a813bad9dea07ab3ef73d8d8d6"},
-    {file = "pefile-2023.2.7.tar.gz", hash = "sha256:82e6114004b3d6911c77c3953e3838654b04511b8b66e8583db70c65998017dc"},
-]
-
-[[package]]
-name = "platformdirs"
-version = "4.4.0"
-description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`."
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "platformdirs-4.4.0-py3-none-any.whl", hash = "sha256:abd01743f24e5287cd7a5db3752faf1a2d65353f38ec26d98e25a6db65958c85"},
-    {file = "platformdirs-4.4.0.tar.gz", hash = "sha256:ca753cf4d81dc309bc67b0ea38fd15dc97bc30ce419a7f58d13eb3bf14c4febf"},
-]
-
-[package.extras]
-docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.1.3)", "sphinx-autodoc-typehints (>=3)"]
-test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.4)", "pytest-cov (>=6)", "pytest-mock (>=3.14)"]
-type = ["mypy (>=1.14.1)"]
-
-[[package]]
-name = "psutil"
-version = "7.1.0"
-description = "Cross-platform lib for process and system monitoring."
-optional = false
-python-versions = ">=3.6"
-groups = ["main"]
-files = [
-    {file = "psutil-7.1.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:76168cef4397494250e9f4e73eb3752b146de1dd950040b29186d0cce1d5ca13"},
-    {file = "psutil-7.1.0-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:5d007560c8c372efdff9e4579c2846d71de737e4605f611437255e81efcca2c5"},
-    {file = "psutil-7.1.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:22e4454970b32472ce7deaa45d045b34d3648ce478e26a04c7e858a0a6e75ff3"},
-    {file = "psutil-7.1.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c70e113920d51e89f212dd7be06219a9b88014e63a4cec69b684c327bc474e3"},
-    {file = "psutil-7.1.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7d4a113425c037300de3ac8b331637293da9be9713855c4fc9d2d97436d7259d"},
-    {file = "psutil-7.1.0-cp37-abi3-win32.whl", hash = "sha256:09ad740870c8d219ed8daae0ad3b726d3bf9a028a198e7f3080f6a1888b99bca"},
-    {file = "psutil-7.1.0-cp37-abi3-win_amd64.whl", hash = "sha256:57f5e987c36d3146c0dd2528cd42151cf96cd359b9d67cfff836995cc5df9a3d"},
-    {file = "psutil-7.1.0-cp37-abi3-win_arm64.whl", hash = "sha256:6937cb68133e7c97b6cc9649a570c9a18ba0efebed46d8c5dae4c07fa1b67a07"},
-    {file = "psutil-7.1.0.tar.gz", hash = "sha256:655708b3c069387c8b77b072fc429a57d0e214221d01c0a772df7dfedcb3bcd2"},
-]
-
-[package.extras]
-dev = ["abi3audit", "black", "check-manifest", "coverage", "packaging", "pylint", "pyperf", "pypinfo", "pyreadline ; os_name == \"nt\"", "pytest", "pytest-cov", "pytest-instafail", "pytest-subtests", "pytest-xdist", "pywin32 ; os_name == \"nt\" and platform_python_implementation != \"PyPy\"", "requests", "rstcheck", "ruff", "setuptools", "sphinx", "sphinx_rtd_theme", "toml-sort", "twine", "virtualenv", "vulture", "wheel", "wheel ; os_name == \"nt\" and platform_python_implementation != \ [...]
-test = ["pytest", "pytest-instafail", "pytest-subtests", "pytest-xdist", "pywin32 ; os_name == \"nt\" and platform_python_implementation != \"PyPy\"", "setuptools", "wheel ; os_name == \"nt\" and platform_python_implementation != \"PyPy\"", "wmi ; os_name == \"nt\" and platform_python_implementation != \"PyPy\""]
-
-[[package]]
-name = "pyinstaller"
-version = "6.16.0"
-description = "PyInstaller bundles a Python application and all its dependencies into a single package."
-optional = false
-python-versions = "<3.15,>=3.8"
-groups = ["main"]
-files = [
-    {file = "pyinstaller-6.16.0-py3-none-macosx_10_13_universal2.whl", hash = "sha256:7fd1c785219a87ca747c21fa92f561b0d2926a7edc06d0a0fe37f3736e00bd7a"},
-    {file = "pyinstaller-6.16.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:b756ddb9007b8141c5476b553351f9d97559b8af5d07f9460869bfae02be26b0"},
-    {file = "pyinstaller-6.16.0-py3-none-manylinux2014_i686.whl", hash = "sha256:0a48f55b85ff60f83169e10050f2759019cf1d06773ad1c4da3a411cd8751058"},
-    {file = "pyinstaller-6.16.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:73ba72e04fcece92e32518bbb1e1fb5ac2892677943dfdff38e01a06e8742851"},
-    {file = "pyinstaller-6.16.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:b1752488248f7899281b17ca3238eefb5410521291371a686a4f5830f29f52b3"},
-    {file = "pyinstaller-6.16.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:ba618a61627ee674d6d68e5de084ba17c707b59a4f2a856084b3999bdffbd3f0"},
-    {file = "pyinstaller-6.16.0-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:c8b7ef536711617e12fef4673806198872033fa06fa92326ad7fd1d84a9fa454"},
-    {file = "pyinstaller-6.16.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:d1ebf84d02c51fed19b82a8abb4df536923abd55bb684d694e1356e4ae2a0ce5"},
-    {file = "pyinstaller-6.16.0-py3-none-win32.whl", hash = "sha256:6d5f8617f3650ff9ef893e2ab4ddbf3c0d23d0c602ef74b5df8fbef4607840c8"},
-    {file = "pyinstaller-6.16.0-py3-none-win_amd64.whl", hash = "sha256:bc10eb1a787f99fea613509f55b902fbd2d8b73ff5f51ff245ea29a481d97d41"},
-    {file = "pyinstaller-6.16.0-py3-none-win_arm64.whl", hash = "sha256:d0af8a401de792c233c32c44b16d065ca9ab8262ee0c906835c12bdebc992a64"},
-    {file = "pyinstaller-6.16.0.tar.gz", hash = "sha256:53559fe1e041a234f2b4dcc3288ea8bdd57f7cad8a6644e422c27bb407f3edef"},
-]
-
-[package.dependencies]
-altgraph = "*"
-macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""}
-packaging = ">=22.0"
-pefile = {version = ">=2022.5.30,<2024.8.26 || >2024.8.26", markers = "sys_platform == \"win32\""}
-pyinstaller-hooks-contrib = ">=2025.8"
-pywin32-ctypes = {version = ">=0.2.1", markers = "sys_platform == \"win32\""}
-setuptools = ">=42.0.0"
-
-[package.extras]
-completion = ["argcomplete"]
-hook-testing = ["execnet (>=1.5.0)", "psutil", "pytest (>=2.7.3)"]
-
-[[package]]
-name = "pyinstaller-hooks-contrib"
-version = "2025.9"
-description = "Community maintained hooks for PyInstaller"
-optional = false
-python-versions = ">=3.8"
-groups = ["main"]
-files = [
-    {file = "pyinstaller_hooks_contrib-2025.9-py3-none-any.whl", hash = "sha256:ccbfaa49399ef6b18486a165810155e5a8d4c59b41f20dc5da81af7482aaf038"},
-    {file = "pyinstaller_hooks_contrib-2025.9.tar.gz", hash = "sha256:56e972bdaad4e9af767ed47d132362d162112260cbe488c9da7fee01f228a5a6"},
-]
-
-[package.dependencies]
-packaging = ">=22.0"
-setuptools = ">=42.0.0"
-
-[[package]]
-name = "python-dateutil"
-version = "2.9.0.post0"
-description = "Extensions to the standard Python datetime module"
-optional = false
-python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
-groups = ["main"]
-files = [
-    {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"},
-    {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},
-]
-
-[package.dependencies]
-six = ">=1.5"
-
-[[package]]
-name = "pytz"
-version = "2025.2"
-description = "World timezone definitions, modern and historical"
-optional = false
-python-versions = "*"
-groups = ["main"]
-files = [
-    {file = "pytz-2025.2-py2.py3-none-any.whl", hash = "sha256:5ddf76296dd8c44c26eb8f4b6f35488f3ccbf6fbbd7adee0b7262d43f0ec2f00"},
-    {file = "pytz-2025.2.tar.gz", hash = "sha256:360b9e3dbb49a209c21ad61809c7fb453643e048b38924c765813546746e81c3"},
-]
-
-[[package]]
-name = "pywin32-ctypes"
-version = "0.2.3"
-description = "A (partial) reimplementation of pywin32 using ctypes/cffi"
-optional = false
-python-versions = ">=3.6"
-groups = ["main"]
-markers = "sys_platform == \"win32\""
-files = [
-    {file = "pywin32-ctypes-0.2.3.tar.gz", hash = "sha256:d162dc04946d704503b2edc4d55f3dba5c1d539ead017afa00142c38b9885755"},
-    {file = "pywin32_ctypes-0.2.3-py3-none-any.whl", hash = "sha256:8a1513379d709975552d202d942d9837758905c8d01eb82b8bcc30918929e7b8"},
-]
-
-[[package]]
-name = "pyyaml"
-version = "6.0.3"
-description = "YAML parser and emitter for Python"
-optional = false
-python-versions = ">=3.8"
-groups = ["main"]
-files = [
-    {file = "PyYAML-6.0.3-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:c2514fceb77bc5e7a2f7adfaa1feb2fb311607c9cb518dbc378688ec73d8292f"},
-    {file = "PyYAML-6.0.3-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9c57bb8c96f6d1808c030b1687b9b5fb476abaa47f0db9c0101f5e9f394e97f4"},
-    {file = "PyYAML-6.0.3-cp38-cp38-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:efd7b85f94a6f21e4932043973a7ba2613b059c4a000551892ac9f1d11f5baf3"},
-    {file = "PyYAML-6.0.3-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:22ba7cfcad58ef3ecddc7ed1db3409af68d023b7f940da23c6c2a1890976eda6"},
-    {file = "PyYAML-6.0.3-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6344df0d5755a2c9a276d4473ae6b90647e216ab4757f8426893b5dd2ac3f369"},
-    {file = "PyYAML-6.0.3-cp38-cp38-win32.whl", hash = "sha256:3ff07ec89bae51176c0549bc4c63aa6202991da2d9a6129d7aef7f1407d3f295"},
-    {file = "PyYAML-6.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:5cf4e27da7e3fbed4d6c3d8e797387aaad68102272f8f9752883bc32d61cb87b"},
-    {file = "pyyaml-6.0.3-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:214ed4befebe12df36bcc8bc2b64b396ca31be9304b8f59e25c11cf94a4c033b"},
-    {file = "pyyaml-6.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:02ea2dfa234451bbb8772601d7b8e426c2bfa197136796224e50e35a78777956"},
-    {file = "pyyaml-6.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b30236e45cf30d2b8e7b3e85881719e98507abed1011bf463a8fa23e9c3e98a8"},
-    {file = "pyyaml-6.0.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:66291b10affd76d76f54fad28e22e51719ef9ba22b29e1d7d03d6777a9174198"},
-    {file = "pyyaml-6.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9c7708761fccb9397fe64bbc0395abcae8c4bf7b0eac081e12b809bf47700d0b"},
-    {file = "pyyaml-6.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:418cf3f2111bc80e0933b2cd8cd04f286338bb88bdc7bc8e6dd775ebde60b5e0"},
-    {file = "pyyaml-6.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5e0b74767e5f8c593e8c9b5912019159ed0533c70051e9cce3e8b6aa699fcd69"},
-    {file = "pyyaml-6.0.3-cp310-cp310-win32.whl", hash = "sha256:28c8d926f98f432f88adc23edf2e6d4921ac26fb084b028c733d01868d19007e"},
-    {file = "pyyaml-6.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:bdb2c67c6c1390b63c6ff89f210c8fd09d9a1217a465701eac7316313c915e4c"},
-    {file = "pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e"},
-    {file = "pyyaml-6.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824"},
-    {file = "pyyaml-6.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c"},
-    {file = "pyyaml-6.0.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00"},
-    {file = "pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d"},
-    {file = "pyyaml-6.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a"},
-    {file = "pyyaml-6.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4"},
-    {file = "pyyaml-6.0.3-cp311-cp311-win32.whl", hash = "sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b"},
-    {file = "pyyaml-6.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf"},
-    {file = "pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196"},
-    {file = "pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0"},
-    {file = "pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28"},
-    {file = "pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c"},
-    {file = "pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc"},
-    {file = "pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e"},
-    {file = "pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea"},
-    {file = "pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5"},
-    {file = "pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b"},
-    {file = "pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd"},
-    {file = "pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8"},
-    {file = "pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1"},
-    {file = "pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c"},
-    {file = "pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5"},
-    {file = "pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6"},
-    {file = "pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6"},
-    {file = "pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be"},
-    {file = "pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26"},
-    {file = "pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c"},
-    {file = "pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb"},
-    {file = "pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac"},
-    {file = "pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310"},
-    {file = "pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7"},
-    {file = "pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788"},
-    {file = "pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5"},
-    {file = "pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764"},
-    {file = "pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35"},
-    {file = "pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac"},
-    {file = "pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3"},
-    {file = "pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3"},
-    {file = "pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba"},
-    {file = "pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c"},
-    {file = "pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702"},
-    {file = "pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c"},
-    {file = "pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065"},
-    {file = "pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65"},
-    {file = "pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9"},
-    {file = "pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b"},
-    {file = "pyyaml-6.0.3-cp39-cp39-macosx_10_13_x86_64.whl", hash = "sha256:b865addae83924361678b652338317d1bd7e79b1f4596f96b96c77a5a34b34da"},
-    {file = "pyyaml-6.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c3355370a2c156cffb25e876646f149d5d68f5e0a3ce86a5084dd0b64a994917"},
-    {file = "pyyaml-6.0.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3c5677e12444c15717b902a5798264fa7909e41153cdf9ef7ad571b704a63dd9"},
-    {file = "pyyaml-6.0.3-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5ed875a24292240029e4483f9d4a4b8a1ae08843b9c54f43fcc11e404532a8a5"},
-    {file = "pyyaml-6.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0150219816b6a1fa26fb4699fb7daa9caf09eb1999f3b70fb6e786805e80375a"},
-    {file = "pyyaml-6.0.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:fa160448684b4e94d80416c0fa4aac48967a969efe22931448d853ada8baf926"},
-    {file = "pyyaml-6.0.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:27c0abcb4a5dac13684a37f76e701e054692a9b2d3064b70f5e4eb54810553d7"},
-    {file = "pyyaml-6.0.3-cp39-cp39-win32.whl", hash = "sha256:1ebe39cb5fc479422b83de611d14e2c0d3bb2a18bbcb01f229ab3cfbd8fee7a0"},
-    {file = "pyyaml-6.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:2e71d11abed7344e42a8849600193d15b6def118602c4c176f748e4583246007"},
-    {file = "pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f"},
-]
-
-[[package]]
-name = "regex"
-version = "2025.9.18"
-description = "Alternative regular expression module, to replace re."
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "regex-2025.9.18-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:12296202480c201c98a84aecc4d210592b2f55e200a1d193235c4db92b9f6788"},
-    {file = "regex-2025.9.18-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:220381f1464a581f2ea988f2220cf2a67927adcef107d47d6897ba5a2f6d51a4"},
-    {file = "regex-2025.9.18-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:87f681bfca84ebd265278b5daa1dcb57f4db315da3b5d044add7c30c10442e61"},
-    {file = "regex-2025.9.18-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:34d674cbba70c9398074c8a1fcc1a79739d65d1105de2a3c695e2b05ea728251"},
-    {file = "regex-2025.9.18-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:385c9b769655cb65ea40b6eea6ff763cbb6d69b3ffef0b0db8208e1833d4e746"},
-    {file = "regex-2025.9.18-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8900b3208e022570ae34328712bef6696de0804c122933414014bae791437ab2"},
-    {file = "regex-2025.9.18-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c204e93bf32cd7a77151d44b05eb36f469d0898e3fba141c026a26b79d9914a0"},
-    {file = "regex-2025.9.18-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3acc471d1dd7e5ff82e6cacb3b286750decd949ecd4ae258696d04f019817ef8"},
-    {file = "regex-2025.9.18-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:6479d5555122433728760e5f29edb4c2b79655a8deb681a141beb5c8a025baea"},
-    {file = "regex-2025.9.18-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:431bd2a8726b000eb6f12429c9b438a24062a535d06783a93d2bcbad3698f8a8"},
-    {file = "regex-2025.9.18-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:0cc3521060162d02bd36927e20690129200e5ac9d2c6d32b70368870b122db25"},
-    {file = "regex-2025.9.18-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:a021217b01be2d51632ce056d7a837d3fa37c543ede36e39d14063176a26ae29"},
-    {file = "regex-2025.9.18-cp310-cp310-win32.whl", hash = "sha256:4a12a06c268a629cb67cc1d009b7bb0be43e289d00d5111f86a2efd3b1949444"},
-    {file = "regex-2025.9.18-cp310-cp310-win_amd64.whl", hash = "sha256:47acd811589301298c49db2c56bde4f9308d6396da92daf99cba781fa74aa450"},
-    {file = "regex-2025.9.18-cp310-cp310-win_arm64.whl", hash = "sha256:16bd2944e77522275e5ee36f867e19995bcaa533dcb516753a26726ac7285442"},
-    {file = "regex-2025.9.18-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:51076980cd08cd13c88eb7365427ae27f0d94e7cebe9ceb2bb9ffdae8fc4d82a"},
-    {file = "regex-2025.9.18-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:828446870bd7dee4e0cbeed767f07961aa07f0ea3129f38b3ccecebc9742e0b8"},
-    {file = "regex-2025.9.18-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c28821d5637866479ec4cc23b8c990f5bc6dd24e5e4384ba4a11d38a526e1414"},
-    {file = "regex-2025.9.18-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:726177ade8e481db669e76bf99de0b278783be8acd11cef71165327abd1f170a"},
-    {file = "regex-2025.9.18-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f5cca697da89b9f8ea44115ce3130f6c54c22f541943ac8e9900461edc2b8bd4"},
-    {file = "regex-2025.9.18-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:dfbde38f38004703c35666a1e1c088b778e35d55348da2b7b278914491698d6a"},
-    {file = "regex-2025.9.18-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f2f422214a03fab16bfa495cfec72bee4aaa5731843b771860a471282f1bf74f"},
-    {file = "regex-2025.9.18-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:a295916890f4df0902e4286bc7223ee7f9e925daa6dcdec4192364255b70561a"},
-    {file = "regex-2025.9.18-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:5db95ff632dbabc8c38c4e82bf545ab78d902e81160e6e455598014f0abe66b9"},
-    {file = "regex-2025.9.18-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:fb967eb441b0f15ae610b7069bdb760b929f267efbf522e814bbbfffdf125ce2"},
-    {file = "regex-2025.9.18-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f04d2f20da4053d96c08f7fde6e1419b7ec9dbcee89c96e3d731fca77f411b95"},
-    {file = "regex-2025.9.18-cp311-cp311-win32.whl", hash = "sha256:895197241fccf18c0cea7550c80e75f185b8bd55b6924fcae269a1a92c614a07"},
-    {file = "regex-2025.9.18-cp311-cp311-win_amd64.whl", hash = "sha256:7e2b414deae99166e22c005e154a5513ac31493db178d8aec92b3269c9cce8c9"},
-    {file = "regex-2025.9.18-cp311-cp311-win_arm64.whl", hash = "sha256:fb137ec7c5c54f34a25ff9b31f6b7b0c2757be80176435bf367111e3f71d72df"},
-    {file = "regex-2025.9.18-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:436e1b31d7efd4dcd52091d076482031c611dde58bf9c46ca6d0a26e33053a7e"},
-    {file = "regex-2025.9.18-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c190af81e5576b9c5fdc708f781a52ff20f8b96386c6e2e0557a78402b029f4a"},
-    {file = "regex-2025.9.18-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e4121f1ce2b2b5eec4b397cc1b277686e577e658d8f5870b7eb2d726bd2300ab"},
-    {file = "regex-2025.9.18-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:300e25dbbf8299d87205e821a201057f2ef9aa3deb29caa01cd2cac669e508d5"},
-    {file = "regex-2025.9.18-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7b47fcf9f5316c0bdaf449e879407e1b9937a23c3b369135ca94ebc8d74b1742"},
-    {file = "regex-2025.9.18-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:57a161bd3acaa4b513220b49949b07e252165e6b6dc910ee7617a37ff4f5b425"},
-    {file = "regex-2025.9.18-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f130c3a7845ba42de42f380fff3c8aebe89a810747d91bcf56d40a069f15352"},
-    {file = "regex-2025.9.18-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5f96fa342b6f54dcba928dd452e8d8cb9f0d63e711d1721cd765bb9f73bb048d"},
-    {file = "regex-2025.9.18-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:0f0d676522d68c207828dcd01fb6f214f63f238c283d9f01d85fc664c7c85b56"},
-    {file = "regex-2025.9.18-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:40532bff8a1a0621e7903ae57fce88feb2e8a9a9116d341701302c9302aef06e"},
-    {file = "regex-2025.9.18-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:039f11b618ce8d71a1c364fdee37da1012f5a3e79b1b2819a9f389cd82fd6282"},
-    {file = "regex-2025.9.18-cp312-cp312-win32.whl", hash = "sha256:e1dd06f981eb226edf87c55d523131ade7285137fbde837c34dc9d1bf309f459"},
-    {file = "regex-2025.9.18-cp312-cp312-win_amd64.whl", hash = "sha256:3d86b5247bf25fa3715e385aa9ff272c307e0636ce0c9595f64568b41f0a9c77"},
-    {file = "regex-2025.9.18-cp312-cp312-win_arm64.whl", hash = "sha256:032720248cbeeae6444c269b78cb15664458b7bb9ed02401d3da59fe4d68c3a5"},
-    {file = "regex-2025.9.18-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:2a40f929cd907c7e8ac7566ac76225a77701a6221bca937bdb70d56cb61f57b2"},
-    {file = "regex-2025.9.18-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c90471671c2cdf914e58b6af62420ea9ecd06d1554d7474d50133ff26ae88feb"},
-    {file = "regex-2025.9.18-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1a351aff9e07a2dabb5022ead6380cff17a4f10e4feb15f9100ee56c4d6d06af"},
-    {file = "regex-2025.9.18-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bc4b8e9d16e20ddfe16430c23468a8707ccad3365b06d4536142e71823f3ca29"},
-    {file = "regex-2025.9.18-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4b8cdbddf2db1c5e80338ba2daa3cfa3dec73a46fff2a7dda087c8efbf12d62f"},
-    {file = "regex-2025.9.18-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a276937d9d75085b2c91fb48244349c6954f05ee97bba0963ce24a9d915b8b68"},
-    {file = "regex-2025.9.18-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:92a8e375ccdc1256401c90e9dc02b8642894443d549ff5e25e36d7cf8a80c783"},
-    {file = "regex-2025.9.18-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0dc6893b1f502d73037cf807a321cdc9be29ef3d6219f7970f842475873712ac"},
-    {file = "regex-2025.9.18-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:a61e85bfc63d232ac14b015af1261f826260c8deb19401c0597dbb87a864361e"},
-    {file = "regex-2025.9.18-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:1ef86a9ebc53f379d921fb9a7e42b92059ad3ee800fcd9e0fe6181090e9f6c23"},
-    {file = "regex-2025.9.18-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:d3bc882119764ba3a119fbf2bd4f1b47bc56c1da5d42df4ed54ae1e8e66fdf8f"},
-    {file = "regex-2025.9.18-cp313-cp313-win32.whl", hash = "sha256:3810a65675845c3bdfa58c3c7d88624356dd6ee2fc186628295e0969005f928d"},
-    {file = "regex-2025.9.18-cp313-cp313-win_amd64.whl", hash = "sha256:16eaf74b3c4180ede88f620f299e474913ab6924d5c4b89b3833bc2345d83b3d"},
-    {file = "regex-2025.9.18-cp313-cp313-win_arm64.whl", hash = "sha256:4dc98ba7dd66bd1261927a9f49bd5ee2bcb3660f7962f1ec02617280fc00f5eb"},
-    {file = "regex-2025.9.18-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:fe5d50572bc885a0a799410a717c42b1a6b50e2f45872e2b40f4f288f9bce8a2"},
-    {file = "regex-2025.9.18-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:1b9d9a2d6cda6621551ca8cf7a06f103adf72831153f3c0d982386110870c4d3"},
-    {file = "regex-2025.9.18-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:13202e4c4ac0ef9a317fff817674b293c8f7e8c68d3190377d8d8b749f566e12"},
-    {file = "regex-2025.9.18-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:874ff523b0fecffb090f80ae53dc93538f8db954c8bb5505f05b7787ab3402a0"},
-    {file = "regex-2025.9.18-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d13ab0490128f2bb45d596f754148cd750411afc97e813e4b3a61cf278a23bb6"},
-    {file = "regex-2025.9.18-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:05440bc172bc4b4b37fb9667e796597419404dbba62e171e1f826d7d2a9ebcef"},
-    {file = "regex-2025.9.18-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5514b8e4031fdfaa3d27e92c75719cbe7f379e28cacd939807289bce76d0e35a"},
-    {file = "regex-2025.9.18-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:65d3c38c39efce73e0d9dc019697b39903ba25b1ad45ebbd730d2cf32741f40d"},
-    {file = "regex-2025.9.18-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:ae77e447ebc144d5a26d50055c6ddba1d6ad4a865a560ec7200b8b06bc529368"},
-    {file = "regex-2025.9.18-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:e3ef8cf53dc8df49d7e28a356cf824e3623764e9833348b655cfed4524ab8a90"},
-    {file = "regex-2025.9.18-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:9feb29817df349c976da9a0debf775c5c33fc1c8ad7b9f025825da99374770b7"},
-    {file = "regex-2025.9.18-cp313-cp313t-win32.whl", hash = "sha256:168be0d2f9b9d13076940b1ed774f98595b4e3c7fc54584bba81b3cc4181742e"},
-    {file = "regex-2025.9.18-cp313-cp313t-win_amd64.whl", hash = "sha256:d59ecf3bb549e491c8104fea7313f3563c7b048e01287db0a90485734a70a730"},
-    {file = "regex-2025.9.18-cp313-cp313t-win_arm64.whl", hash = "sha256:dbef80defe9fb21310948a2595420b36c6d641d9bea4c991175829b2cc4bc06a"},
-    {file = "regex-2025.9.18-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:c6db75b51acf277997f3adcd0ad89045d856190d13359f15ab5dda21581d9129"},
-    {file = "regex-2025.9.18-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8f9698b6f6895d6db810e0bda5364f9ceb9e5b11328700a90cae573574f61eea"},
-    {file = "regex-2025.9.18-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:29cd86aa7cb13a37d0f0d7c21d8d949fe402ffa0ea697e635afedd97ab4b69f1"},
-    {file = "regex-2025.9.18-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7c9f285a071ee55cd9583ba24dde006e53e17780bb309baa8e4289cd472bcc47"},
-    {file = "regex-2025.9.18-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5adf266f730431e3be9021d3e5b8d5ee65e563fec2883ea8093944d21863b379"},
-    {file = "regex-2025.9.18-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1137cabc0f38807de79e28d3f6e3e3f2cc8cfb26bead754d02e6d1de5f679203"},
-    {file = "regex-2025.9.18-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7cc9e5525cada99699ca9223cce2d52e88c52a3d2a0e842bd53de5497c604164"},
-    {file = "regex-2025.9.18-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:bbb9246568f72dce29bcd433517c2be22c7791784b223a810225af3b50d1aafb"},
-    {file = "regex-2025.9.18-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:6a52219a93dd3d92c675383efff6ae18c982e2d7651c792b1e6d121055808743"},
-    {file = "regex-2025.9.18-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:ae9b3840c5bd456780e3ddf2f737ab55a79b790f6409182012718a35c6d43282"},
-    {file = "regex-2025.9.18-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d488c236ac497c46a5ac2005a952c1a0e22a07be9f10c3e735bc7d1209a34773"},
-    {file = "regex-2025.9.18-cp314-cp314-win32.whl", hash = "sha256:0c3506682ea19beefe627a38872d8da65cc01ffa25ed3f2e422dffa1474f0788"},
-    {file = "regex-2025.9.18-cp314-cp314-win_amd64.whl", hash = "sha256:57929d0f92bebb2d1a83af372cd0ffba2263f13f376e19b1e4fa32aec4efddc3"},
-    {file = "regex-2025.9.18-cp314-cp314-win_arm64.whl", hash = "sha256:6a4b44df31d34fa51aa5c995d3aa3c999cec4d69b9bd414a8be51984d859f06d"},
-    {file = "regex-2025.9.18-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:b176326bcd544b5e9b17d6943f807697c0cb7351f6cfb45bf5637c95ff7e6306"},
-    {file = "regex-2025.9.18-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:0ffd9e230b826b15b369391bec167baed57c7ce39efc35835448618860995946"},
-    {file = "regex-2025.9.18-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ec46332c41add73f2b57e2f5b642f991f6b15e50e9f86285e08ffe3a512ac39f"},
-    {file = "regex-2025.9.18-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b80fa342ed1ea095168a3f116637bd1030d39c9ff38dc04e54ef7c521e01fc95"},
-    {file = "regex-2025.9.18-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f4d97071c0ba40f0cf2a93ed76e660654c399a0a04ab7d85472239460f3da84b"},
-    {file = "regex-2025.9.18-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0ac936537ad87cef9e0e66c5144484206c1354224ee811ab1519a32373e411f3"},
-    {file = "regex-2025.9.18-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dec57f96d4def58c422d212d414efe28218d58537b5445cf0c33afb1b4768571"},
-    {file = "regex-2025.9.18-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:48317233294648bf7cd068857f248e3a57222259a5304d32c7552e2284a1b2ad"},
-    {file = "regex-2025.9.18-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:274687e62ea3cf54846a9b25fc48a04459de50af30a7bd0b61a9e38015983494"},
-    {file = "regex-2025.9.18-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:a78722c86a3e7e6aadf9579e3b0ad78d955f2d1f1a8ca4f67d7ca258e8719d4b"},
-    {file = "regex-2025.9.18-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:06104cd203cdef3ade989a1c45b6215bf42f8b9dd705ecc220c173233f7cba41"},
-    {file = "regex-2025.9.18-cp314-cp314t-win32.whl", hash = "sha256:2e1eddc06eeaffd249c0adb6fafc19e2118e6308c60df9db27919e96b5656096"},
-    {file = "regex-2025.9.18-cp314-cp314t-win_amd64.whl", hash = "sha256:8620d247fb8c0683ade51217b459cb4a1081c0405a3072235ba43a40d355c09a"},
-    {file = "regex-2025.9.18-cp314-cp314t-win_arm64.whl", hash = "sha256:b7531a8ef61de2c647cdf68b3229b071e46ec326b3138b2180acb4275f470b01"},
-    {file = "regex-2025.9.18-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:3dbcfcaa18e9480669030d07371713c10b4f1a41f791ffa5cb1a99f24e777f40"},
-    {file = "regex-2025.9.18-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1e85f73ef7095f0380208269055ae20524bfde3f27c5384126ddccf20382a638"},
-    {file = "regex-2025.9.18-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9098e29b3ea4ffffeade423f6779665e2a4f8db64e699c0ed737ef0db6ba7b12"},
-    {file = "regex-2025.9.18-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90b6b7a2d0f45b7ecaaee1aec6b362184d6596ba2092dd583ffba1b78dd0231c"},
-    {file = "regex-2025.9.18-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c81b892af4a38286101502eae7aec69f7cd749a893d9987a92776954f3943408"},
-    {file = "regex-2025.9.18-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3b524d010973f2e1929aeb635418d468d869a5f77b52084d9f74c272189c251d"},
-    {file = "regex-2025.9.18-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6b498437c026a3d5d0be0020023ff76d70ae4d77118e92f6f26c9d0423452446"},
-    {file = "regex-2025.9.18-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0716e4d6e58853d83f6563f3cf25c281ff46cf7107e5f11879e32cb0b59797d9"},
-    {file = "regex-2025.9.18-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:065b6956749379d41db2625f880b637d4acc14c0a4de0d25d609a62850e96d36"},
-    {file = "regex-2025.9.18-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:d4a691494439287c08ddb9b5793da605ee80299dd31e95fa3f323fac3c33d9d4"},
-    {file = "regex-2025.9.18-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ef8d10cc0989565bcbe45fb4439f044594d5c2b8919d3d229ea2c4238f1d55b0"},
-    {file = "regex-2025.9.18-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:4baeb1b16735ac969a7eeecc216f1f8b7caf60431f38a2671ae601f716a32d25"},
-    {file = "regex-2025.9.18-cp39-cp39-win32.whl", hash = "sha256:8e5f41ad24a1e0b5dfcf4c4e5d9f5bd54c895feb5708dd0c1d0d35693b24d478"},
-    {file = "regex-2025.9.18-cp39-cp39-win_amd64.whl", hash = "sha256:50e8290707f2fb8e314ab3831e594da71e062f1d623b05266f8cfe4db4949afd"},
-    {file = "regex-2025.9.18-cp39-cp39-win_arm64.whl", hash = "sha256:039a9d7195fd88c943d7c777d4941e8ef736731947becce773c31a1009cb3c35"},
-    {file = "regex-2025.9.18.tar.gz", hash = "sha256:c5ba23274c61c6fef447ba6a39333297d0c247f53059dba0bca415cac511edc4"},
-]
-
-[[package]]
-name = "requests"
-version = "2.32.5"
-description = "Python HTTP for Humans."
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6"},
-    {file = "requests-2.32.5.tar.gz", hash = "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf"},
-]
-
-[package.dependencies]
-certifi = ">=2017.4.17"
-charset_normalizer = ">=2,<4"
-idna = ">=2.5,<4"
-urllib3 = ">=1.21.1,<3"
-
-[package.extras]
-socks = ["PySocks (>=1.5.6,!=1.5.7)"]
-use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
-
-[[package]]
-name = "safetensors"
-version = "0.6.2"
-description = ""
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "safetensors-0.6.2-cp38-abi3-macosx_10_12_x86_64.whl", hash = "sha256:9c85ede8ec58f120bad982ec47746981e210492a6db876882aa021446af8ffba"},
-    {file = "safetensors-0.6.2-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:d6675cf4b39c98dbd7d940598028f3742e0375a6b4d4277e76beb0c35f4b843b"},
-    {file = "safetensors-0.6.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d2d2b3ce1e2509c68932ca03ab8f20570920cd9754b05063d4368ee52833ecd"},
-    {file = "safetensors-0.6.2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:93de35a18f46b0f5a6a1f9e26d91b442094f2df02e9fd7acf224cfec4238821a"},
-    {file = "safetensors-0.6.2-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:89a89b505f335640f9120fac65ddeb83e40f1fd081cb8ed88b505bdccec8d0a1"},
-    {file = "safetensors-0.6.2-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fc4d0d0b937e04bdf2ae6f70cd3ad51328635fe0e6214aa1fc811f3b576b3bda"},
-    {file = "safetensors-0.6.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8045db2c872db8f4cbe3faa0495932d89c38c899c603f21e9b6486951a5ecb8f"},
-    {file = "safetensors-0.6.2-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:81e67e8bab9878bb568cffbc5f5e655adb38d2418351dc0859ccac158f753e19"},
-    {file = "safetensors-0.6.2-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:b0e4d029ab0a0e0e4fdf142b194514695b1d7d3735503ba700cf36d0fc7136ce"},
-    {file = "safetensors-0.6.2-cp38-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:fa48268185c52bfe8771e46325a1e21d317207bcabcb72e65c6e28e9ffeb29c7"},
-    {file = "safetensors-0.6.2-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:d83c20c12c2d2f465997c51b7ecb00e407e5f94d7dec3ea0cc11d86f60d3fde5"},
-    {file = "safetensors-0.6.2-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:d944cea65fad0ead848b6ec2c37cc0b197194bec228f8020054742190e9312ac"},
-    {file = "safetensors-0.6.2-cp38-abi3-win32.whl", hash = "sha256:cab75ca7c064d3911411461151cb69380c9225798a20e712b102edda2542ddb1"},
-    {file = "safetensors-0.6.2-cp38-abi3-win_amd64.whl", hash = "sha256:c7b214870df923cbc1593c3faee16bec59ea462758699bd3fee399d00aac072c"},
-    {file = "safetensors-0.6.2.tar.gz", hash = "sha256:43ff2aa0e6fa2dc3ea5524ac7ad93a9839256b8703761e76e2d0b2a3fa4f15d9"},
-]
-
-[package.extras]
-all = ["safetensors[jax]", "safetensors[numpy]", "safetensors[paddlepaddle]", "safetensors[pinned-tf]", "safetensors[quality]", "safetensors[testing]", "safetensors[torch]"]
-dev = ["safetensors[all]"]
-jax = ["flax (>=0.6.3)", "jax (>=0.3.25)", "jaxlib (>=0.3.25)", "safetensors[numpy]"]
-mlx = ["mlx (>=0.0.9)"]
-numpy = ["numpy (>=1.21.6)"]
-paddlepaddle = ["paddlepaddle (>=2.4.1)", "safetensors[numpy]"]
-pinned-tf = ["safetensors[numpy]", "tensorflow (==2.18.0)"]
-quality = ["ruff"]
-tensorflow = ["safetensors[numpy]", "tensorflow (>=2.11.0)"]
-testing = ["h5py (>=3.7.0)", "huggingface-hub (>=0.12.1)", "hypothesis (>=6.70.2)", "pytest (>=7.2.0)", "pytest-benchmark (>=4.0.0)", "safetensors[numpy]", "setuptools-rust (>=1.5.2)"]
-testingfree = ["huggingface-hub (>=0.12.1)", "hypothesis (>=6.70.2)", "pytest (>=7.2.0)", "pytest-benchmark (>=4.0.0)", "safetensors[numpy]", "setuptools-rust (>=1.5.2)"]
-torch = ["safetensors[numpy]", "torch (>=1.10)"]
-
-[[package]]
-name = "scikit-base"
-version = "0.12.6"
-description = "Base classes for sklearn-like parametric objects"
-optional = false
-python-versions = "<3.14,>=3.9"
-groups = ["main"]
-files = [
-    {file = "scikit_base-0.12.6-py3-none-any.whl", hash = "sha256:68369cf633502e7649c6e029a78e30063154ee2eaccad34a48e19e64272a820f"},
-    {file = "scikit_base-0.12.6.tar.gz", hash = "sha256:553e2bafaf30cd91d873bf424a9d16772d7638ea02ded6fb649b5d4b4c236d14"},
-]
-
-[package.extras]
-all-extras = ["numpy", "pandas"]
-binder = ["jupyter"]
-dev = ["pre-commit", "pytest", "pytest-cov", "scikit-learn (>=0.24.0)"]
-docs = ["Sphinx (!=7.2.0,<9.0.0)", "jupyter", "myst-parser", "nbsphinx (>=0.8.6)", "numpydoc", "pydata-sphinx-theme", "sphinx-design (<0.7.0)", "sphinx-gallery (<0.20.0)", "sphinx-issues (<6.0.0)", "sphinx-panels", "tabulate"]
-linters = ["black", "doc8", "flake8", "flake8-bugbear", "flake8-builtins", "flake8-comprehensions", "flake8-print", "flake8-quotes", "isort", "mypy", "nbqa", "pandas-vet", "pep8-naming", "pydocstyle"]
-test = ["coverage", "numpy", "pandas", "pytest", "pytest-cov", "safety", "scikit-learn (>=0.24.0)", "scipy"]
-
-[[package]]
-name = "scikit-learn"
-version = "1.7.2"
-description = "A set of python modules for machine learning and data mining"
-optional = false
-python-versions = ">=3.10"
-groups = ["main"]
-files = [
-    {file = "scikit_learn-1.7.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b33579c10a3081d076ab403df4a4190da4f4432d443521674637677dc91e61f"},
-    {file = "scikit_learn-1.7.2-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:36749fb62b3d961b1ce4fedf08fa57a1986cd409eff2d783bca5d4b9b5fce51c"},
-    {file = "scikit_learn-1.7.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7a58814265dfc52b3295b1900cfb5701589d30a8bb026c7540f1e9d3499d5ec8"},
-    {file = "scikit_learn-1.7.2-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4a847fea807e278f821a0406ca01e387f97653e284ecbd9750e3ee7c90347f18"},
-    {file = "scikit_learn-1.7.2-cp310-cp310-win_amd64.whl", hash = "sha256:ca250e6836d10e6f402436d6463d6c0e4d8e0234cfb6a9a47835bd392b852ce5"},
-    {file = "scikit_learn-1.7.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7509693451651cd7361d30ce4e86a1347493554f172b1c72a39300fa2aea79e"},
-    {file = "scikit_learn-1.7.2-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:0486c8f827c2e7b64837c731c8feff72c0bd2b998067a8a9cbc10643c31f0fe1"},
-    {file = "scikit_learn-1.7.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:89877e19a80c7b11a2891a27c21c4894fb18e2c2e077815bcade10d34287b20d"},
-    {file = "scikit_learn-1.7.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8da8bf89d4d79aaec192d2bda62f9b56ae4e5b4ef93b6a56b5de4977e375c1f1"},
-    {file = "scikit_learn-1.7.2-cp311-cp311-win_amd64.whl", hash = "sha256:9b7ed8d58725030568523e937c43e56bc01cadb478fc43c042a9aca1dacb3ba1"},
-    {file = "scikit_learn-1.7.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:8d91a97fa2b706943822398ab943cde71858a50245e31bc71dba62aab1d60a96"},
-    {file = "scikit_learn-1.7.2-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:acbc0f5fd2edd3432a22c69bed78e837c70cf896cd7993d71d51ba6708507476"},
-    {file = "scikit_learn-1.7.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e5bf3d930aee75a65478df91ac1225ff89cd28e9ac7bd1196853a9229b6adb0b"},
-    {file = "scikit_learn-1.7.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b4d6e9deed1a47aca9fe2f267ab8e8fe82ee20b4526b2c0cd9e135cea10feb44"},
-    {file = "scikit_learn-1.7.2-cp312-cp312-win_amd64.whl", hash = "sha256:6088aa475f0785e01bcf8529f55280a3d7d298679f50c0bb70a2364a82d0b290"},
-    {file = "scikit_learn-1.7.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0b7dacaa05e5d76759fb071558a8b5130f4845166d88654a0f9bdf3eb57851b7"},
-    {file = "scikit_learn-1.7.2-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:abebbd61ad9e1deed54cca45caea8ad5f79e1b93173dece40bb8e0c658dbe6fe"},
-    {file = "scikit_learn-1.7.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:502c18e39849c0ea1a5d681af1dbcf15f6cce601aebb657aabbfe84133c1907f"},
-    {file = "scikit_learn-1.7.2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7a4c328a71785382fe3fe676a9ecf2c86189249beff90bf85e22bdb7efaf9ae0"},
-    {file = "scikit_learn-1.7.2-cp313-cp313-win_amd64.whl", hash = "sha256:63a9afd6f7b229aad94618c01c252ce9e6fa97918c5ca19c9a17a087d819440c"},
-    {file = "scikit_learn-1.7.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:9acb6c5e867447b4e1390930e3944a005e2cb115922e693c08a323421a6966e8"},
-    {file = "scikit_learn-1.7.2-cp313-cp313t-macosx_12_0_arm64.whl", hash = "sha256:2a41e2a0ef45063e654152ec9d8bcfc39f7afce35b08902bfe290c2498a67a6a"},
-    {file = "scikit_learn-1.7.2-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:98335fb98509b73385b3ab2bd0639b1f610541d3988ee675c670371d6a87aa7c"},
-    {file = "scikit_learn-1.7.2-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:191e5550980d45449126e23ed1d5e9e24b2c68329ee1f691a3987476e115e09c"},
-    {file = "scikit_learn-1.7.2-cp313-cp313t-win_amd64.whl", hash = "sha256:57dc4deb1d3762c75d685507fbd0bc17160144b2f2ba4ccea5dc285ab0d0e973"},
-    {file = "scikit_learn-1.7.2-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:fa8f63940e29c82d1e67a45d5297bdebbcb585f5a5a50c4914cc2e852ab77f33"},
-    {file = "scikit_learn-1.7.2-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:f95dc55b7902b91331fa4e5845dd5bde0580c9cd9612b1b2791b7e80c3d32615"},
-    {file = "scikit_learn-1.7.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:9656e4a53e54578ad10a434dc1f993330568cfee176dff07112b8785fb413106"},
-    {file = "scikit_learn-1.7.2-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96dc05a854add0e50d3f47a1ef21a10a595016da5b007c7d9cd9d0bffd1fcc61"},
-    {file = "scikit_learn-1.7.2-cp314-cp314-win_amd64.whl", hash = "sha256:bb24510ed3f9f61476181e4db51ce801e2ba37541def12dc9333b946fc7a9cf8"},
-    {file = "scikit_learn-1.7.2.tar.gz", hash = "sha256:20e9e49ecd130598f1ca38a1d85090e1a600147b9c02fa6f15d69cb53d968fda"},
-]
-
-[package.dependencies]
-joblib = ">=1.2.0"
-numpy = ">=1.22.0"
-scipy = ">=1.8.0"
-threadpoolctl = ">=3.1.0"
-
-[package.extras]
-benchmark = ["matplotlib (>=3.5.0)", "memory_profiler (>=0.57.0)", "pandas (>=1.4.0)"]
-build = ["cython (>=3.0.10)", "meson-python (>=0.17.1)", "numpy (>=1.22.0)", "scipy (>=1.8.0)"]
-docs = ["Pillow (>=8.4.0)", "matplotlib (>=3.5.0)", "memory_profiler (>=0.57.0)", "numpydoc (>=1.2.0)", "pandas (>=1.4.0)", "plotly (>=5.14.0)", "polars (>=0.20.30)", "pooch (>=1.6.0)", "pydata-sphinx-theme (>=0.15.3)", "scikit-image (>=0.19.0)", "seaborn (>=0.9.0)", "sphinx (>=7.3.7)", "sphinx-copybutton (>=0.5.2)", "sphinx-design (>=0.5.0)", "sphinx-design (>=0.6.0)", "sphinx-gallery (>=0.17.1)", "sphinx-prompt (>=1.4.0)", "sphinx-remove-toctrees (>=1.0.0.post1)", "sphinxcontrib-sass ( [...]
-examples = ["matplotlib (>=3.5.0)", "pandas (>=1.4.0)", "plotly (>=5.14.0)", "pooch (>=1.6.0)", "scikit-image (>=0.19.0)", "seaborn (>=0.9.0)"]
-install = ["joblib (>=1.2.0)", "numpy (>=1.22.0)", "scipy (>=1.8.0)", "threadpoolctl (>=3.1.0)"]
-maintenance = ["conda-lock (==3.0.1)"]
-tests = ["matplotlib (>=3.5.0)", "mypy (>=1.15)", "numpydoc (>=1.2.0)", "pandas (>=1.4.0)", "polars (>=0.20.30)", "pooch (>=1.6.0)", "pyamg (>=4.2.1)", "pyarrow (>=12.0.0)", "pytest (>=7.1.2)", "pytest-cov (>=2.9.0)", "ruff (>=0.11.7)", "scikit-image (>=0.19.0)"]
-
-[[package]]
-name = "scipy"
-version = "1.16.2"
-description = "Fundamental algorithms for scientific computing in Python"
-optional = false
-python-versions = ">=3.11"
-groups = ["main"]
-files = [
-    {file = "scipy-1.16.2-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:6ab88ea43a57da1af33292ebd04b417e8e2eaf9d5aa05700be8d6e1b6501cd92"},
-    {file = "scipy-1.16.2-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:c95e96c7305c96ede73a7389f46ccd6c659c4da5ef1b2789466baeaed3622b6e"},
-    {file = "scipy-1.16.2-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:87eb178db04ece7c698220d523c170125dbffebb7af0345e66c3554f6f60c173"},
-    {file = "scipy-1.16.2-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:4e409eac067dcee96a57fbcf424c13f428037827ec7ee3cb671ff525ca4fc34d"},
-    {file = "scipy-1.16.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:e574be127bb760f0dad24ff6e217c80213d153058372362ccb9555a10fc5e8d2"},
-    {file = "scipy-1.16.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f5db5ba6188d698ba7abab982ad6973265b74bb40a1efe1821b58c87f73892b9"},
-    {file = "scipy-1.16.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:ec6e74c4e884104ae006d34110677bfe0098203a3fec2f3faf349f4cb05165e3"},
-    {file = "scipy-1.16.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:912f46667d2d3834bc3d57361f854226475f695eb08c08a904aadb1c936b6a88"},
-    {file = "scipy-1.16.2-cp311-cp311-win_amd64.whl", hash = "sha256:91e9e8a37befa5a69e9cacbe0bcb79ae5afb4a0b130fd6db6ee6cc0d491695fa"},
-    {file = "scipy-1.16.2-cp311-cp311-win_arm64.whl", hash = "sha256:f3bf75a6dcecab62afde4d1f973f1692be013110cad5338007927db8da73249c"},
-    {file = "scipy-1.16.2-cp312-cp312-macosx_10_14_x86_64.whl", hash = "sha256:89d6c100fa5c48472047632e06f0876b3c4931aac1f4291afc81a3644316bb0d"},
-    {file = "scipy-1.16.2-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:ca748936cd579d3f01928b30a17dc474550b01272d8046e3e1ee593f23620371"},
-    {file = "scipy-1.16.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:fac4f8ce2ddb40e2e3d0f7ec36d2a1e7f92559a2471e59aec37bd8d9de01fec0"},
-    {file = "scipy-1.16.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:033570f1dcefd79547a88e18bccacff025c8c647a330381064f561d43b821232"},
-    {file = "scipy-1.16.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ea3421209bf00c8a5ef2227de496601087d8f638a2363ee09af059bd70976dc1"},
-    {file = "scipy-1.16.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f66bd07ba6f84cd4a380b41d1bf3c59ea488b590a2ff96744845163309ee8e2f"},
-    {file = "scipy-1.16.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5e9feab931bd2aea4a23388c962df6468af3d808ddf2d40f94a81c5dc38f32ef"},
-    {file = "scipy-1.16.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:03dfc75e52f72cf23ec2ced468645321407faad8f0fe7b1f5b49264adbc29cb1"},
-    {file = "scipy-1.16.2-cp312-cp312-win_amd64.whl", hash = "sha256:0ce54e07bbb394b417457409a64fd015be623f36e330ac49306433ffe04bc97e"},
-    {file = "scipy-1.16.2-cp312-cp312-win_arm64.whl", hash = "sha256:2a8ffaa4ac0df81a0b94577b18ee079f13fecdb924df3328fc44a7dc5ac46851"},
-    {file = "scipy-1.16.2-cp313-cp313-macosx_10_14_x86_64.whl", hash = "sha256:84f7bf944b43e20b8a894f5fe593976926744f6c185bacfcbdfbb62736b5cc70"},
-    {file = "scipy-1.16.2-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:5c39026d12edc826a1ef2ad35ad1e6d7f087f934bb868fc43fa3049c8b8508f9"},
-    {file = "scipy-1.16.2-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:e52729ffd45b68777c5319560014d6fd251294200625d9d70fd8626516fc49f5"},
-    {file = "scipy-1.16.2-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:024dd4a118cccec09ca3209b7e8e614931a6ffb804b2a601839499cb88bdf925"},
-    {file = "scipy-1.16.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:7a5dc7ee9c33019973a470556081b0fd3c9f4c44019191039f9769183141a4d9"},
-    {file = "scipy-1.16.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c2275ff105e508942f99d4e3bc56b6ef5e4b3c0af970386ca56b777608ce95b7"},
-    {file = "scipy-1.16.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:af80196eaa84f033e48444d2e0786ec47d328ba00c71e4299b602235ffef9acb"},
-    {file = "scipy-1.16.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9fb1eb735fe3d6ed1f89918224e3385fbf6f9e23757cacc35f9c78d3b712dd6e"},
-    {file = "scipy-1.16.2-cp313-cp313-win_amd64.whl", hash = "sha256:fda714cf45ba43c9d3bae8f2585c777f64e3f89a2e073b668b32ede412d8f52c"},
-    {file = "scipy-1.16.2-cp313-cp313-win_arm64.whl", hash = "sha256:2f5350da923ccfd0b00e07c3e5cfb316c1c0d6c1d864c07a72d092e9f20db104"},
-    {file = "scipy-1.16.2-cp313-cp313t-macosx_10_14_x86_64.whl", hash = "sha256:53d8d2ee29b925344c13bda64ab51785f016b1b9617849dac10897f0701b20c1"},
-    {file = "scipy-1.16.2-cp313-cp313t-macosx_12_0_arm64.whl", hash = "sha256:9e05e33657efb4c6a9d23bd8300101536abd99c85cca82da0bffff8d8764d08a"},
-    {file = "scipy-1.16.2-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:7fe65b36036357003b3ef9d37547abeefaa353b237e989c21027b8ed62b12d4f"},
-    {file = "scipy-1.16.2-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:6406d2ac6d40b861cccf57f49592f9779071655e9f75cd4f977fa0bdd09cb2e4"},
-    {file = "scipy-1.16.2-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ff4dc42bd321991fbf611c23fc35912d690f731c9914bf3af8f417e64aca0f21"},
-    {file = "scipy-1.16.2-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:654324826654d4d9133e10675325708fb954bc84dae6e9ad0a52e75c6b1a01d7"},
-    {file = "scipy-1.16.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:63870a84cd15c44e65220eaed2dac0e8f8b26bbb991456a033c1d9abfe8a94f8"},
-    {file = "scipy-1.16.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:fa01f0f6a3050fa6a9771a95d5faccc8e2f5a92b4a2e5440a0fa7264a2398472"},
-    {file = "scipy-1.16.2-cp313-cp313t-win_amd64.whl", hash = "sha256:116296e89fba96f76353a8579820c2512f6e55835d3fad7780fece04367de351"},
-    {file = "scipy-1.16.2-cp313-cp313t-win_arm64.whl", hash = "sha256:98e22834650be81d42982360382b43b17f7ba95e0e6993e2a4f5b9ad9283a94d"},
-    {file = "scipy-1.16.2-cp314-cp314-macosx_10_14_x86_64.whl", hash = "sha256:567e77755019bb7461513c87f02bb73fb65b11f049aaaa8ca17cfaa5a5c45d77"},
-    {file = "scipy-1.16.2-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:17d9bb346194e8967296621208fcdfd39b55498ef7d2f376884d5ac47cec1a70"},
-    {file = "scipy-1.16.2-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:0a17541827a9b78b777d33b623a6dcfe2ef4a25806204d08ead0768f4e529a88"},
-    {file = "scipy-1.16.2-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:d7d4c6ba016ffc0f9568d012f5f1eb77ddd99412aea121e6fa8b4c3b7cbad91f"},
-    {file = "scipy-1.16.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9702c4c023227785c779cba2e1d6f7635dbb5b2e0936cdd3a4ecb98d78fd41eb"},
-    {file = "scipy-1.16.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d1cdf0ac28948d225decdefcc45ad7dd91716c29ab56ef32f8e0d50657dffcc7"},
-    {file = "scipy-1.16.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:70327d6aa572a17c2941cdfb20673f82e536e91850a2e4cb0c5b858b690e1548"},
-    {file = "scipy-1.16.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5221c0b2a4b58aa7c4ed0387d360fd90ee9086d383bb34d9f2789fafddc8a936"},
-    {file = "scipy-1.16.2-cp314-cp314-win_amd64.whl", hash = "sha256:f5a85d7b2b708025af08f060a496dd261055b617d776fc05a1a1cc69e09fe9ff"},
-    {file = "scipy-1.16.2-cp314-cp314-win_arm64.whl", hash = "sha256:2cc73a33305b4b24556957d5857d6253ce1e2dcd67fa0ff46d87d1670b3e1e1d"},
-    {file = "scipy-1.16.2-cp314-cp314t-macosx_10_14_x86_64.whl", hash = "sha256:9ea2a3fed83065d77367775d689401a703d0f697420719ee10c0780bcab594d8"},
-    {file = "scipy-1.16.2-cp314-cp314t-macosx_12_0_arm64.whl", hash = "sha256:7280d926f11ca945c3ef92ba960fa924e1465f8d07ce3a9923080363390624c4"},
-    {file = "scipy-1.16.2-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:8afae1756f6a1fe04636407ef7dbece33d826a5d462b74f3d0eb82deabefd831"},
-    {file = "scipy-1.16.2-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:5c66511f29aa8d233388e7416a3f20d5cae7a2744d5cee2ecd38c081f4e861b3"},
-    {file = "scipy-1.16.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:efe6305aeaa0e96b0ccca5ff647a43737d9a092064a3894e46c414db84bc54ac"},
-    {file = "scipy-1.16.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7f3a337d9ae06a1e8d655ee9d8ecb835ea5ddcdcbd8d23012afa055ab014f374"},
-    {file = "scipy-1.16.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bab3605795d269067d8ce78a910220262711b753de8913d3deeaedb5dded3bb6"},
-    {file = "scipy-1.16.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b0348d8ddb55be2a844c518cd8cc8deeeb8aeba707cf834db5758fc89b476a2c"},
-    {file = "scipy-1.16.2-cp314-cp314t-win_amd64.whl", hash = "sha256:26284797e38b8a75e14ea6631d29bda11e76ceaa6ddb6fdebbfe4c4d90faf2f9"},
-    {file = "scipy-1.16.2-cp314-cp314t-win_arm64.whl", hash = "sha256:d2a4472c231328d4de38d5f1f68fdd6d28a615138f842580a8a321b5845cf779"},
-    {file = "scipy-1.16.2.tar.gz", hash = "sha256:af029b153d243a80afb6eabe40b0a07f8e35c9adc269c019f364ad747f826a6b"},
-]
-
-[package.dependencies]
-numpy = ">=1.25.2,<2.6"
-
-[package.extras]
-dev = ["cython-lint (>=0.12.2)", "doit (>=0.36.0)", "mypy (==1.10.0)", "pycodestyle", "pydevtool", "rich-click", "ruff (>=0.0.292)", "types-psutil", "typing_extensions"]
-doc = ["intersphinx_registry", "jupyterlite-pyodide-kernel", "jupyterlite-sphinx (>=0.19.1)", "jupytext", "linkify-it-py", "matplotlib (>=3.5)", "myst-nb (>=1.2.0)", "numpydoc", "pooch", "pydata-sphinx-theme (>=0.15.2)", "sphinx (>=5.0.0,<8.2.0)", "sphinx-copybutton", "sphinx-design (>=0.4.0)"]
-test = ["Cython", "array-api-strict (>=2.3.1)", "asv", "gmpy2", "hypothesis (>=6.30)", "meson", "mpmath", "ninja ; sys_platform != \"emscripten\"", "pooch", "pytest (>=8.0.0)", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"]
-
-[[package]]
-name = "setuptools"
-version = "80.9.0"
-description = "Easily download, build, install, upgrade, and uninstall Python packages"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "setuptools-80.9.0-py3-none-any.whl", hash = "sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922"},
-    {file = "setuptools-80.9.0.tar.gz", hash = "sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c"},
-]
-
-[package.extras]
-check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\"", "ruff (>=0.8.0) ; sys_platform != \"cygwin\""]
-core = ["importlib_metadata (>=6) ; python_version < \"3.10\"", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1) ; python_version < \"3.11\"", "wheel (>=0.43.0)"]
-cover = ["pytest-cov"]
-doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"]
-enabler = ["pytest-enabler (>=2.2)"]
-test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21) ; python_version >= \"3.9\" and sys_platform != \"cygwin\"", "jaraco.envs (>=2.2)", "jaraco.path (>=3.7.2)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf ; sys_platform != \"cygwin\"", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtuale [...]
-type = ["importlib_metadata (>=7.0.2) ; python_version < \"3.10\"", "jaraco.develop (>=7.21) ; sys_platform != \"cygwin\"", "mypy (==1.14.*)", "pytest-mypy"]
-
-[[package]]
-name = "six"
-version = "1.17.0"
-description = "Python 2 and 3 compatibility utilities"
-optional = false
-python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
-groups = ["main"]
-files = [
-    {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"},
-    {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"},
-]
-
-[[package]]
-name = "sktime"
-version = "0.38.5"
-description = "A unified framework for machine learning with time series"
-optional = false
-python-versions = "<3.14,>=3.9"
-groups = ["main"]
-files = [
-    {file = "sktime-0.38.5-py3-none-any.whl", hash = "sha256:5419ce29ae0d20a40124325c30e40d5a339cc1bfba74080912c3cee45aa8e347"},
-    {file = "sktime-0.38.5.tar.gz", hash = "sha256:0e110aa440ca0baafaf21ae23f1edf22d1c7a289254d9d99e81979580055a955"},
-]
-
-[package.dependencies]
-joblib = ">=1.2.0,<1.6"
-numpy = ">=1.21,<2.4"
-packaging = "*"
-pandas = ">=1.1,<2.4.0"
-scikit-base = ">=0.6.1,<0.13.0"
-scikit-learn = ">=0.24,<1.8.0"
-scipy = ">=1.2,<2.0.0"
-
-[package.extras]
-alignment = ["dtaidistance (<2.4) ; python_version < \"3.13\"", "dtw-python (>=1.3,<1.6) ; python_version < \"3.13\"", "numba (>=0.53,<0.62) ; python_version < \"3.13\""]
-all-extras = ["arch (>=5.6,<7.3.0) ; python_version < \"3.13\"", "autots (>=0.6.1,<0.7)", "cloudpickle ; python_version < \"3.13\"", "dash (!=2.9.0) ; python_version < \"3.13\"", "dask (>2024.8.2,<2025.2.1) ; python_version < \"3.13\"", "dtaidistance (<2.4) ; python_version < \"3.13\"", "dtw-python ; python_version < \"3.13\"", "filterpy (>=1.4.5) ; python_version < \"3.11\"", "gluonts (>=0.9) ; python_version < \"3.13\"", "h5py ; python_version < \"3.12\"", "hmmlearn (>=0.2.7) ; python_ [...]
-all-extras-pandas2 = ["arch (>=5.6,<7.1.0) ; python_version < \"3.13\"", "autots (>=0.6.1,<0.7) ; python_version < \"3.13\"", "cloudpickle ; python_version < \"3.13\"", "dash (!=2.9.0) ; python_version < \"3.13\"", "dask (>2024.8.2,<2025.2.1) ; python_version < \"3.13\"", "dtaidistance (<2.4) ; python_version < \"3.13\"", "dtw-python ; python_version < \"3.13\"", "filterpy (>=1.4.5) ; python_version < \"3.11\"", "gluonts (>=0.9) ; python_version < \"3.13\"", "h5py ; python_version < \"3. [...]
-annotation = ["hmmlearn (>=0.2.7,<0.4) ; python_version < \"3.13\"", "numba (>=0.53,<0.62) ; python_version < \"3.13\"", "pyod (>=0.8,<1.2) ; python_version < \"3.12\""]
-binder = ["jupyter", "skchange"]
-classification = ["numba (>=0.53,<0.62) ; python_version < \"3.13\"", "tensorflow (>=2,<2.20) ; python_version < \"3.13\"", "tsfresh (>=0.17,<0.21) ; python_version < \"3.12\""]
-clustering = ["networkx (<3.5)", "numba (>=0.53,<0.62) ; python_version < \"3.13\"", "ts2vg (<1.3) ; python_version < \"3.13\" and platform_machine != \"aarch64\"", "tslearn (>=0.5.2,!=0.6.0,<0.7.0) ; python_version < \"3.12\""]
-compatibility-tests = ["catboost ; python_version < \"3.13\""]
-cython-extras = ["mrseql (<0.0.3)", "mrsqm ; python_version < \"3.11\"", "numba (<0.62)"]
-dataframe = ["dask (>2024.8.2,<2025.2.1) ; python_version < \"3.13\"", "dask (>2024.8.2,<2025.2.1) ; python_version < \"3.13\""]
-datasets = ["huggingface-hub", "rdata", "requests"]
-dependencies-lower = ["numpy (==1.25.0)", "pandas (==2.0.2)", "scikit-learn (==1.3.0)", "scipy (==1.10.1)"]
-dependencies-lowest = ["numpy (==1.21.0)", "pandas (==1.1.0)", "scikit-learn (==0.24.0)", "scipy (==1.4.0)"]
-detection = ["hmmlearn (>=0.2.7,<0.4) ; python_version < \"3.13\"", "numba (>=0.53,<0.62) ; python_version < \"3.13\"", "pyod (>=0.8,<1.2) ; python_version < \"3.12\""]
-dev = ["backoff", "httpx", "pre-commit", "pytest", "pytest-randomly", "pytest-timeout", "pytest-xdist", "wheel"]
-dl = ["FrEIA ; python_version < \"3.12\"", "accelerate", "einops (>0.7.0) ; python_version < \"3.12\"", "gluonts (>=0.14.3) ; python_version < \"3.12\"", "huggingface-hub (>=0.23.0) ; python_version < \"3.12\"", "hydra-core ; python_version < \"3.13\"", "lightning (>=2.0) ; python_version < \"3.12\"", "neuralforecast (>=1.6.4,<1.8.0) ; python_version < \"3.11\"", "peft (>=0.10.0,<0.14.0) ; python_version < \"3.12\"", "pykan (>=0.2.1,<0.2.9) ; python_version > \"3.9.7\"", "pytorch-forecas [...]
-docs = ["Sphinx (!=7.2.0,<9.0.0)", "jupyter", "myst-parser", "nbsphinx (>=0.8.6)", "numpydoc", "pydata-sphinx-theme", "sphinx-copybutton", "sphinx-design (<0.7.0)", "sphinx-gallery (<0.20.0)", "sphinx-issues (<6.0.0)", "tabulate"]
-forecasting = ["arch (>=5.6,<7.1) ; python_version < \"3.13\"", "autots (>=0.6.1,<0.7) ; python_version < \"3.13\"", "pmdarima (>=1.8,!=1.8.1,<2.1) ; python_version < \"3.12\"", "prophet (>=1.1,<1.2) ; python_version < \"3.13\"", "skforecast (>=0.12.1,<0.15) ; python_version < \"3.13\"", "skpro (>=2,<2.10.0)", "statsforecast (>=1.0.0,<2.1.0) ; python_version < \"3.13\"", "statsmodels (>=0.12.1,<0.15) ; python_version < \"3.13\"", "tbats (>=1.1,<1.2) ; python_version < \"3.12\""]
-mlflow = ["mlflow (<4.0)"]
-mlflow-tests = ["boto3", "botocore", "mlflow (<4.0)", "moto"]
-mlflow2 = ["mlflow (<3.0)"]
-networks = ["tensorflow (>=2,<2.20) ; python_version < \"3.13\""]
-notebooks = ["dtw-python", "matplotlib", "numpy (<2)", "pmdarima", "prophet", "pytorch-forecasting", "seaborn", "skpro", "statsforecast", "tbats"]
-numpy1 = ["numpy (<2.0.0)"]
-pandas1 = ["pandas (<2.0.0)"]
-param-est = ["seasonal (>=0.3.1,<0.4) ; python_version < \"3.13\"", "statsmodels (>=0.12.1,<0.15) ; python_version < \"3.13\""]
-regression = ["numba (>=0.53,<0.62) ; python_version < \"3.13\"", "tensorflow (>=2,<2.20) ; python_version < \"3.13\""]
-tests = ["pytest (>=7.4,<8.5)", "pytest-randomly (>=3.15,<3.17)", "pytest-timeout (>=2.1,<2.5)", "pytest-xdist (>=3.3,<3.9)"]
-transformations = ["filterpy (>=1.4.5,<1.5) ; python_version < \"3.13\"", "holidays (>=0.29,<0.59) ; python_version < \"3.13\"", "mne (>=1.5,<1.9) ; python_version < \"3.13\"", "numba (>=0.53,<0.62) ; python_version < \"3.13\"", "pycatch22 (>=0.4,<0.4.6) ; python_version < \"3.13\"", "simdkalman", "statsmodels (>=0.12.1,<0.15) ; python_version < \"3.13\"", "stumpy (>=1.5.1,<1.13) ; python_version < \"3.12\"", "tsfresh (>=0.17,<0.21) ; python_version < \"3.12\""]
-
-[[package]]
-name = "sqlalchemy"
-version = "2.0.43"
-description = "Database Abstraction Library"
-optional = false
-python-versions = ">=3.7"
-groups = ["main"]
-files = [
-    {file = "SQLAlchemy-2.0.43-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:21ba7a08a4253c5825d1db389d4299f64a100ef9800e4624c8bf70d8f136e6ed"},
-    {file = "SQLAlchemy-2.0.43-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:11b9503fa6f8721bef9b8567730f664c5a5153d25e247aadc69247c4bc605227"},
-    {file = "SQLAlchemy-2.0.43-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07097c0a1886c150ef2adba2ff7437e84d40c0f7dcb44a2c2b9c905ccfc6361c"},
-    {file = "SQLAlchemy-2.0.43-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:cdeff998cb294896a34e5b2f00e383e7c5c4ef3b4bfa375d9104723f15186443"},
-    {file = "SQLAlchemy-2.0.43-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:bcf0724a62a5670e5718957e05c56ec2d6850267ea859f8ad2481838f889b42c"},
-    {file = "SQLAlchemy-2.0.43-cp37-cp37m-win32.whl", hash = "sha256:c697575d0e2b0a5f0433f679bda22f63873821d991e95a90e9e52aae517b2e32"},
-    {file = "SQLAlchemy-2.0.43-cp37-cp37m-win_amd64.whl", hash = "sha256:d34c0f6dbefd2e816e8f341d0df7d4763d382e3f452423e752ffd1e213da2512"},
-    {file = "sqlalchemy-2.0.43-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:70322986c0c699dca241418fcf18e637a4369e0ec50540a2b907b184c8bca069"},
-    {file = "sqlalchemy-2.0.43-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:87accdbba88f33efa7b592dc2e8b2a9c2cdbca73db2f9d5c510790428c09c154"},
-    {file = "sqlalchemy-2.0.43-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c00e7845d2f692ebfc7d5e4ec1a3fd87698e4337d09e58d6749a16aedfdf8612"},
-    {file = "sqlalchemy-2.0.43-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:022e436a1cb39b13756cf93b48ecce7aa95382b9cfacceb80a7d263129dfd019"},
-    {file = "sqlalchemy-2.0.43-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c5e73ba0d76eefc82ec0219d2301cb33bfe5205ed7a2602523111e2e56ccbd20"},
-    {file = "sqlalchemy-2.0.43-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:9c2e02f06c68092b875d5cbe4824238ab93a7fa35d9c38052c033f7ca45daa18"},
-    {file = "sqlalchemy-2.0.43-cp310-cp310-win32.whl", hash = "sha256:e7a903b5b45b0d9fa03ac6a331e1c1d6b7e0ab41c63b6217b3d10357b83c8b00"},
-    {file = "sqlalchemy-2.0.43-cp310-cp310-win_amd64.whl", hash = "sha256:4bf0edb24c128b7be0c61cd17eef432e4bef507013292415f3fb7023f02b7d4b"},
-    {file = "sqlalchemy-2.0.43-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:52d9b73b8fb3e9da34c2b31e6d99d60f5f99fd8c1225c9dad24aeb74a91e1d29"},
-    {file = "sqlalchemy-2.0.43-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f42f23e152e4545157fa367b2435a1ace7571cab016ca26038867eb7df2c3631"},
-    {file = "sqlalchemy-2.0.43-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fb1a8c5438e0c5ea51afe9c6564f951525795cf432bed0c028c1cb081276685"},
-    {file = "sqlalchemy-2.0.43-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db691fa174e8f7036afefe3061bc40ac2b770718be2862bfb03aabae09051aca"},
-    {file = "sqlalchemy-2.0.43-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:fe2b3b4927d0bc03d02ad883f402d5de201dbc8894ac87d2e981e7d87430e60d"},
-    {file = "sqlalchemy-2.0.43-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4d3d9b904ad4a6b175a2de0738248822f5ac410f52c2fd389ada0b5262d6a1e3"},
-    {file = "sqlalchemy-2.0.43-cp311-cp311-win32.whl", hash = "sha256:5cda6b51faff2639296e276591808c1726c4a77929cfaa0f514f30a5f6156921"},
-    {file = "sqlalchemy-2.0.43-cp311-cp311-win_amd64.whl", hash = "sha256:c5d1730b25d9a07727d20ad74bc1039bbbb0a6ca24e6769861c1aa5bf2c4c4a8"},
-    {file = "sqlalchemy-2.0.43-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:20d81fc2736509d7a2bd33292e489b056cbae543661bb7de7ce9f1c0cd6e7f24"},
-    {file = "sqlalchemy-2.0.43-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:25b9fc27650ff5a2c9d490c13c14906b918b0de1f8fcbb4c992712d8caf40e83"},
-    {file = "sqlalchemy-2.0.43-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6772e3ca8a43a65a37c88e2f3e2adfd511b0b1da37ef11ed78dea16aeae85bd9"},
-    {file = "sqlalchemy-2.0.43-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a113da919c25f7f641ffbd07fbc9077abd4b3b75097c888ab818f962707eb48"},
-    {file = "sqlalchemy-2.0.43-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4286a1139f14b7d70141c67a8ae1582fc2b69105f1b09d9573494eb4bb4b2687"},
-    {file = "sqlalchemy-2.0.43-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:529064085be2f4d8a6e5fab12d36ad44f1909a18848fcfbdb59cc6d4bbe48efe"},
-    {file = "sqlalchemy-2.0.43-cp312-cp312-win32.whl", hash = "sha256:b535d35dea8bbb8195e7e2b40059e2253acb2b7579b73c1b432a35363694641d"},
-    {file = "sqlalchemy-2.0.43-cp312-cp312-win_amd64.whl", hash = "sha256:1c6d85327ca688dbae7e2b06d7d84cfe4f3fffa5b5f9e21bb6ce9d0e1a0e0e0a"},
-    {file = "sqlalchemy-2.0.43-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e7c08f57f75a2bb62d7ee80a89686a5e5669f199235c6d1dac75cd59374091c3"},
-    {file = "sqlalchemy-2.0.43-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:14111d22c29efad445cd5021a70a8b42f7d9152d8ba7f73304c4d82460946aaa"},
-    {file = "sqlalchemy-2.0.43-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21b27b56eb2f82653168cefe6cb8e970cdaf4f3a6cb2c5e3c3c1cf3158968ff9"},
-    {file = "sqlalchemy-2.0.43-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c5a9da957c56e43d72126a3f5845603da00e0293720b03bde0aacffcf2dc04f"},
-    {file = "sqlalchemy-2.0.43-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:5d79f9fdc9584ec83d1b3c75e9f4595c49017f5594fee1a2217117647225d738"},
-    {file = "sqlalchemy-2.0.43-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9df7126fd9db49e3a5a3999442cc67e9ee8971f3cb9644250107d7296cb2a164"},
-    {file = "sqlalchemy-2.0.43-cp313-cp313-win32.whl", hash = "sha256:7f1ac7828857fcedb0361b48b9ac4821469f7694089d15550bbcf9ab22564a1d"},
-    {file = "sqlalchemy-2.0.43-cp313-cp313-win_amd64.whl", hash = "sha256:971ba928fcde01869361f504fcff3b7143b47d30de188b11c6357c0505824197"},
-    {file = "sqlalchemy-2.0.43-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:4e6aeb2e0932f32950cf56a8b4813cb15ff792fc0c9b3752eaf067cfe298496a"},
-    {file = "sqlalchemy-2.0.43-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:61f964a05356f4bca4112e6334ed7c208174511bd56e6b8fc86dad4d024d4185"},
-    {file = "sqlalchemy-2.0.43-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:46293c39252f93ea0910aababa8752ad628bcce3a10d3f260648dd472256983f"},
-    {file = "sqlalchemy-2.0.43-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:136063a68644eca9339d02e6693932116f6a8591ac013b0014479a1de664e40a"},
-    {file = "sqlalchemy-2.0.43-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:6e2bf13d9256398d037fef09fd8bf9b0bf77876e22647d10761d35593b9ac547"},
-    {file = "sqlalchemy-2.0.43-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:44337823462291f17f994d64282a71c51d738fc9ef561bf265f1d0fd9116a782"},
-    {file = "sqlalchemy-2.0.43-cp38-cp38-win32.whl", hash = "sha256:13194276e69bb2af56198fef7909d48fd34820de01d9c92711a5fa45497cc7ed"},
-    {file = "sqlalchemy-2.0.43-cp38-cp38-win_amd64.whl", hash = "sha256:334f41fa28de9f9be4b78445e68530da3c5fa054c907176460c81494f4ae1f5e"},
-    {file = "sqlalchemy-2.0.43-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ceb5c832cc30663aeaf5e39657712f4c4241ad1f638d487ef7216258f6d41fe7"},
-    {file = "sqlalchemy-2.0.43-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:11f43c39b4b2ec755573952bbcc58d976779d482f6f832d7f33a8d869ae891bf"},
-    {file = "sqlalchemy-2.0.43-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:413391b2239db55be14fa4223034d7e13325a1812c8396ecd4f2c08696d5ccad"},
-    {file = "sqlalchemy-2.0.43-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c379e37b08c6c527181a397212346be39319fb64323741d23e46abd97a400d34"},
-    {file = "sqlalchemy-2.0.43-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:03d73ab2a37d9e40dec4984d1813d7878e01dbdc742448d44a7341b7a9f408c7"},
-    {file = "sqlalchemy-2.0.43-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:8cee08f15d9e238ede42e9bbc1d6e7158d0ca4f176e4eab21f88ac819ae3bd7b"},
-    {file = "sqlalchemy-2.0.43-cp39-cp39-win32.whl", hash = "sha256:b3edaec7e8b6dc5cd94523c6df4f294014df67097c8217a89929c99975811414"},
-    {file = "sqlalchemy-2.0.43-cp39-cp39-win_amd64.whl", hash = "sha256:227119ce0a89e762ecd882dc661e0aa677a690c914e358f0dd8932a2e8b2765b"},
-    {file = "sqlalchemy-2.0.43-py3-none-any.whl", hash = "sha256:1681c21dd2ccee222c2fe0bef671d1aef7c504087c9c4e800371cfcc8ac966fc"},
-    {file = "sqlalchemy-2.0.43.tar.gz", hash = "sha256:788bfcef6787a7764169cfe9859fe425bf44559619e1d9f56f5bddf2ebf6f417"},
-]
-
-[package.dependencies]
-greenlet = {version = ">=1", markers = "python_version < \"3.14\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"}
-typing-extensions = ">=4.6.0"
-
-[package.extras]
-aiomysql = ["aiomysql (>=0.2.0)", "greenlet (>=1)"]
-aioodbc = ["aioodbc", "greenlet (>=1)"]
-aiosqlite = ["aiosqlite", "greenlet (>=1)", "typing_extensions (!=3.10.0.1)"]
-asyncio = ["greenlet (>=1)"]
-asyncmy = ["asyncmy (>=0.2.3,!=0.2.4,!=0.2.6)", "greenlet (>=1)"]
-mariadb-connector = ["mariadb (>=1.0.1,!=1.1.2,!=1.1.5,!=1.1.10)"]
-mssql = ["pyodbc"]
-mssql-pymssql = ["pymssql"]
-mssql-pyodbc = ["pyodbc"]
-mypy = ["mypy (>=0.910)"]
-mysql = ["mysqlclient (>=1.4.0)"]
-mysql-connector = ["mysql-connector-python"]
-oracle = ["cx_oracle (>=8)"]
-oracle-oracledb = ["oracledb (>=1.0.1)"]
-postgresql = ["psycopg2 (>=2.7)"]
-postgresql-asyncpg = ["asyncpg", "greenlet (>=1)"]
-postgresql-pg8000 = ["pg8000 (>=1.29.1)"]
-postgresql-psycopg = ["psycopg (>=3.0.7)"]
-postgresql-psycopg2binary = ["psycopg2-binary"]
-postgresql-psycopg2cffi = ["psycopg2cffi"]
-postgresql-psycopgbinary = ["psycopg[binary] (>=3.0.7)"]
-pymysql = ["pymysql"]
-sqlcipher = ["sqlcipher3_binary"]
-
-[[package]]
-name = "statsmodels"
-version = "0.14.5"
-description = "Statistical computations and models for Python"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "statsmodels-0.14.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9fc2b5cdc0c95cba894849651fec1fa1511d365e3eb72b0cc75caac44077cd48"},
-    {file = "statsmodels-0.14.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b8d96b0bbaeabd3a557c35cc7249baa9cfbc6dd305c32a9f2cbdd7f46c037e7f"},
-    {file = "statsmodels-0.14.5-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:145bc39b2cb201efb6c83cc3f2163c269e63b0d4809801853dec6f440bd3bc37"},
-    {file = "statsmodels-0.14.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d7c14fb2617bb819fb2532e1424e1da2b98a3419a80e95f33365a72d437d474e"},
-    {file = "statsmodels-0.14.5-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1e9742d8a5ac38a3bfc4b7f4b0681903920f20cbbf466d72b1fd642033846108"},
-    {file = "statsmodels-0.14.5-cp310-cp310-win_amd64.whl", hash = "sha256:1cab9e6fce97caf4239cdb2df375806937da5d0b7ba2699b13af33a07f438464"},
-    {file = "statsmodels-0.14.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4b7091a8442076c708c926de3603653a160955e80a2b6d931475b7bb8ddc02e5"},
-    {file = "statsmodels-0.14.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:128872be8f3208f4446d91ea9e4261823902fc7997fee7e1a983eb62fd3b7c6e"},
-    {file = "statsmodels-0.14.5-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f2ad5aee04ae7196c429df2174df232c057e478c5fa63193d01c8ec9aae04d31"},
-    {file = "statsmodels-0.14.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f402fc793458dd6d96e099acb44cd1de1428565bf7ef3030878a8daff091f08a"},
-    {file = "statsmodels-0.14.5-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:26c028832730aebfbfd4e7501694e1f9ad31ec8536e776716673f4e7afd4059a"},
-    {file = "statsmodels-0.14.5-cp311-cp311-win_amd64.whl", hash = "sha256:ec56f771d9529cdc17ed2fb2a950d100b6e83a7c5372aae8ac5bb065c474b856"},
-    {file = "statsmodels-0.14.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:37e7364a39f9aa3b51d15a208c2868b90aadb8412f868530f5cba9197cb00eaa"},
-    {file = "statsmodels-0.14.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4263d7f4d0f1d5ac6eb4db22e1ee34264a14d634b9332c975c9d9109b6b46e12"},
-    {file = "statsmodels-0.14.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:86224f6e36f38486e471e75759d241fe2912d8bc25ab157d54ee074c6aedbf45"},
-    {file = "statsmodels-0.14.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c3dd760a6fa80cd5e0371685c697bb9c2c0e6e1f394d975e596a1e6d0bbb9372"},
-    {file = "statsmodels-0.14.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:6264fb00e02f858b86bd01ef2dc05055a71d4a0cc7551b9976b07b0f0e6cf24f"},
-    {file = "statsmodels-0.14.5-cp312-cp312-win_amd64.whl", hash = "sha256:b2ed065bfbaf8bb214c7201656df840457c2c8c65e1689e3eb09dc7440f9c61c"},
-    {file = "statsmodels-0.14.5-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:906263134dd1a640e55ecb01fda4a9be7b9e08558dba9e4c4943a486fdb0c9c8"},
-    {file = "statsmodels-0.14.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9118f76344f77cffbb3a9cbcff8682b325be5eed54a4b3253e09da77a74263d3"},
-    {file = "statsmodels-0.14.5-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9dc4ee159070557c9a6c000625d85f653de437772fe7086857cff68f501afe45"},
-    {file = "statsmodels-0.14.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a085d47c8ef5387279a991633883d0e700de2b0acc812d7032d165888627bef"},
-    {file = "statsmodels-0.14.5-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9f866b2ebb2904b47c342d00def83c526ef2eb1df6a9a3c94ba5fe63d0005aec"},
-    {file = "statsmodels-0.14.5-cp313-cp313-win_amd64.whl", hash = "sha256:2a06bca03b7a492f88c8106103ab75f1a5ced25de90103a89f3a287518017939"},
-    {file = "statsmodels-0.14.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b23b8f646dd78ef5e8d775d879208f8dc0a73418b41c16acac37361ff9ab7738"},
-    {file = "statsmodels-0.14.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4e5e26b21d2920905764fb0860957d08b5ba2fae4466ef41b1f7c53ecf9fc7fa"},
-    {file = "statsmodels-0.14.5-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4a060c7e0841c549c8ce2825fd6687e6757e305d9c11c9a73f6c5a0ce849bb69"},
-    {file = "statsmodels-0.14.5-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:56da20def5350d676388213a330fd40ed15d0e8dd0bb1b92c0e4b0f2a65d3ad2"},
-    {file = "statsmodels-0.14.5-cp39-cp39-win_amd64.whl", hash = "sha256:afb37ca1d70d99b5fd876e8574ea46372298ae0f0a8b17e4cf0a9afd2373ae62"},
-    {file = "statsmodels-0.14.5.tar.gz", hash = "sha256:de260e58cccfd2ceddf835b55a357233d6ca853a1aa4f90f7553a52cc71c6ddf"},
-]
-
-[package.dependencies]
-numpy = ">=1.22.3,<3"
-packaging = ">=21.3"
-pandas = ">=1.4,<2.1.0 || >2.1.0"
-patsy = ">=0.5.6"
-scipy = ">=1.8,<1.9.2 || >1.9.2"
-
-[package.extras]
-build = ["cython (>=3.0.10)"]
-develop = ["colorama", "cython (>=3.0.10)", "cython (>=3.0.10,<4)", "flake8", "isort", "jinja2", "joblib", "matplotlib (>=3)", "pytest (>=7.3.0,<8)", "pytest-cov", "pytest-randomly", "pytest-xdist", "pywinpty ; os_name == \"nt\"", "setuptools_scm[toml] (>=8.0,<9.0)"]
-docs = ["ipykernel", "jupyter_client", "matplotlib", "nbconvert", "nbformat", "numpydoc", "pandas-datareader", "sphinx"]
-
-[[package]]
-name = "sympy"
-version = "1.14.0"
-description = "Computer algebra system (CAS) in Python"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5"},
-    {file = "sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517"},
-]
-
-[package.dependencies]
-mpmath = ">=1.1.0,<1.4"
-
-[package.extras]
-dev = ["hypothesis (>=6.70.0)", "pytest (>=7.1.0)"]
-
-[[package]]
-name = "threadpoolctl"
-version = "3.6.0"
-description = "threadpoolctl"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "threadpoolctl-3.6.0-py3-none-any.whl", hash = "sha256:43a0b8fd5a2928500110039e43a5eed8480b918967083ea48dc3ab9f13c4a7fb"},
-    {file = "threadpoolctl-3.6.0.tar.gz", hash = "sha256:8ab8b4aa3491d812b623328249fab5302a68d2d71745c8a4c719a2fcaba9f44e"},
-]
-
-[[package]]
-name = "thrift"
-version = "0.22.0"
-description = "Python bindings for the Apache Thrift RPC system"
-optional = false
-python-versions = "*"
-groups = ["main"]
-files = [
-    {file = "thrift-0.22.0.tar.gz", hash = "sha256:42e8276afbd5f54fe1d364858b6877bc5e5a4a5ed69f6a005b94ca4918fe1466"},
-]
-
-[package.extras]
-all = ["tornado (>=4.0)", "twisted"]
-tornado = ["tornado (>=4.0)"]
-twisted = ["twisted"]
-
-[[package]]
-name = "tokenizers"
-version = "0.22.1"
-description = ""
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "tokenizers-0.22.1-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:59fdb013df17455e5f950b4b834a7b3ee2e0271e6378ccb33aa74d178b513c73"},
-    {file = "tokenizers-0.22.1-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:8d4e484f7b0827021ac5f9f71d4794aaef62b979ab7608593da22b1d2e3c4edc"},
-    {file = "tokenizers-0.22.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:19d2962dd28bc67c1f205ab180578a78eef89ac60ca7ef7cbe9635a46a56422a"},
-    {file = "tokenizers-0.22.1-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:38201f15cdb1f8a6843e6563e6e79f4abd053394992b9bbdf5213ea3469b4ae7"},
-    {file = "tokenizers-0.22.1-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d1cbe5454c9a15df1b3443c726063d930c16f047a3cc724b9e6e1a91140e5a21"},
-    {file = "tokenizers-0.22.1-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e7d094ae6312d69cc2a872b54b91b309f4f6fbce871ef28eb27b52a98e4d0214"},
-    {file = "tokenizers-0.22.1-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:afd7594a56656ace95cdd6df4cca2e4059d294c5cfb1679c57824b605556cb2f"},
-    {file = "tokenizers-0.22.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2ef6063d7a84994129732b47e7915e8710f27f99f3a3260b8a38fc7ccd083f4"},
-    {file = "tokenizers-0.22.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:ba0a64f450b9ef412c98f6bcd2a50c6df6e2443b560024a09fa6a03189726879"},
-    {file = "tokenizers-0.22.1-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:331d6d149fa9c7d632cde4490fb8bbb12337fa3a0232e77892be656464f4b446"},
-    {file = "tokenizers-0.22.1-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:607989f2ea68a46cb1dfbaf3e3aabdf3f21d8748312dbeb6263d1b3b66c5010a"},
-    {file = "tokenizers-0.22.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a0f307d490295717726598ef6fa4f24af9d484809223bbc253b201c740a06390"},
-    {file = "tokenizers-0.22.1-cp39-abi3-win32.whl", hash = "sha256:b5120eed1442765cd90b903bb6cfef781fd8fe64e34ccaecbae4c619b7b12a82"},
-    {file = "tokenizers-0.22.1-cp39-abi3-win_amd64.whl", hash = "sha256:65fd6e3fb11ca1e78a6a93602490f134d1fdeb13bcef99389d5102ea318ed138"},
-    {file = "tokenizers-0.22.1.tar.gz", hash = "sha256:61de6522785310a309b3407bac22d99c4db5dba349935e99e4d15ea2226af2d9"},
-]
-
-[package.dependencies]
-huggingface-hub = ">=0.16.4,<2.0"
-
-[package.extras]
-dev = ["tokenizers[testing]"]
-docs = ["setuptools-rust", "sphinx", "sphinx-rtd-theme"]
-testing = ["black (==22.3)", "datasets", "numpy", "pytest", "pytest-asyncio", "requests", "ruff"]
-
-[[package]]
-name = "torch"
-version = "2.8.0"
-description = "Tensors and Dynamic neural networks in Python with strong GPU acceleration"
-optional = false
-python-versions = ">=3.9.0"
-groups = ["main"]
-files = [
-    {file = "torch-2.8.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:0be92c08b44009d4131d1ff7a8060d10bafdb7ddcb7359ef8d8c5169007ea905"},
-    {file = "torch-2.8.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:89aa9ee820bb39d4d72b794345cccef106b574508dd17dbec457949678c76011"},
-    {file = "torch-2.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:e8e5bf982e87e2b59d932769938b698858c64cc53753894be25629bdf5cf2f46"},
-    {file = "torch-2.8.0-cp310-none-macosx_11_0_arm64.whl", hash = "sha256:a3f16a58a9a800f589b26d47ee15aca3acf065546137fc2af039876135f4c760"},
-    {file = "torch-2.8.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:220a06fd7af8b653c35d359dfe1aaf32f65aa85befa342629f716acb134b9710"},
-    {file = "torch-2.8.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:c12fa219f51a933d5f80eeb3a7a5d0cbe9168c0a14bbb4055f1979431660879b"},
-    {file = "torch-2.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:8c7ef765e27551b2fbfc0f41bcf270e1292d9bf79f8e0724848b1682be6e80aa"},
-    {file = "torch-2.8.0-cp311-none-macosx_11_0_arm64.whl", hash = "sha256:5ae0524688fb6707c57a530c2325e13bb0090b745ba7b4a2cd6a3ce262572916"},
-    {file = "torch-2.8.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:e2fab4153768d433f8ed9279c8133a114a034a61e77a3a104dcdf54388838705"},
-    {file = "torch-2.8.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:b2aca0939fb7e4d842561febbd4ffda67a8e958ff725c1c27e244e85e982173c"},
-    {file = "torch-2.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:2f4ac52f0130275d7517b03a33d2493bab3693c83dcfadf4f81688ea82147d2e"},
-    {file = "torch-2.8.0-cp312-none-macosx_11_0_arm64.whl", hash = "sha256:619c2869db3ada2c0105487ba21b5008defcc472d23f8b80ed91ac4a380283b0"},
-    {file = "torch-2.8.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:2b2f96814e0345f5a5aed9bf9734efa913678ed19caf6dc2cddb7930672d6128"},
-    {file = "torch-2.8.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:65616ca8ec6f43245e1f5f296603e33923f4c30f93d65e103d9e50c25b35150b"},
-    {file = "torch-2.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:659df54119ae03e83a800addc125856effda88b016dfc54d9f65215c3975be16"},
-    {file = "torch-2.8.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:1a62a1ec4b0498930e2543535cf70b1bef8c777713de7ceb84cd79115f553767"},
-    {file = "torch-2.8.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:83c13411a26fac3d101fe8035a6b0476ae606deb8688e904e796a3534c197def"},
-    {file = "torch-2.8.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:8f0a9d617a66509ded240add3754e462430a6c1fc5589f86c17b433dd808f97a"},
-    {file = "torch-2.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:a7242b86f42be98ac674b88a4988643b9bc6145437ec8f048fea23f72feb5eca"},
-    {file = "torch-2.8.0-cp313-none-macosx_11_0_arm64.whl", hash = "sha256:7b677e17f5a3e69fdef7eb3b9da72622f8d322692930297e4ccb52fefc6c8211"},
-    {file = "torch-2.8.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:da6afa31c13b669d4ba49d8a2169f0db2c3ec6bec4af898aa714f401d4c38904"},
-    {file = "torch-2.8.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:06fcee8000e5c62a9f3e52a688b9c5abb7c6228d0e56e3452983416025c41381"},
-    {file = "torch-2.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:5128fe752a355d9308e56af1ad28b15266fe2da5948660fad44de9e3a9e36e8c"},
-    {file = "torch-2.8.0-cp39-none-macosx_11_0_arm64.whl", hash = "sha256:e9f071f5b52a9f6970dc8a919694b27a91ae9dc08898b2b988abbef5eddfd1ae"},
-]
-
-[package.dependencies]
-filelock = "*"
-fsspec = "*"
-jinja2 = "*"
-networkx = "*"
-nvidia-cublas-cu12 = {version = "12.8.4.1", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-cuda-cupti-cu12 = {version = "12.8.90", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-cuda-nvrtc-cu12 = {version = "12.8.93", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-cuda-runtime-cu12 = {version = "12.8.90", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-cudnn-cu12 = {version = "9.10.2.21", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-cufft-cu12 = {version = "11.3.3.83", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-cufile-cu12 = {version = "1.13.1.3", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-curand-cu12 = {version = "10.3.9.90", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-cusolver-cu12 = {version = "11.7.3.90", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-cusparse-cu12 = {version = "12.5.8.93", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-cusparselt-cu12 = {version = "0.7.1", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-nccl-cu12 = {version = "2.27.3", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-nvjitlink-cu12 = {version = "12.8.93", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-nvidia-nvtx-cu12 = {version = "12.8.90", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-setuptools = {version = "*", markers = "python_version >= \"3.12\""}
-sympy = ">=1.13.3"
-triton = {version = "3.4.0", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""}
-typing-extensions = ">=4.10.0"
-
-[package.extras]
-opt-einsum = ["opt-einsum (>=3.3)"]
-optree = ["optree (>=0.13.0)"]
-pyyaml = ["pyyaml"]
-
-[[package]]
-name = "torchmetrics"
-version = "1.8.2"
-description = "PyTorch native Metrics"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "torchmetrics-1.8.2-py3-none-any.whl", hash = "sha256:08382fd96b923e39e904c4d570f3d49e2cc71ccabd2a94e0f895d1f0dac86242"},
-    {file = "torchmetrics-1.8.2.tar.gz", hash = "sha256:cf64a901036bf107f17a524009eea7781c9c5315d130713aeca5747a686fe7a5"},
-]
-
-[package.dependencies]
-lightning-utilities = ">=0.8.0"
-numpy = ">1.20.0"
-packaging = ">17.1"
-torch = ">=2.0.0"
-
-[package.extras]
-all = ["SciencePlots (>=2.0.0)", "einops (>=0.7.0)", "einops (>=0.7.0)", "gammatone (>=1.0.0)", "ipadic (>=1.0.0)", "librosa (>=0.10.0)", "matplotlib (>=3.6.0)", "mecab-python3 (>=1.0.6)", "mypy (==1.17.1)", "nltk (>3.8.1)", "onnxruntime (>=1.12.0)", "pesq (>=0.0.4)", "piq (<=0.8.0)", "pycocotools (>2.0.0)", "pystoi (>=0.4.0)", "regex (>=2021.9.24)", "requests (>=2.19.0)", "scipy (>1.0.0)", "sentencepiece (>=0.2.0)", "timm (>=0.9.0)", "torch (==2.8.0)", "torch-fidelity (<=0.4.0)", "torch [...]
-audio = ["gammatone (>=1.0.0)", "librosa (>=0.10.0)", "onnxruntime (>=1.12.0)", "pesq (>=0.0.4)", "pystoi (>=0.4.0)", "requests (>=2.19.0)", "torchaudio (>=2.0.1)"]
-clustering = ["torch_linear_assignment (>=0.0.2)"]
-detection = ["pycocotools (>2.0.0)", "torchvision (>=0.15.1)"]
-dev = ["PyTDC (==0.4.1) ; python_version < \"3.10\" or platform_system == \"Windows\" and python_version < \"3.12\"", "SciencePlots (>=2.0.0)", "aeon (>=1.0.0) ; python_version > \"3.10\"", "bert_score (==0.3.13)", "dists-pytorch (==0.1)", "dython (==0.7.9)", "einops (>=0.7.0)", "einops (>=0.7.0)", "fairlearn", "fast-bss-eval (>=0.1.0)", "faster-coco-eval (>=1.6.3)", "gammatone (>=1.0.0)", "huggingface-hub (<0.35)", "ipadic (>=1.0.0)", "jiwer (>=2.3.0)", "kornia (>=0.6.7)", "librosa (>=0 [...]
-image = ["scipy (>1.0.0)", "torch-fidelity (<=0.4.0)", "torchvision (>=0.15.1)"]
-multimodal = ["einops (>=0.7.0)", "piq (<=0.8.0)", "timm (>=0.9.0)", "transformers (>=4.43.0)"]
-text = ["ipadic (>=1.0.0)", "mecab-python3 (>=1.0.6)", "nltk (>3.8.1)", "regex (>=2021.9.24)", "sentencepiece (>=0.2.0)", "tqdm (<4.68.0)", "transformers (>=4.43.0)"]
-typing = ["mypy (==1.17.1)", "torch (==2.8.0)", "types-PyYAML", "types-emoji", "types-protobuf", "types-requests", "types-setuptools", "types-six", "types-tabulate"]
-video = ["einops (>=0.7.0)", "vmaf-torch (>=1.1.0)"]
-visual = ["SciencePlots (>=2.0.0)", "matplotlib (>=3.6.0)"]
-
-[[package]]
-name = "tqdm"
-version = "4.67.1"
-description = "Fast, Extensible Progress Meter"
-optional = false
-python-versions = ">=3.7"
-groups = ["main"]
-files = [
-    {file = "tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2"},
-    {file = "tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2"},
-]
-
-[package.dependencies]
-colorama = {version = "*", markers = "platform_system == \"Windows\""}
-
-[package.extras]
-dev = ["nbval", "pytest (>=6)", "pytest-asyncio (>=0.24)", "pytest-cov", "pytest-timeout"]
-discord = ["requests"]
-notebook = ["ipywidgets (>=6)"]
-slack = ["slack-sdk"]
-telegram = ["requests"]
-
-[[package]]
-name = "transformers"
-version = "4.56.2"
-description = "State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow"
-optional = false
-python-versions = ">=3.9.0"
-groups = ["main"]
-files = [
-    {file = "transformers-4.56.2-py3-none-any.whl", hash = "sha256:79c03d0e85b26cb573c109ff9eafa96f3c8d4febfd8a0774e8bba32702dd6dde"},
-    {file = "transformers-4.56.2.tar.gz", hash = "sha256:5e7c623e2d7494105c726dd10f6f90c2c99a55ebe86eef7233765abd0cb1c529"},
-]
-
-[package.dependencies]
-filelock = "*"
-huggingface-hub = ">=0.34.0,<1.0"
-numpy = ">=1.17"
-packaging = ">=20.0"
-pyyaml = ">=5.1"
-regex = "!=2019.12.17"
-requests = "*"
-safetensors = ">=0.4.3"
-tokenizers = ">=0.22.0,<=0.23.0"
-tqdm = ">=4.27"
-
-[package.extras]
-accelerate = ["accelerate (>=0.26.0)"]
-all = ["Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.26.0)", "av", "codecarbon (>=2.8.1)", "flax (>=0.4.1,<=0.7.0)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "jinja2 (>=3.1.0)", "kenlm", "keras-nlp (>=0.3.1,<0.14.0)", "kernels (>=0.6.1,<=0.9)", "librosa", "mistral-common[opencv] (>=1.6.3)", "num2words", "onnxconverter-common", "optax (>=0.0.8,<=0.1.4)", "optuna", "phonemizer", "protobuf", "pyctcdecode (>=0.4.0)", "ray[tune] (>=2.7.0)", "scipy (<1.13.0)", "sentencepiece (>=0. [...]
-audio = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"]
-benchmark = ["optimum-benchmark (>=0.3.0)"]
-chat-template = ["jinja2 (>=3.1.0)"]
-codecarbon = ["codecarbon (>=2.8.1)"]
-deepspeed = ["accelerate (>=0.26.0)", "deepspeed (>=0.9.3)"]
-deepspeed-testing = ["GitPython (<3.1.19)", "accelerate (>=0.26.0)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (>=2.15.0)", "deepspeed (>=0.9.3)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "libcst", "mistral-common[opencv] (>=1.6.3)", "nltk (<=3.8.1)", "optuna", "parameterized (>=0.9)", "protobuf", "psutil", "pydantic (>=2)", "pytest (>=7.2.0)", "pytest-asyncio", "pytest-order", "pytest-rerunfailures", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "roug [...]
-dev = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.26.0)", "av", "beautifulsoup4", "codecarbon (>=2.8.1)", "cookiecutter (==1.7.3)", "datasets (>=2.15.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "flax (>=0.4.1,<=0.7.0)", "fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "jinja2 (>=3.1.0)", "kenlm", "keras-nlp (>=0.3.1,<0.14.0)", "kernels (>=0.6.1,<=0.9)", "libcst", "librosa", "mistral-common[opencv] (>= [...]
-dev-tensorflow = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (>=2.15.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "kenlm", "keras-nlp (>=0.3.1,<0.14.0)", "libcst", "librosa", "mistral-common[opencv] (>=1.6.3)", "nltk (<=3.8.1)", "onnxconverter-common", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "pandas (<2.3.0)", "parameterized (>=0.9)", "phonemizer", "protobuf", "psutil", "pyctcdecode (>=0.4.0)", "pyd [...]
-dev-torch = ["GitPython (<3.1.19)", "Pillow (>=10.0.1,<=15.0)", "accelerate (>=0.26.0)", "beautifulsoup4", "codecarbon (>=2.8.1)", "cookiecutter (==1.7.3)", "datasets (>=2.15.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "kenlm", "kernels (>=0.6.1,<=0.9)", "libcst", "librosa", "mistral-common[opencv] (>=1.6.3)", "nltk (<=3.8.1)", "num2words", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "optuna", "pandas (<2.3.0)", "parame [...]
-flax = ["flax (>=0.4.1,<=0.7.0)", "jax (>=0.4.1,<=0.4.13)", "jaxlib (>=0.4.1,<=0.4.13)", "optax (>=0.0.8,<=0.1.4)", "scipy (<1.13.0)"]
-flax-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"]
-ftfy = ["ftfy"]
-hf-xet = ["hf-xet"]
-hub-kernels = ["kernels (>=0.6.1,<=0.9)"]
-integrations = ["kernels (>=0.6.1,<=0.9)", "optuna", "ray[tune] (>=2.7.0)", "sigopt"]
-ja = ["fugashi (>=1.0)", "ipadic (>=1.0.0,<2.0)", "rhoknp (>=1.1.0,<1.3.1)", "sudachidict-core (>=20220729)", "sudachipy (>=0.6.6)", "unidic (>=1.0.2)", "unidic-lite (>=1.0.7)"]
-mistral-common = ["mistral-common[opencv] (>=1.6.3)"]
-modelcreation = ["cookiecutter (==1.7.3)"]
-natten = ["natten (>=0.14.6,<0.15.0)"]
-num2words = ["num2words"]
-onnx = ["onnxconverter-common", "onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)", "tf2onnx"]
-onnxruntime = ["onnxruntime (>=1.4.0)", "onnxruntime-tools (>=1.4.2)"]
-open-telemetry = ["opentelemetry-api", "opentelemetry-exporter-otlp", "opentelemetry-sdk"]
-optuna = ["optuna"]
-quality = ["GitPython (<3.1.19)", "datasets (>=2.15.0)", "libcst", "pandas (<2.3.0)", "rich", "ruff (==0.11.2)", "urllib3 (<2.0.0)"]
-ray = ["ray[tune] (>=2.7.0)"]
-retrieval = ["datasets (>=2.15.0)", "faiss-cpu"]
-ruff = ["ruff (==0.11.2)"]
-sagemaker = ["sagemaker (>=2.31.0)"]
-sentencepiece = ["protobuf", "sentencepiece (>=0.1.91,!=0.1.92)"]
-serving = ["accelerate (>=0.26.0)", "fastapi", "openai (>=1.98.0)", "pydantic (>=2)", "starlette", "torch (>=2.2)", "uvicorn"]
-sigopt = ["sigopt"]
-sklearn = ["scikit-learn"]
-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)", "torchaudio"]
-testing = ["GitPython (<3.1.19)", "beautifulsoup4", "cookiecutter (==1.7.3)", "datasets (>=2.15.0)", "dill (<0.3.5)", "evaluate (>=0.2.0)", "faiss-cpu", "libcst", "mistral-common[opencv] (>=1.6.3)", "nltk (<=3.8.1)", "parameterized (>=0.9)", "psutil", "pydantic (>=2)", "pytest (>=7.2.0)", "pytest-asyncio", "pytest-order", "pytest-rerunfailures", "pytest-rich", "pytest-timeout", "pytest-xdist", "rjieba", "rouge-score (!=0.0.7,!=0.0.8,!=0.1,!=0.1.1)", "ruff (==0.11.2)", "sacrebleu (>=1.4.1 [...]
-tf = ["keras-nlp (>=0.3.1,<0.14.0)", "onnxconverter-common", "tensorflow (>2.9,<2.16)", "tensorflow-text (<2.16)", "tf2onnx"]
-tf-cpu = ["keras (>2.9,<2.16)", "keras-nlp (>=0.3.1,<0.14.0)", "onnxconverter-common", "tensorflow-cpu (>2.9,<2.16)", "tensorflow-probability (<0.24)", "tensorflow-text (<2.16)", "tf2onnx"]
-tf-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)"]
-tiktoken = ["blobfile", "tiktoken"]
-timm = ["timm (!=1.0.18,<=1.0.19)"]
-tokenizers = ["tokenizers (>=0.22.0,<=0.23.0)"]
-torch = ["accelerate (>=0.26.0)", "torch (>=2.2)"]
-torch-speech = ["kenlm", "librosa", "phonemizer", "pyctcdecode (>=0.4.0)", "torchaudio"]
-torch-vision = ["Pillow (>=10.0.1,<=15.0)", "torchvision"]
-torchhub = ["filelock", "huggingface-hub (>=0.34.0,<1.0)", "importlib-metadata", "numpy (>=1.17)", "packaging (>=20.0)", "protobuf", "regex (!=2019.12.17)", "requests", "sentencepiece (>=0.1.91,!=0.1.92)", "tokenizers (>=0.22.0,<=0.23.0)", "torch (>=2.2)", "tqdm (>=4.27)"]
-video = ["av"]
-vision = ["Pillow (>=10.0.1,<=15.0)"]
-
-[[package]]
-name = "triton"
-version = "3.4.0"
-description = "A language and compiler for custom Deep Learning operations"
-optional = false
-python-versions = "<3.14,>=3.9"
-groups = ["main"]
-markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""
-files = [
-    {file = "triton-3.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7ff2785de9bc02f500e085420273bb5cc9c9bb767584a4aa28d6e360cec70128"},
-    {file = "triton-3.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b70f5e6a41e52e48cfc087436c8a28c17ff98db369447bcaff3b887a3ab4467"},
-    {file = "triton-3.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:31c1d84a5c0ec2c0f8e8a072d7fd150cab84a9c239eaddc6706c081bfae4eb04"},
-    {file = "triton-3.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00be2964616f4c619193cb0d1b29a99bd4b001d7dc333816073f92cf2a8ccdeb"},
-    {file = "triton-3.4.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7936b18a3499ed62059414d7df563e6c163c5e16c3773678a3ee3d417865035d"},
-    {file = "triton-3.4.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:98e5c1442eaeabae2e2452ae765801bd53cd4ce873cab0d1bdd59a32ab2d9397"},
-]
-
-[package.dependencies]
-setuptools = ">=40.8.0"
-
-[package.extras]
-build = ["cmake (>=3.20,<4.0)", "lit"]
-tests = ["autopep8", "isort", "llnl-hatchet", "numpy", "pytest", "pytest-forked", "pytest-xdist", "scipy (>=1.7.1)"]
-tutorials = ["matplotlib", "pandas", "tabulate"]
-
-[[package]]
-name = "typing-extensions"
-version = "4.15.0"
-description = "Backported and Experimental Type Hints for Python 3.9+"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548"},
-    {file = "typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"},
-]
-
-[[package]]
-name = "tzdata"
-version = "2025.2"
-description = "Provider of IANA time zone data"
-optional = false
-python-versions = ">=2"
-groups = ["main"]
-files = [
-    {file = "tzdata-2025.2-py2.py3-none-any.whl", hash = "sha256:1a403fada01ff9221ca8044d701868fa132215d84beb92242d9acd2147f667a8"},
-    {file = "tzdata-2025.2.tar.gz", hash = "sha256:b60a638fcc0daffadf82fe0f57e53d06bdec2f36c4df66280ae79bce6bd6f2b9"},
-]
-
-[[package]]
-name = "tzlocal"
-version = "5.3.1"
-description = "tzinfo object for the local timezone"
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "tzlocal-5.3.1-py3-none-any.whl", hash = "sha256:eb1a66c3ef5847adf7a834f1be0800581b683b5608e74f86ecbcef8ab91bb85d"},
-    {file = "tzlocal-5.3.1.tar.gz", hash = "sha256:cceffc7edecefea1f595541dbd6e990cb1ea3d19bf01b2809f362a03dd7921fd"},
-]
-
-[package.dependencies]
-tzdata = {version = "*", markers = "platform_system == \"Windows\""}
-
-[package.extras]
-devenv = ["check-manifest", "pytest (>=4.3)", "pytest-cov", "pytest-mock (>=3.3)", "zest.releaser"]
-
-[[package]]
-name = "urllib3"
-version = "2.5.0"
-description = "HTTP library with thread-safe connection pooling, file post, and more."
-optional = false
-python-versions = ">=3.9"
-groups = ["main"]
-files = [
-    {file = "urllib3-2.5.0-py3-none-any.whl", hash = "sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc"},
-    {file = "urllib3-2.5.0.tar.gz", hash = "sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760"},
-]
-
-[package.extras]
-brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""]
-h2 = ["h2 (>=4,<5)"]
-socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
-zstd = ["zstandard (>=0.18.0)"]
-
-[metadata]
-lock-version = "2.1"
-python-versions = ">=3.11.0,<3.14.0"
-content-hash = "37441b66c5cf440280823bb97248fa10b0ca20d7fef4d20aec616e3860a31736"


(iotdb) 02/45: Delete the tsfile and related attachments When only one table and dat… (#16687)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 3a8d6d5278874f8ff7a86998e84fdf89046ba026
Author: libo <ze...@163.com>
AuthorDate: Mon Nov 10 16:03:44 2025 +0800

    Delete the tsfile and related attachments When only one table and dat… (#16687)
    
    * Delete the tsfile and related attachments When only one table and data is cleared fully in the tsfile
    
    * Adjust logic is only effective in the table model, and refers to the tree model to delete files related to tsfile.
    
    * Supply an IT test to validate if involved supporting files about tsfile are deleted after delete all data in a table.
    
    * Resolve problem reported that file is not exist in the situation of 1C3D.
    
    * File may be not exist in the situation of 1C3D so that verify if it is exists first before scan the directory.
    
    * Fix the logic that verify only on table When multiple devices in same one table.
    
    * Don't delete file until all devices matched by time.
    
    * Avoid to delete the file when the device that need be deleted and  other devices are all in the same one tsfile.
    
    * Increment a break to avoid extra I/O in the same file.
    
    * After delete all datas from a table, validate multiple devices involved files are deleted by different time range if it's success.
    
    * Add some logs and trace cause.
    
    * Debug
    
    * Change into logger
    
    * Decrement interval time
    
    * Clean environment before run testCompletelyDeleteTable
    
    * Recover all workflow yml files, log level need change into "debug" level.
    
    * Add a verification due to performance considerations.
    
    * Add some verification due to performance considerations.
    
    (cherry picked from commit f67526420d0f0fa5f01a2e8fa5929acd98173ab3)
---
 .../relational/it/db/it/IoTDBDeletionTableIT.java  | 372 +++++++++++++++++++++
 .../db/storageengine/dataregion/DataRegion.java    | 121 ++++++-
 2 files changed, 492 insertions(+), 1 deletion(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java
index 316ae614681..997a80a76f1 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java
@@ -23,6 +23,7 @@ import org.apache.iotdb.db.it.utils.TestUtils;
 import org.apache.iotdb.isession.ITableSession;
 import org.apache.iotdb.isession.SessionDataSet;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.cluster.node.DataNodeWrapper;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ManualIT;
 import org.apache.iotdb.itbase.category.TableClusterIT;
@@ -34,6 +35,7 @@ import org.apache.iotdb.rpc.StatementExecutionException;
 
 import org.apache.tsfile.read.common.RowRecord;
 import org.apache.tsfile.read.common.TimeRange;
+import org.awaitility.Awaitility;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Assert;
@@ -47,8 +49,12 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.BufferedWriter;
+import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -63,8 +69,10 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -87,6 +95,17 @@ public class IoTDBDeletionTableIT {
       "INSERT INTO test.vehicle%d(time, deviceId, s0,s1,s2,s3,s4"
           + ") VALUES(%d,'d%d',%d,%d,%f,%s,%b)";
 
+  private final String insertDeletionTemplate =
+      "INSERT INTO deletion.vehicle%d(time, deviceId, s0,s1,s2,s3,s4"
+          + ") VALUES(%d,'d%d',%d,%d,%f,%s,%b)";
+
+  private static String sequenceDataDir = "data" + File.separator + "sequence";
+  private static String unsequenceDataDir = "data" + File.separator + "unsequence";
+
+  private static final String RESOURCE = ".resource";
+  private static final String MODS = ".mods";
+  private static final String TSFILE = ".tsfile";
+
   @BeforeClass
   public static void setUpClass() {
     Locale.setDefault(Locale.ENGLISH);
@@ -470,6 +489,26 @@ public class IoTDBDeletionTableIT {
     }
   }
 
+  @Test
+  public void testFullDeleteWithoutWhereClauseByDifferentTime() throws SQLException {
+    prepareMultiDeviceDifferentTimeData(5, 2);
+    try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
+        Statement statement = connection.createStatement()) {
+      statement.execute("use deletion");
+      statement.execute("DELETE FROM vehicle5");
+      try (ResultSet set = statement.executeQuery("SELECT s0 FROM vehicle5")) {
+        int cnt = 0;
+        while (set.next()) {
+          cnt++;
+        }
+        assertEquals(0, cnt);
+      }
+      cleanData(5);
+    } catch (Exception e) {
+      fail(e.getMessage());
+    }
+  }
+
   @Test
   public void testDeleteWithSpecificDevice() throws SQLException {
     prepareData(6, 1);
@@ -2003,6 +2042,226 @@ public class IoTDBDeletionTableIT {
     }
   }
 
+  @Test
+  public void testCompletelyDeleteTable() throws SQLException {
+    int testNum = 1;
+    cleanDeletionDatabase();
+    prepareDeletionDatabase();
+    prepareMultiDeviceDifferentTimeData(testNum, 1);
+    try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
+        Statement statement = connection.createStatement()) {
+      statement.execute("use deletion");
+
+      statement.execute("DROP TABLE vehicle" + testNum);
+
+      statement.execute("flush");
+
+      statement.execute(
+          String.format(
+              "CREATE TABLE vehicle%d(deviceId STRING TAG, s0 INT32 FIELD, s1 INT64 FIELD, s2 FLOAT FIELD, s3 TEXT FIELD, s4 BOOLEAN FIELD)",
+              testNum));
+
+      try (ResultSet set = statement.executeQuery("SELECT * FROM vehicle" + testNum)) {
+        assertFalse(set.next());
+      }
+
+      prepareData(testNum, 1);
+
+      statement.execute("DELETE FROM vehicle" + testNum + " WHERE time <= 1000");
+
+      Awaitility.await()
+          .atMost(5, TimeUnit.MINUTES)
+          .pollDelay(500, TimeUnit.MILLISECONDS)
+          .pollInterval(500, TimeUnit.MILLISECONDS)
+          .until(
+              () -> {
+                AtomicBoolean completelyDeleteSuccess = new AtomicBoolean(true);
+                boolean allPass = true;
+                for (DataNodeWrapper wrapper : EnvFactory.getEnv().getDataNodeWrapperList()) {
+                  String dataNodeDir = wrapper.getDataNodeDir();
+
+                  if (Paths.get(
+                          dataNodeDir
+                              + File.separator
+                              + sequenceDataDir
+                              + File.separator
+                              + "deletion")
+                      .toFile()
+                      .exists()) {
+                    try (Stream<Path> s =
+                        Files.walk(
+                            Paths.get(
+                                dataNodeDir
+                                    + File.separator
+                                    + sequenceDataDir
+                                    + File.separator
+                                    + "deletion"))) {
+                      s.forEach(
+                          source -> {
+                            if (source.toString().endsWith(RESOURCE)
+                                || source.toString().endsWith(MODS)
+                                || source.toString().endsWith(TSFILE)) {
+                              if (source.toFile().length() > 0) {
+                                LOGGER.error(
+                                    "[testCompletelyDeleteTable] undeleted seq file : {}",
+                                    source.toFile().getAbsolutePath());
+                                completelyDeleteSuccess.set(false);
+                              }
+                            }
+                          });
+                    }
+                  }
+
+                  if (Paths.get(
+                          dataNodeDir
+                              + File.separator
+                              + unsequenceDataDir
+                              + File.separator
+                              + "deletion")
+                      .toFile()
+                      .exists()) {
+                    try (Stream<Path> s =
+                        Files.walk(
+                            Paths.get(
+                                dataNodeDir
+                                    + File.separator
+                                    + unsequenceDataDir
+                                    + File.separator
+                                    + "deletion"))) {
+                      s.forEach(
+                          source -> {
+                            if (source.toString().endsWith(RESOURCE)
+                                || source.toString().endsWith(MODS)
+                                || source.toString().endsWith(TSFILE)) {
+                              if (source.toFile().length() > 0) {
+                                LOGGER.error(
+                                    "[testCompletelyDeleteTable] undeleted unseq file: {}",
+                                    source.toFile().getAbsolutePath());
+                                completelyDeleteSuccess.set(false);
+                              }
+                            }
+                          });
+                    }
+                  }
+
+                  allPass = allPass && completelyDeleteSuccess.get();
+                }
+                return allPass;
+              });
+    }
+    cleanData(testNum);
+  }
+
+  @Test
+  public void testMultiDeviceCompletelyDeleteTable() throws SQLException {
+    int testNum = 1;
+    cleanDeletionDatabase();
+    prepareDeletionDatabase();
+    prepareMultiDeviceDifferentTimeData(testNum, 2);
+    try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
+        Statement statement = connection.createStatement()) {
+      statement.execute("use deletion");
+
+      statement.execute("DROP TABLE vehicle" + testNum);
+
+      statement.execute("flush");
+
+      statement.execute(
+          String.format(
+              "CREATE TABLE vehicle%d(deviceId STRING TAG, s0 INT32 FIELD, s1 INT64 FIELD, s2 FLOAT FIELD, s3 TEXT FIELD, s4 BOOLEAN FIELD)",
+              testNum));
+
+      try (ResultSet set = statement.executeQuery("SELECT * FROM vehicle" + testNum)) {
+        assertFalse(set.next());
+      }
+
+      prepareData(testNum, 2);
+
+      statement.execute("DELETE FROM vehicle" + testNum + " WHERE time <= 1000");
+
+      Awaitility.await()
+          .atMost(5, TimeUnit.MINUTES)
+          .pollDelay(2, TimeUnit.SECONDS)
+          .pollInterval(2, TimeUnit.SECONDS)
+          .until(
+              () -> {
+                AtomicBoolean completelyDeleteSuccess = new AtomicBoolean(true);
+                boolean allPass = true;
+                for (DataNodeWrapper wrapper : EnvFactory.getEnv().getDataNodeWrapperList()) {
+                  String dataNodeDir = wrapper.getDataNodeDir();
+
+                  if (Paths.get(
+                          dataNodeDir
+                              + File.separator
+                              + sequenceDataDir
+                              + File.separator
+                              + "deletion")
+                      .toFile()
+                      .exists()) {
+                    try (Stream<Path> s =
+                        Files.walk(
+                            Paths.get(
+                                dataNodeDir
+                                    + File.separator
+                                    + sequenceDataDir
+                                    + File.separator
+                                    + "deletion"))) {
+                      s.forEach(
+                          source -> {
+                            if (source.toString().endsWith(RESOURCE)
+                                || source.toString().endsWith(MODS)
+                                || source.toString().endsWith(TSFILE)) {
+                              if (source.toFile().length() > 0) {
+                                LOGGER.error(
+                                    "[testMultiDeviceCompletelyDeleteTable] undeleted unseq file: {}",
+                                    source.toFile().getAbsolutePath());
+                                completelyDeleteSuccess.set(false);
+                              }
+                            }
+                          });
+                    }
+                  }
+
+                  if (Paths.get(
+                          dataNodeDir
+                              + File.separator
+                              + unsequenceDataDir
+                              + File.separator
+                              + "deletion")
+                      .toFile()
+                      .exists()) {
+                    try (Stream<Path> s =
+                        Files.walk(
+                            Paths.get(
+                                dataNodeDir
+                                    + File.separator
+                                    + unsequenceDataDir
+                                    + File.separator
+                                    + "deletion"))) {
+                      s.forEach(
+                          source -> {
+                            if (source.toString().endsWith(RESOURCE)
+                                || source.toString().endsWith(MODS)
+                                || source.toString().endsWith(TSFILE)) {
+                              if (source.toFile().length() > 0) {
+                                LOGGER.error(
+                                    "[testMultiDeviceCompletelyDeleteTable] undeleted unseq file: {}",
+                                    source.toFile().getAbsolutePath());
+                                completelyDeleteSuccess.set(false);
+                              }
+                            }
+                          });
+                    }
+                  }
+
+                  allPass = allPass && completelyDeleteSuccess.get();
+                }
+                return allPass;
+              });
+    }
+    cleanData(testNum);
+  }
+
   private static void prepareDatabase() {
     try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
         Statement statement = connection.createStatement()) {
@@ -2015,6 +2274,40 @@ public class IoTDBDeletionTableIT {
     }
   }
 
+  private static void prepareDeletionDatabase() {
+    try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
+        Statement statement = connection.createStatement()) {
+      statement.execute("CREATE DATABASE IF NOT EXISTS deletion");
+    } catch (Exception e) {
+      fail(e.getMessage());
+    }
+  }
+
+  private void cleanDeletionDatabase() {
+    try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
+        Statement statement = connection.createStatement()) {
+      statement.execute("DROP DATABASE IF EXISTS deletion");
+      for (DataNodeWrapper wrapper : EnvFactory.getEnv().getDataNodeWrapperList()) {
+        String dataNodeDir = wrapper.getDataNodeDir();
+        File targetFile =
+            Paths.get(dataNodeDir + File.separator + sequenceDataDir + File.separator + "deletion")
+                .toFile();
+        if (targetFile.exists()) {
+          targetFile.delete();
+        }
+
+        targetFile =
+            Paths.get(dataNodeDir + File.separator + sequenceDataDir + File.separator + "deletion")
+                .toFile();
+        if (targetFile.exists()) {
+          targetFile.delete();
+        }
+      }
+    } catch (Exception e) {
+      fail(e.getMessage());
+    }
+  }
+
   private void prepareData(int testNum, int deviceNum) throws SQLException {
     try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
         Statement statement = connection.createStatement()) {
@@ -2062,6 +2355,85 @@ public class IoTDBDeletionTableIT {
     }
   }
 
+  private void prepareMultiDeviceDifferentTimeData(int testNum, int deviceNum) throws SQLException {
+    try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
+        Statement statement = connection.createStatement()) {
+      statement.execute("use deletion");
+      statement.execute(
+          String.format(
+              "CREATE TABLE IF NOT EXISTS vehicle%d(deviceId STRING TAG, s0 INT32 FIELD, s1 INT64 FIELD, s2 FLOAT FIELD, s3 TEXT FIELD, s4 BOOLEAN FIELD)",
+              testNum));
+
+      for (int d = 0; d < deviceNum; d++) {
+        // prepare seq file
+        for (int i = 201 * (d + 1); i <= 300 * (d + 1); i++) {
+          statement.execute(
+              String.format(
+                  insertDeletionTemplate,
+                  testNum,
+                  i,
+                  d,
+                  i,
+                  i,
+                  (double) i,
+                  "'" + i + "'",
+                  i % 2 == 0));
+        }
+      }
+
+      statement.execute("flush");
+
+      for (int d = 0; d < deviceNum; d++) {
+        // prepare unseq File
+        for (int i = 1 * (d + 1); i <= 100 * (d + 1); i++) {
+          statement.execute(
+              String.format(
+                  insertDeletionTemplate,
+                  testNum,
+                  i,
+                  d,
+                  i,
+                  i,
+                  (double) i,
+                  "'" + i + "'",
+                  i % 2 == 0));
+        }
+      }
+      statement.execute("flush");
+
+      for (int d = 0; d < deviceNum; d++) {
+        // prepare BufferWrite cache
+        for (int i = 301 * (d + 1); i <= 400 * (d + 1); i++) {
+          statement.execute(
+              String.format(
+                  insertDeletionTemplate,
+                  testNum,
+                  i,
+                  d,
+                  i,
+                  i,
+                  (double) i,
+                  "'" + i + "'",
+                  i % 2 == 0));
+        }
+        // prepare Overflow cache
+        for (int i = 101 * (d + 1); i <= 200 * (d + 1); i++) {
+          statement.execute(
+              String.format(
+                  insertDeletionTemplate,
+                  testNum,
+                  i,
+                  d,
+                  i,
+                  i,
+                  (double) i,
+                  "'" + i + "'",
+                  i % 2 == 0));
+        }
+      }
+    }
+  }
+
   private void cleanData(int testNum) throws SQLException {
     try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
         Statement statement = connection.createStatement()) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
index eec169aa807..2c0c39032c4 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
@@ -2941,12 +2941,110 @@ public class DataRegion implements IDataRegionForQuery {
   private void deleteDataInSealedFiles(Collection<TsFileResource> sealedTsFiles, ModEntry deletion)
       throws IOException {
     Set<ModificationFile> involvedModificationFiles = new HashSet<>();
+    List<TsFileResource> deletedByMods = new ArrayList<>();
+    List<TsFileResource> deletedByFiles = new ArrayList<>();
     for (TsFileResource sealedTsFile : sealedTsFiles) {
       if (canSkipDelete(sealedTsFile, deletion)) {
         continue;
       }
 
-      involvedModificationFiles.add(sealedTsFile.getModFileForWrite());
+      ITimeIndex timeIndex = sealedTsFile.getTimeIndex();
+
+      if ((timeIndex instanceof ArrayDeviceTimeIndex)
+          && (deletion.getType() == ModEntry.ModType.TABLE_DELETION)) {
+        ArrayDeviceTimeIndex deviceTimeIndex = (ArrayDeviceTimeIndex) timeIndex;
+        Set<IDeviceID> devicesInFile = deviceTimeIndex.getDevices();
+        boolean onlyOneTable = false;
+
+        if (deletion instanceof TableDeletionEntry) {
+          TableDeletionEntry tableDeletionEntry = (TableDeletionEntry) deletion;
+          String tableName = tableDeletionEntry.getTableName();
+          long matchSize =
+              devicesInFile.stream()
+                  .filter(
+                      device -> {
+                        if (logger.isDebugEnabled()) {
+                          logger.debug(
+                              "device is {}, deviceTable is {}, tableDeletionEntry.getPredicate().matches(device) is {}",
+                              device,
+                              device.getTableName(),
+                              tableDeletionEntry.getPredicate().matches(device));
+                        }
+                        return tableName.equals(device.getTableName())
+                            && tableDeletionEntry.getPredicate().matches(device);
+                      })
+                  .count();
+          onlyOneTable = matchSize == devicesInFile.size();
+          if (logger.isDebugEnabled()) {
+            logger.debug(
+                "tableName is {}, matchSize is {}, onlyOneTable is {}",
+                tableName,
+                matchSize,
+                onlyOneTable);
+          }
+        }
+
+        if (onlyOneTable) {
+          int matchSize = 0;
+          for (IDeviceID device : devicesInFile) {
+            Optional<Long> optStart = deviceTimeIndex.getStartTime(device);
+            Optional<Long> optEnd = deviceTimeIndex.getEndTime(device);
+            if (!optStart.isPresent() || !optEnd.isPresent()) {
+              continue;
+            }
+
+            long fileStartTime = optStart.get();
+            long fileEndTime = optEnd.get();
+
+            if (logger.isDebugEnabled()) {
+              logger.debug(
+                  "tableName is {}, device is {}, deletionStartTime is {}, deletionEndTime is {}, fileStartTime is {}, fileEndTime is {}",
+                  device.getTableName(),
+                  device,
+                  deletion.getStartTime(),
+                  deletion.getEndTime(),
+                  fileStartTime,
+                  fileEndTime);
+            }
+            if (isFileFullyMatchedByTime(deletion, fileStartTime, fileEndTime)) {
+              ++matchSize;
+            } else {
+              deletedByMods.add(sealedTsFile);
+              break;
+            }
+          }
+          if (matchSize == devicesInFile.size()) {
+            deletedByFiles.add(sealedTsFile);
+          }
+
+          if (logger.isDebugEnabled()) {
+            logger.debug("expect is {}, actual is {}", devicesInFile.size(), matchSize);
+            for (TsFileResource tsFileResource : deletedByFiles) {
+              logger.debug(
+                  "delete tsFileResource is {}", tsFileResource.getTsFile().getAbsolutePath());
+            }
+          }
+        } else {
+          involvedModificationFiles.add(sealedTsFile.getModFileForWrite());
+        }
+      } else {
+        involvedModificationFiles.add(sealedTsFile.getModFileForWrite());
+      }
+    }
+
+    for (TsFileResource tsFileResource : deletedByMods) {
+      if (tsFileResource.isClosed()
+          || !tsFileResource.getProcessor().deleteDataInMemory(deletion)) {
+        involvedModificationFiles.add(tsFileResource.getModFileForWrite());
+      } // else do nothing
+    }
+
+    if (!deletedByFiles.isEmpty()) {
+      deleteTsFileCompletely(deletedByFiles);
+      if (logger.isDebugEnabled()) {
+        logger.debug(
+            "deleteTsFileCompletely execute successful, all tsfile are deleted successfully");
+      }
     }
 
     if (involvedModificationFiles.isEmpty()) {
@@ -2984,6 +3082,27 @@ public class DataRegion implements IDataRegionForQuery {
         involvedModificationFiles.size());
   }
 
+  private boolean isFileFullyMatchedByTime(
+      ModEntry deletion, long fileStartTime, long fileEndTime) {
+    return fileStartTime >= deletion.getStartTime() && fileEndTime <= deletion.getEndTime();
+  }
+
+  /** Delete completely TsFile and related supporting files */
+  private void deleteTsFileCompletely(List<TsFileResource> tsfileResourceList) {
+    for (TsFileResource tsFileResource : tsfileResourceList) {
+      tsFileManager.remove(tsFileResource, tsFileResource.isSeq());
+      tsFileResource.writeLock();
+      try {
+        FileMetrics.getInstance()
+            .deleteTsFile(tsFileResource.isSeq(), Collections.singletonList(tsFileResource));
+        tsFileResource.remove();
+        logger.info("Remove tsfile {} directly when delete data", tsFileResource.getTsFilePath());
+      } finally {
+        tsFileResource.writeUnlock();
+      }
+    }
+  }
+
   private void deleteDataDirectlyInFile(List<TsFileResource> tsfileResourceList, ModEntry modEntry)
       throws IOException {
     List<TsFileResource> deletedByMods = new ArrayList<>();


(iotdb) 32/45: Load: Active Load supports ModV2 (#16769)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit fe49c5ee0806f57a30cfff5c86d61fb653a51203
Author: Zhenyu Luo <zh...@apache.org>
AuthorDate: Thu Nov 20 18:10:19 2025 +0800

    Load: Active Load supports ModV2 (#16769)
    
    (cherry picked from commit f708b96623861172ed3a4cf5a6d29433565549ef)
---
 .../protocol/thrift/IoTDBDataNodeReceiver.java     |  4 +-
 .../plan/analyze/load/LoadTsFileAnalyzer.java      |  5 +--
 .../plan/node/load/LoadSingleTsFileNode.java       |  6 +--
 .../load/active/ActiveLoadDirScanner.java          | 20 ++-------
 .../load/active/ActiveLoadTsFileLoader.java        |  6 ++-
 ...leStatementDataTypeConvertExecutionVisitor.java | 10 ++---
 ...eeStatementDataTypeConvertExecutionVisitor.java | 10 ++---
 .../ActiveLoadUtil.java => util/LoadUtil.java}     | 49 +++++++++++++++++++---
 8 files changed, 65 insertions(+), 45 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
index 652530d11b4..4d4bf7b3926 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
@@ -101,7 +101,7 @@ import org.apache.iotdb.db.queryengine.plan.statement.crud.LoadTsFileStatement;
 import org.apache.iotdb.db.queryengine.plan.statement.pipe.PipeEnrichedStatement;
 import org.apache.iotdb.db.schemaengine.table.DataNodeTableCache;
 import org.apache.iotdb.db.storageengine.load.active.ActiveLoadPathHelper;
-import org.apache.iotdb.db.storageengine.load.active.ActiveLoadUtil;
+import org.apache.iotdb.db.storageengine.load.util.LoadUtil;
 import org.apache.iotdb.db.storageengine.rescon.disk.FolderManager;
 import org.apache.iotdb.db.storageengine.rescon.disk.strategy.DirectoryStrategyType;
 import org.apache.iotdb.db.tools.schema.SRStatementGenerator;
@@ -580,7 +580,7 @@ public class IoTDBDataNodeReceiver extends IoTDBFileReceiver {
             null,
             shouldMarkAsPipeRequest.get());
 
-    if (!ActiveLoadUtil.loadFilesToActiveDir(loadAttributes, absolutePaths, true)) {
+    if (!LoadUtil.loadFilesToActiveDir(loadAttributes, absolutePaths, true)) {
       throw new PipeException("Load active listening pipe dir is not set.");
     }
     return new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java
index 076b529ab91..8202de5c499 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java
@@ -43,9 +43,9 @@ import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
 import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResourceStatus;
 import org.apache.iotdb.db.storageengine.dataregion.utils.TsFileResourceUtils;
 import org.apache.iotdb.db.storageengine.load.active.ActiveLoadPathHelper;
-import org.apache.iotdb.db.storageengine.load.active.ActiveLoadUtil;
 import org.apache.iotdb.db.storageengine.load.converter.LoadTsFileDataTypeConverter;
 import org.apache.iotdb.db.storageengine.load.metrics.LoadTsFileCostMetricsSet;
+import org.apache.iotdb.db.storageengine.load.util.LoadUtil;
 import org.apache.iotdb.db.utils.TimestampPrecisionUtils;
 import org.apache.iotdb.rpc.RpcUtils;
 import org.apache.iotdb.rpc.TSStatusCode;
@@ -291,8 +291,7 @@ public class LoadTsFileAnalyzer implements AutoCloseable {
               tabletConversionThresholdBytes,
               isGeneratedByPipe);
 
-      if (ActiveLoadUtil.loadTsFileAsyncToActiveDir(
-          tsFiles, activeLoadAttributes, isDeleteAfterLoad)) {
+      if (LoadUtil.loadTsFileAsyncToActiveDir(tsFiles, activeLoadAttributes, isDeleteAfterLoad)) {
         analysis.setFinishQueryAfterAnalyze(true);
         setRealStatement(analysis);
         return true;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/load/LoadSingleTsFileNode.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/load/LoadSingleTsFileNode.java
index c8691868c82..604fda6e1e8 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/load/LoadSingleTsFileNode.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/load/LoadSingleTsFileNode.java
@@ -30,8 +30,8 @@ import org.apache.iotdb.db.queryengine.plan.planner.plan.node.PlanNode;
 import org.apache.iotdb.db.queryengine.plan.planner.plan.node.PlanNodeId;
 import org.apache.iotdb.db.queryengine.plan.planner.plan.node.WritePlanNode;
 import org.apache.iotdb.db.storageengine.dataregion.modification.ModificationFile;
-import org.apache.iotdb.db.storageengine.dataregion.modification.v1.ModificationFileV1;
 import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
+import org.apache.iotdb.db.storageengine.load.util.LoadUtil;
 
 import org.apache.tsfile.exception.NotImplementedException;
 import org.apache.tsfile.file.metadata.IDeviceID;
@@ -229,10 +229,10 @@ public class LoadSingleTsFileNode extends WritePlanNode {
       if (deleteAfterLoad) {
         Files.deleteIfExists(tsFile.toPath());
         Files.deleteIfExists(
-            new File(tsFile.getAbsolutePath() + TsFileResource.RESOURCE_SUFFIX).toPath());
+            new File(LoadUtil.getTsFileResourcePath(tsFile.getAbsolutePath())).toPath());
         Files.deleteIfExists(ModificationFile.getExclusiveMods(tsFile).toPath());
         Files.deleteIfExists(
-            new File(tsFile.getAbsolutePath() + ModificationFileV1.FILE_SUFFIX).toPath());
+            new File(LoadUtil.getTsFileModsV1Path(tsFile.getAbsolutePath())).toPath());
       }
     } catch (final IOException e) {
       LOGGER.warn("Delete After Loading {} error.", tsFile, e);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java
index 470cf702b22..cedc4d5e29f 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java
@@ -23,6 +23,7 @@ import org.apache.iotdb.commons.concurrent.ThreadName;
 import org.apache.iotdb.commons.conf.CommonDescriptor;
 import org.apache.iotdb.db.storageengine.load.metrics.ActiveLoadingFilesNumberMetricsSet;
 import org.apache.iotdb.db.storageengine.load.metrics.ActiveLoadingFilesSizeMetricsSet;
+import org.apache.iotdb.db.storageengine.load.util.LoadUtil;
 
 import org.apache.tsfile.common.conf.TSFileConfig;
 import org.apache.tsfile.external.commons.io.FileUtils;
@@ -51,9 +52,6 @@ public class ActiveLoadDirScanner extends ActiveLoadScheduledExecutorService {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(ActiveLoadDirScanner.class);
 
-  private static final String RESOURCE = ".resource";
-  private static final String MODS = ".mods";
-
   private final AtomicReference<String[]> listeningDirsConfig = new AtomicReference<>();
   private final Set<String> listeningDirs = new CopyOnWriteArraySet<>();
 
@@ -110,11 +108,7 @@ public class ActiveLoadDirScanner extends ActiveLoadScheduledExecutorService {
           fileStream
               .filter(file -> !activeLoadTsFileLoader.isFilePendingOrLoading(file))
               .filter(File::exists)
-              .map(
-                  file ->
-                      (file.getName().endsWith(RESOURCE) || file.getName().endsWith(MODS))
-                          ? getTsFilePath(file.getAbsolutePath())
-                          : file.getAbsolutePath())
+              .map(file -> LoadUtil.getTsFilePath(file.getAbsolutePath()))
               .filter(this::isTsFileCompleted)
               .limit(currentAllowedPendingSize)
               .forEach(
@@ -202,7 +196,7 @@ public class ActiveLoadDirScanner extends ActiveLoadScheduledExecutorService {
 
               listeningDirsConfig.set(IOTDB_CONFIG.getLoadActiveListeningDirs());
               listeningDirs.addAll(Arrays.asList(IOTDB_CONFIG.getLoadActiveListeningDirs()));
-              ActiveLoadUtil.updateLoadDiskSelector();
+              LoadUtil.updateLoadDiskSelector();
             }
           }
         }
@@ -235,14 +229,6 @@ public class ActiveLoadDirScanner extends ActiveLoadScheduledExecutorService {
     }
   }
 
-  private static String getTsFilePath(final String filePathWithResourceOrModsTail) {
-    return filePathWithResourceOrModsTail.endsWith(RESOURCE)
-        ? filePathWithResourceOrModsTail.substring(
-            0, filePathWithResourceOrModsTail.length() - RESOURCE.length())
-        : filePathWithResourceOrModsTail.substring(
-            0, filePathWithResourceOrModsTail.length() - MODS.length());
-  }
-
   // Metrics
   public long countAndReportActiveListeningDirsFileNumber() {
     long totalFileCount = 0;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java
index 20817c94146..0e565afd70c 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java
@@ -40,6 +40,7 @@ import org.apache.iotdb.db.queryengine.plan.statement.crud.LoadTsFileStatement;
 import org.apache.iotdb.db.queryengine.plan.statement.pipe.PipeEnrichedStatement;
 import org.apache.iotdb.db.storageengine.load.metrics.ActiveLoadingFilesNumberMetricsSet;
 import org.apache.iotdb.db.storageengine.load.metrics.ActiveLoadingFilesSizeMetricsSet;
+import org.apache.iotdb.db.storageengine.load.util.LoadUtil;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.apache.tsfile.external.commons.io.FileUtils;
@@ -297,8 +298,9 @@ public class ActiveLoadTsFileLoader {
 
   private void removeFileAndResourceAndModsToFailDir(final String filePath) {
     removeToFailDir(filePath);
-    removeToFailDir(filePath + ".resource");
-    removeToFailDir(filePath + ".mods");
+    removeToFailDir(LoadUtil.getTsFileResourcePath(filePath));
+    removeToFailDir(LoadUtil.getTsFileModsV1Path(filePath));
+    removeToFailDir(LoadUtil.getTsFileModsV2Path(filePath));
   }
 
   private void removeToFailDir(final String filePath) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/converter/LoadTableStatementDataTypeConvertExecutionVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/converter/LoadTableStatementDataTypeConvertExecutionVisitor.java
index 9a6be9737af..a011490ca49 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/converter/LoadTableStatementDataTypeConvertExecutionVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/converter/LoadTableStatementDataTypeConvertExecutionVisitor.java
@@ -27,9 +27,7 @@ import org.apache.iotdb.db.pipe.sink.payload.evolvable.request.PipeTransferTable
 import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.AstVisitor;
 import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.LoadTsFile;
 import org.apache.iotdb.db.queryengine.plan.statement.Statement;
-import org.apache.iotdb.db.storageengine.dataregion.modification.ModificationFile;
-import org.apache.iotdb.db.storageengine.dataregion.modification.v1.ModificationFileV1;
-import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
+import org.apache.iotdb.db.storageengine.load.util.LoadUtil;
 import org.apache.iotdb.pipe.api.event.dml.insertion.TabletInsertionEvent;
 import org.apache.iotdb.rpc.TSStatusCode;
 
@@ -125,9 +123,9 @@ public class LoadTableStatementDataTypeConvertExecutionVisitor
               tsfile -> {
                 FileUtils.deleteQuietly(tsfile);
                 final String tsFilePath = tsfile.getAbsolutePath();
-                FileUtils.deleteQuietly(new File(tsFilePath + TsFileResource.RESOURCE_SUFFIX));
-                FileUtils.deleteQuietly(new File(tsFilePath + ModificationFileV1.FILE_SUFFIX));
-                FileUtils.deleteQuietly(new File(tsFilePath + ModificationFile.FILE_SUFFIX));
+                FileUtils.deleteQuietly(new File(LoadUtil.getTsFileResourcePath(tsFilePath)));
+                FileUtils.deleteQuietly(new File(LoadUtil.getTsFileModsV1Path(tsFilePath)));
+                FileUtils.deleteQuietly(new File(LoadUtil.getTsFileModsV2Path(tsFilePath)));
               });
     }
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/converter/LoadTreeStatementDataTypeConvertExecutionVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/converter/LoadTreeStatementDataTypeConvertExecutionVisitor.java
index 2999d436c95..226966454aa 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/converter/LoadTreeStatementDataTypeConvertExecutionVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/converter/LoadTreeStatementDataTypeConvertExecutionVisitor.java
@@ -29,11 +29,9 @@ import org.apache.iotdb.db.queryengine.plan.statement.StatementNode;
 import org.apache.iotdb.db.queryengine.plan.statement.StatementVisitor;
 import org.apache.iotdb.db.queryengine.plan.statement.crud.InsertMultiTabletsStatement;
 import org.apache.iotdb.db.queryengine.plan.statement.crud.LoadTsFileStatement;
-import org.apache.iotdb.db.storageengine.dataregion.modification.ModificationFile;
-import org.apache.iotdb.db.storageengine.dataregion.modification.v1.ModificationFileV1;
-import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
 import org.apache.iotdb.db.storageengine.load.memory.LoadTsFileMemoryBlock;
 import org.apache.iotdb.db.storageengine.load.memory.LoadTsFileMemoryManager;
+import org.apache.iotdb.db.storageengine.load.util.LoadUtil;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.apache.tsfile.external.commons.io.FileUtils;
@@ -178,9 +176,9 @@ public class LoadTreeStatementDataTypeConvertExecutionVisitor
               tsfile -> {
                 FileUtils.deleteQuietly(tsfile);
                 final String tsFilePath = tsfile.getAbsolutePath();
-                FileUtils.deleteQuietly(new File(tsFilePath + TsFileResource.RESOURCE_SUFFIX));
-                FileUtils.deleteQuietly(new File(tsFilePath + ModificationFileV1.FILE_SUFFIX));
-                FileUtils.deleteQuietly(new File(tsFilePath + ModificationFile.FILE_SUFFIX));
+                FileUtils.deleteQuietly(new File(LoadUtil.getTsFileResourcePath(tsFilePath)));
+                FileUtils.deleteQuietly(new File(LoadUtil.getTsFileModsV1Path(tsFilePath)));
+                FileUtils.deleteQuietly(new File(LoadUtil.getTsFileModsV2Path(tsFilePath)));
               });
     }
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/util/LoadUtil.java
similarity index 74%
rename from iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java
rename to iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/util/LoadUtil.java
index e3dbe43507d..a3d29337b86 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadUtil.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/util/LoadUtil.java
@@ -17,11 +17,15 @@
  * under the License.
  */
 
-package org.apache.iotdb.db.storageengine.load.active;
+package org.apache.iotdb.db.storageengine.load.util;
 
 import org.apache.iotdb.commons.utils.RetryUtils;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.exception.DiskSpaceInsufficientException;
+import org.apache.iotdb.db.storageengine.dataregion.modification.ModificationFile;
+import org.apache.iotdb.db.storageengine.dataregion.modification.v1.ModificationFileV1;
+import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
+import org.apache.iotdb.db.storageengine.load.active.ActiveLoadPathHelper;
 import org.apache.iotdb.db.storageengine.load.disk.ILoadDiskSelector;
 import org.apache.iotdb.db.storageengine.rescon.disk.FolderManager;
 import org.apache.iotdb.db.storageengine.rescon.disk.strategy.DirectoryStrategyType;
@@ -40,9 +44,9 @@ import java.util.Objects;
 import static org.apache.iotdb.commons.utils.FileUtils.copyFileWithMD5Check;
 import static org.apache.iotdb.commons.utils.FileUtils.moveFileWithMD5Check;
 
-public class ActiveLoadUtil {
+public class LoadUtil {
 
-  private static final Logger LOGGER = LoggerFactory.getLogger(ActiveLoadUtil.class);
+  private static final Logger LOGGER = LoggerFactory.getLogger(LoadUtil.class);
 
   private static volatile ILoadDiskSelector loadDiskSelector = updateLoadDiskSelector();
 
@@ -68,6 +72,37 @@ public class ActiveLoadUtil {
     return true;
   }
 
+  public static String getTsFilePath(final String filePathWithResourceOrModsTail) {
+    if (filePathWithResourceOrModsTail.endsWith(TsFileResource.RESOURCE_SUFFIX)) {
+      return filePathWithResourceOrModsTail.substring(
+          0, filePathWithResourceOrModsTail.length() - TsFileResource.RESOURCE_SUFFIX.length());
+    }
+
+    if (filePathWithResourceOrModsTail.endsWith(ModificationFileV1.FILE_SUFFIX)) {
+      return filePathWithResourceOrModsTail.substring(
+          0, filePathWithResourceOrModsTail.length() - ModificationFileV1.FILE_SUFFIX.length());
+    }
+
+    if (filePathWithResourceOrModsTail.endsWith(ModificationFile.FILE_SUFFIX)) {
+      return filePathWithResourceOrModsTail.substring(
+          0, filePathWithResourceOrModsTail.length() - ModificationFile.FILE_SUFFIX.length());
+    }
+
+    return filePathWithResourceOrModsTail;
+  }
+
+  public static String getTsFileModsV1Path(final String tsFilePath) {
+    return tsFilePath + ModificationFileV1.FILE_SUFFIX;
+  }
+
+  public static String getTsFileModsV2Path(final String tsFilePath) {
+    return tsFilePath + ModificationFile.FILE_SUFFIX;
+  }
+
+  public static String getTsFileResourcePath(final String tsFilePath) {
+    return tsFilePath + TsFileResource.RESOURCE_SUFFIX;
+  }
+
   private static boolean loadTsFilesToActiveDir(
       final Map<String, String> loadAttributes, final File file, final boolean isDeleteAfterLoad)
       throws IOException {
@@ -93,9 +128,11 @@ public class ActiveLoadUtil {
     final File targetDir = ActiveLoadPathHelper.resolveTargetDir(targetFilePath, attributes);
 
     loadTsFileAsyncToTargetDir(
-        targetDir, new File(file.getAbsolutePath() + ".resource"), isDeleteAfterLoad);
+        targetDir, new File(getTsFileResourcePath(file.getAbsolutePath())), isDeleteAfterLoad);
+    loadTsFileAsyncToTargetDir(
+        targetDir, new File(getTsFileModsV1Path(file.getAbsolutePath())), isDeleteAfterLoad);
     loadTsFileAsyncToTargetDir(
-        targetDir, new File(file.getAbsolutePath() + ".mods"), isDeleteAfterLoad);
+        targetDir, new File(getTsFileModsV2Path(file.getAbsolutePath())), isDeleteAfterLoad);
     loadTsFileAsyncToTargetDir(targetDir, file, isDeleteAfterLoad);
     return true;
   }
@@ -182,7 +219,7 @@ public class ActiveLoadUtil {
               return new File(finalFolderManager.getNextFolder());
             });
 
-    ActiveLoadUtil.loadDiskSelector = loadDiskSelector;
+    LoadUtil.loadDiskSelector = loadDiskSelector;
     return loadDiskSelector;
   }
 }


(iotdb) 21/45: Pipe: Modify the Pipe configuration item log name to be consistent with the Properties name. (#16732)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 8fe93f2d6228eb02a171e36e37c5c851e0a2309a
Author: Zhenyu Luo <zh...@apache.org>
AuthorDate: Fri Nov 14 15:06:44 2025 +0800

    Pipe: Modify the Pipe configuration item log name to be consistent with the Properties name. (#16732)
    
    * Pipe: Modify the Pipe configuration item log name to be consistent with the Properties name.
    
    * update
    
    (cherry picked from commit a6191d916b2ceca7f3b22e728ae4117b99290261)
---
 .../thrift/async/IoTDBDataRegionAsyncSink.java     | 18 ++----
 .../apache/iotdb/commons/conf/CommonConfig.java    | 67 +++++++++++-----------
 .../iotdb/commons/pipe/config/PipeConfig.java      | 18 +++---
 .../iotdb/commons/pipe/config/PipeDescriptor.java  | 16 ++----
 4 files changed, 54 insertions(+), 65 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/async/IoTDBDataRegionAsyncSink.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/async/IoTDBDataRegionAsyncSink.java
index 567715e7292..e6e368a5280 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/async/IoTDBDataRegionAsyncSink.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/thrift/async/IoTDBDataRegionAsyncSink.java
@@ -539,14 +539,11 @@ public class IoTDBDataRegionAsyncSink extends IoTDBSink {
     if ((retryEventQueue.isEmpty() && retryTsFileQueue.isEmpty())
         || (!forced
             && retryEventQueueEventCounter.getTabletInsertionEventCount()
-                < PipeConfig.getInstance()
-                    .getPipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold()
+                < PipeConfig.getInstance().getPipeAsyncSinkForcedRetryTabletEventQueueSize()
             && retryEventQueueEventCounter.getTsFileInsertionEventCount()
-                < PipeConfig.getInstance()
-                    .getPipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold()
+                < PipeConfig.getInstance().getPipeAsyncSinkForcedRetryTsFileEventQueueSize()
             && retryEventQueue.size() + retryTsFileQueue.size()
-                < PipeConfig.getInstance()
-                    .getPipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold())) {
+                < PipeConfig.getInstance().getPipeAsyncSinkForcedRetryTotalEventQueueSize())) {
       return;
     }
 
@@ -604,14 +601,11 @@ public class IoTDBDataRegionAsyncSink extends IoTDBSink {
       if (System.currentTimeMillis() - retryStartTime
           > PipeConfig.getInstance().getPipeAsyncConnectorMaxRetryExecutionTimeMsPerCall()) {
         if (retryEventQueueEventCounter.getTabletInsertionEventCount()
-                < PipeConfig.getInstance()
-                    .getPipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold()
+                < PipeConfig.getInstance().getPipeAsyncSinkForcedRetryTabletEventQueueSize()
             && retryEventQueueEventCounter.getTsFileInsertionEventCount()
-                < PipeConfig.getInstance()
-                    .getPipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold()
+                < PipeConfig.getInstance().getPipeAsyncSinkForcedRetryTsFileEventQueueSize()
             && retryEventQueue.size() + retryTsFileQueue.size()
-                < PipeConfig.getInstance()
-                    .getPipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold()) {
+                < PipeConfig.getInstance().getPipeAsyncSinkForcedRetryTotalEventQueueSize()) {
           return;
         }
 
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index 9102a117eca..d83e96eb100 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -269,9 +269,9 @@ public class CommonConfig {
   private long pipeConnectorRetryIntervalMs = 1000L;
   private boolean pipeConnectorRPCThriftCompressionEnabled = false;
 
-  private int pipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold = 5;
-  private int pipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold = 20;
-  private int pipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold = 30;
+  private int pipeAsyncSinkForcedRetryTsFileEventQueueSize = 5;
+  private int pipeAsyncSinkForcedRetryTabletEventQueueSize = 20;
+  private int pipeAsyncSinkForcedRetryTotalEventQueueSize = 30;
   private long pipeAsyncConnectorMaxRetryExecutionTimeMsPerCall = 500;
   private int pipeAsyncConnectorSelectorNumber =
       Math.max(4, Runtime.getRuntime().availableProcessors() / 2);
@@ -1058,7 +1058,7 @@ public class CommonConfig {
     } finally {
       if (fPipeConnectorHandshakeTimeoutMs != this.pipeConnectorHandshakeTimeoutMs) {
         logger.info(
-            "pipeConnectorHandshakeTimeoutMs is set to {}.", fPipeConnectorHandshakeTimeoutMs);
+            "pipeConnectorHandshakeTimeoutMs is set to {}.", this.pipeConnectorHandshakeTimeoutMs);
       }
     }
   }
@@ -1127,55 +1127,54 @@ public class CommonConfig {
     return pipeConnectorRPCThriftCompressionEnabled;
   }
 
-  public void setPipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold(
-      int pipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold) {
-    if (this.pipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold
-        == pipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold) {
+  public void setPipeAsyncSinkForcedRetryTsFileEventQueueSize(
+      int pipeAsyncSinkForcedRetryTsFileEventQueueSize) {
+    if (this.pipeAsyncSinkForcedRetryTsFileEventQueueSize
+        == pipeAsyncSinkForcedRetryTsFileEventQueueSize) {
       return;
     }
-    this.pipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold =
-        pipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold;
+    this.pipeAsyncSinkForcedRetryTsFileEventQueueSize =
+        pipeAsyncSinkForcedRetryTsFileEventQueueSize;
     logger.info(
-        "pipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold is set to {}.",
-        pipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold);
+        "pipeAsyncSinkForcedRetryTsFileEventQueueSize is set to {}.",
+        pipeAsyncSinkForcedRetryTsFileEventQueueSize);
   }
 
-  public int getPipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold() {
-    return pipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold;
+  public int getPipeAsyncSinkForcedRetryTsFileEventQueueSize() {
+    return pipeAsyncSinkForcedRetryTsFileEventQueueSize;
   }
 
-  public void setPipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold(
-      int pipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold) {
-    if (this.pipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold
-        == pipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold) {
+  public void setPipeAsyncSinkForcedRetryTabletEventQueueSize(
+      int pipeAsyncSinkForcedRetryTabletEventQueueSize) {
+    if (this.pipeAsyncSinkForcedRetryTabletEventQueueSize
+        == pipeAsyncSinkForcedRetryTabletEventQueueSize) {
       return;
     }
-    this.pipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold =
-        pipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold;
+    this.pipeAsyncSinkForcedRetryTabletEventQueueSize =
+        pipeAsyncSinkForcedRetryTabletEventQueueSize;
     logger.info(
-        "pipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold is set to {}.",
-        pipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold);
+        "pipeAsyncSinkForcedRetryTabletEventQueueSize is set to {}.",
+        pipeAsyncSinkForcedRetryTabletEventQueueSize);
   }
 
-  public int getPipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold() {
-    return pipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold;
+  public int getPipeAsyncSinkForcedRetryTabletEventQueueSize() {
+    return pipeAsyncSinkForcedRetryTabletEventQueueSize;
   }
 
-  public void setPipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold(
-      int pipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold) {
-    if (this.pipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold
-        == pipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold) {
+  public void setPipeAsyncSinkForcedRetryTotalEventQueueSize(
+      int pipeAsyncSinkForcedRetryTotalEventQueueSize) {
+    if (this.pipeAsyncSinkForcedRetryTotalEventQueueSize
+        == pipeAsyncSinkForcedRetryTotalEventQueueSize) {
       return;
     }
-    this.pipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold =
-        pipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold;
+    this.pipeAsyncSinkForcedRetryTotalEventQueueSize = pipeAsyncSinkForcedRetryTotalEventQueueSize;
     logger.info(
-        "pipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold is set to {}.",
-        pipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold);
+        "pipeAsyncSinkForcedRetryTotalEventQueueSize is set to {}.",
+        pipeAsyncSinkForcedRetryTotalEventQueueSize);
   }
 
-  public int getPipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold() {
-    return pipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold;
+  public int getPipeAsyncSinkForcedRetryTotalEventQueueSize() {
+    return pipeAsyncSinkForcedRetryTotalEventQueueSize;
   }
 
   public void setPipeAsyncConnectorMaxRetryExecutionTimeMsPerCall(
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java
index 637628149b6..ce09fb1f291 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeConfig.java
@@ -183,16 +183,16 @@ public class PipeConfig {
     return COMMON_CONFIG.isPipeConnectorRPCThriftCompressionEnabled();
   }
 
-  public int getPipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold() {
-    return COMMON_CONFIG.getPipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold();
+  public int getPipeAsyncSinkForcedRetryTsFileEventQueueSize() {
+    return COMMON_CONFIG.getPipeAsyncSinkForcedRetryTsFileEventQueueSize();
   }
 
-  public int getPipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold() {
-    return COMMON_CONFIG.getPipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold();
+  public int getPipeAsyncSinkForcedRetryTabletEventQueueSize() {
+    return COMMON_CONFIG.getPipeAsyncSinkForcedRetryTabletEventQueueSize();
   }
 
-  public int getPipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold() {
-    return COMMON_CONFIG.getPipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold();
+  public int getPipeAsyncSinkForcedRetryTotalEventQueueSize() {
+    return COMMON_CONFIG.getPipeAsyncSinkForcedRetryTotalEventQueueSize();
   }
 
   public long getPipeAsyncConnectorMaxRetryExecutionTimeMsPerCall() {
@@ -541,13 +541,13 @@ public class PipeConfig {
 
     LOGGER.info(
         "PipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold: {}",
-        getPipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold());
+        getPipeAsyncSinkForcedRetryTsFileEventQueueSize());
     LOGGER.info(
         "PipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold: {}",
-        getPipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold());
+        getPipeAsyncSinkForcedRetryTabletEventQueueSize());
     LOGGER.info(
         "PipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold: {}",
-        getPipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold());
+        getPipeAsyncSinkForcedRetryTotalEventQueueSize());
     LOGGER.info(
         "PipeAsyncConnectorMaxRetryExecutionTimeMsPerCall: {}",
         getPipeAsyncConnectorMaxRetryExecutionTimeMsPerCall());
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java
index 77aae8a3252..928ff5f25a5 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/config/PipeDescriptor.java
@@ -368,7 +368,7 @@ public class PipeDescriptor {
                         "pipe_async_connector_max_retry_execution_time_ms_per_call",
                         String.valueOf(
                             config.getPipeAsyncConnectorMaxRetryExecutionTimeMsPerCall())))));
-    config.setPipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold(
+    config.setPipeAsyncSinkForcedRetryTsFileEventQueueSize(
         Integer.parseInt(
             Optional.ofNullable(
                     properties.getProperty("pipe_async_sink_forced_retry_tsfile_event_queue_size"))
@@ -376,9 +376,8 @@ public class PipeDescriptor {
                     properties.getProperty(
                         "pipe_async_connector_forced_retry_tsfile_event_queue_size",
                         String.valueOf(
-                            config
-                                .getPipeAsyncConnectorForcedRetryTsFileEventQueueSizeThreshold())))));
-    config.setPipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold(
+                            config.getPipeAsyncSinkForcedRetryTsFileEventQueueSize())))));
+    config.setPipeAsyncSinkForcedRetryTabletEventQueueSize(
         Integer.parseInt(
             Optional.ofNullable(
                     properties.getProperty("pipe_async_sink_forced_retry_tablet_event_queue_size"))
@@ -386,18 +385,15 @@ public class PipeDescriptor {
                     properties.getProperty(
                         "pipe_async_connector_forced_retry_tablet_event_queue_size",
                         String.valueOf(
-                            config
-                                .getPipeAsyncConnectorForcedRetryTabletEventQueueSizeThreshold())))));
-    config.setPipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold(
+                            config.getPipeAsyncSinkForcedRetryTabletEventQueueSize())))));
+    config.setPipeAsyncSinkForcedRetryTotalEventQueueSize(
         Integer.parseInt(
             Optional.ofNullable(
                     properties.getProperty("pipe_async_sink_forced_retry_total_event_queue_size"))
                 .orElse(
                     properties.getProperty(
                         "pipe_async_connector_forced_retry_total_event_queue_size",
-                        String.valueOf(
-                            config
-                                .getPipeAsyncConnectorForcedRetryTotalEventQueueSizeThreshold())))));
+                        String.valueOf(config.getPipeAsyncSinkForcedRetryTotalEventQueueSize())))));
     config.setRateLimiterHotReloadCheckIntervalMs(
         Integer.parseInt(
             properties.getProperty(


(iotdb) 05/45: Changed the SQL of AlterEncodingCompressor statement & banned the "root" timeSeries & handled the empty intersection path & refactored the IT (#16725)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 6f47cca0efbdb381b03135f752a42aaa87e8fb0d
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Mon Nov 10 19:28:00 2025 +0800

    Changed the SQL of AlterEncodingCompressor statement & banned the "root" timeSeries & handled the empty intersection path & refactored the IT (#16725)
    
    (cherry picked from commit b4d5b4235e12763466df989492f2d54ec0ed5b0d)
---
 .../it/schema/IoTDBAlterEncodingCompressorIT.java  | 44 ++++++++++++++++------
 .../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4   |  2 +-
 .../antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4  |  4 ++
 .../config/executor/ClusterConfigTaskExecutor.java |  5 +++
 .../db/queryengine/plan/parser/ASTVisitor.java     |  3 ++
 5 files changed, 46 insertions(+), 12 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAlterEncodingCompressorIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAlterEncodingCompressorIT.java
index 42c0275ab35..7c9495d16eb 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAlterEncodingCompressorIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAlterEncodingCompressorIT.java
@@ -72,7 +72,15 @@ public class IoTDBAlterEncodingCompressorIT extends AbstractSchemaIT {
       statement.execute("create timeSeries root.vehicle.wind.a int32");
 
       try {
-        statement.execute("alter timeSeries root.nonExist.** set encoding=PLAIN");
+        statement.execute("alter timeSeries root set STORAGE_PROPERTIES encoding=PLAIN");
+        fail();
+      } catch (final SQLException e) {
+        Assert.assertEquals("701: The timeSeries shall not be root.", e.getMessage());
+      }
+
+      try {
+        statement.execute(
+            "alter timeSeries root.nonExist.** set STORAGE_PROPERTIES encoding=PLAIN");
         fail();
       } catch (final SQLException e) {
         Assert.assertEquals(
@@ -81,41 +89,47 @@ public class IoTDBAlterEncodingCompressorIT extends AbstractSchemaIT {
       }
 
       try {
-        statement.execute("alter timeSeries if exists root.nonExist.** set encoding=PLAIN");
+        statement.execute(
+            "alter timeSeries if exists root.nonExist.** set STORAGE_PROPERTIES encoding=PLAIN");
       } catch (final SQLException e) {
         fail(
             "Alter encoding & compressor shall not fail when timeSeries not exists if set if exists");
       }
 
       try {
-        statement.execute("alter timeSeries if exists root.vehicle.** set encoding=aaa");
+        statement.execute(
+            "alter timeSeries if exists root.vehicle.** set STORAGE_PROPERTIES encoding=aaa");
         fail();
       } catch (final SQLException e) {
         Assert.assertEquals("701: Unsupported encoding: AAA", e.getMessage());
       }
 
       try {
-        statement.execute("alter timeSeries if exists root.vehicle.** set compressor=aaa");
+        statement.execute(
+            "alter timeSeries if exists root.vehicle.** set STORAGE_PROPERTIES compressor=aaa");
         fail();
       } catch (final SQLException e) {
         Assert.assertEquals("701: Unsupported compressor: AAA", e.getMessage());
       }
 
       try {
-        statement.execute("alter timeSeries if exists root.vehicle.** set falseKey=aaa");
+        statement.execute(
+            "alter timeSeries if exists root.vehicle.** set STORAGE_PROPERTIES falseKey=aaa");
         fail();
       } catch (final SQLException e) {
         Assert.assertEquals("701: property falsekey is unsupported yet.", e.getMessage());
       }
 
       try {
-        statement.execute("alter timeSeries if exists root.vehicle.** set encoding=DICTIONARY");
+        statement.execute(
+            "alter timeSeries if exists root.vehicle.** set STORAGE_PROPERTIES encoding=DICTIONARY");
         fail();
       } catch (final SQLException e) {
         Assert.assertTrue(e.getMessage().contains("encoding DICTIONARY does not support INT32"));
       }
 
-      statement.execute("alter timeSeries root.** set encoding=Plain, compressor=LZMA2");
+      statement.execute(
+          "alter timeSeries root.** set STORAGE_PROPERTIES encoding=Plain, compressor=LZMA2");
 
       try (final ResultSet resultSet = statement.executeQuery("SHOW TIMESERIES")) {
         while (resultSet.next()) {
@@ -133,17 +147,18 @@ public class IoTDBAlterEncodingCompressorIT extends AbstractSchemaIT {
             EnvFactory.getEnv().getConnection("IoTDBUser", "!@#$!dfdfzvd343");
         final Statement statement = connection.createStatement()) {
       try {
-        statement.execute("alter timeSeries root.vechile.** set encoding=PLAIN, compressor=LZMA2");
+        statement.execute(
+            "alter timeSeries root.vehicle.** set STORAGE_PROPERTIES encoding=PLAIN, compressor=LZMA2");
         fail();
       } catch (final SQLException e) {
         Assert.assertEquals(
-            "803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.vechile.**]",
+            "803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.vehicle.**]",
             e.getMessage());
       }
 
       try {
         statement.execute(
-            "alter timeSeries root.vechile.wind.a, root.__audit.** set encoding=PLAIN, compressor=LZMA2");
+            "alter timeSeries root.vehicle.wind.a, root.__audit.** set STORAGE_PROPERTIES encoding=PLAIN, compressor=LZMA2");
         fail();
       } catch (final SQLException e) {
         Assert.assertEquals(
@@ -153,10 +168,17 @@ public class IoTDBAlterEncodingCompressorIT extends AbstractSchemaIT {
 
       try {
         statement.execute(
-            "alter timeSeries if permitted root.vehicle.**, root.__audit.** set encoding=GORILLA, compressor=GZIP");
+            "alter timeSeries if permitted root.vehicle.**, root.__audit.** set STORAGE_PROPERTIES encoding=GORILLA, compressor=GZIP");
       } catch (final SQLException e) {
         fail("Alter encoding & compressor shall not fail when no privileges if set if permitted");
       }
+
+      try {
+        statement.execute(
+            "alter timeSeries if permitted root.nonExist.** set STORAGE_PROPERTIES encoding=GORILLA, compressor=GZIP");
+      } catch (final SQLException e) {
+        fail("Alter encoding & compressor shall not fail if the intersected paths are empty");
+      }
     }
 
     try (final Connection connection = EnvFactory.getEnv().getConnection();
diff --git a/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 b/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
index 7fd2bd49033..8a1a0f5468f 100644
--- a/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
+++ b/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4
@@ -178,7 +178,7 @@ alterClause
     ;
 
 alterEncodingCompressor
-    : ALTER TIMESERIES (IF EXISTS)? (IF PERMITTED)? prefixPath (COMMA prefixPath)* SET attributePair (COMMA attributePair)*
+    : ALTER TIMESERIES (IF EXISTS)? (IF PERMITTED)? prefixPath (COMMA prefixPath)* SET STORAGE_PROPERTIES attributePair (COMMA attributePair)*
     ;
 
 aliasClause
diff --git a/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4 b/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
index 7a0c1969398..f63fd211149 100644
--- a/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
+++ b/iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
@@ -846,6 +846,10 @@ STOP
     : S T O P
     ;
 
+STORAGE_PROPERTIES
+    : S T O R A G E '_' P R O P E R T I E S
+    ;
+
 SUBSCRIPTION
     : S U B S C R I P T I O N
     ;
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
index 71b6f58f83e..517e201f3d8 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
@@ -2803,6 +2803,11 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
       final String queryId,
       final AlterEncodingCompressorStatement alterEncodingCompressorStatement) {
     final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
+    // Will only occur if no permission
+    if (alterEncodingCompressorStatement.getPatternTree().isEmpty()) {
+      future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS));
+      return future;
+    }
     final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
     final DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
     try {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
index 64d606ef72e..123f7dcae52 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java
@@ -695,6 +695,9 @@ public class ASTVisitor extends IoTDBSqlParserBaseVisitor<Statement> {
       }
     }
 
+    if (tree.isEmpty()) {
+      throw new SemanticException("The timeSeries shall not be root.");
+    }
     return new AlterEncodingCompressorStatement(
         tree,
         encoding,


(iotdb) 29/45: Load: Fixed the bug that mods is not deleted in load tsFile when there are exceptions & Fixed the potential NPE in air gap agent close() method (#16775)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit c110ab10c03fd88f89f57d8daff081fd09f8c7b7
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Tue Nov 18 22:48:34 2025 +0800

    Load: Fixed the bug that mods is not deleted in load tsFile when there are exceptions & Fixed the potential NPE in air gap agent close() method (#16775)
    
    (cherry picked from commit 2c381feda256c8441492203beaf88a0ff2f2b70c)
---
 .../receiver/protocol/airgap/IoTDBAirGapReceiverAgent.java |  5 ++++-
 .../PipeTableStatementDataTypeConvertExecutionVisitor.java |  4 ++--
 .../PipeTreeStatementDataTypeConvertExecutionVisitor.java  |  4 ++--
 .../iotdb/db/storageengine/load/LoadTsFileManager.java     | 14 ++++++++++++++
 4 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/airgap/IoTDBAirGapReceiverAgent.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/airgap/IoTDBAirGapReceiverAgent.java
index 644bda1835c..1aa828a4f8c 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/airgap/IoTDBAirGapReceiverAgent.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/airgap/IoTDBAirGapReceiverAgent.java
@@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.net.ServerSocket;
 import java.net.Socket;
+import java.util.Objects;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicLong;
@@ -84,7 +85,9 @@ public class IoTDBAirGapReceiverAgent implements IService {
   @Override
   public void stop() {
     try {
-      serverSocket.close();
+      if (Objects.nonNull(serverSocket)) {
+        serverSocket.close();
+      }
     } catch (final IOException e) {
       LOGGER.warn("Failed to close IoTDBAirGapReceiverAgent's server socket", e);
     }
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeTableStatementDataTypeConvertExecutionVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeTableStatementDataTypeConvertExecutionVisitor.java
index 4bb1f8d2e17..d79b05f2faf 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeTableStatementDataTypeConvertExecutionVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeTableStatementDataTypeConvertExecutionVisitor.java
@@ -37,10 +37,10 @@ import org.apache.iotdb.db.queryengine.plan.statement.crud.InsertRowsOfOneDevice
 import org.apache.iotdb.db.queryengine.plan.statement.crud.InsertRowsStatement;
 import org.apache.iotdb.db.queryengine.plan.statement.crud.InsertTabletStatement;
 import org.apache.iotdb.db.queryengine.plan.statement.crud.LoadTsFileStatement;
+import org.apache.iotdb.db.storageengine.load.LoadTsFileManager;
 import org.apache.iotdb.pipe.api.event.dml.insertion.TabletInsertionEvent;
 import org.apache.iotdb.rpc.TSStatusCode;
 
-import org.apache.tsfile.external.commons.io.FileUtils;
 import org.apache.tsfile.utils.Pair;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -193,7 +193,7 @@ public class PipeTableStatementDataTypeConvertExecutionVisitor
     }
 
     if (loadTsFileStatement.isDeleteAfterLoad()) {
-      loadTsFileStatement.getTsFiles().forEach(FileUtils::deleteQuietly);
+      loadTsFileStatement.getTsFiles().forEach(LoadTsFileManager::cleanTsFile);
     }
 
     LOGGER.warn(
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeTreeStatementDataTypeConvertExecutionVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeTreeStatementDataTypeConvertExecutionVisitor.java
index e9707299e09..282b378a2d2 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeTreeStatementDataTypeConvertExecutionVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeTreeStatementDataTypeConvertExecutionVisitor.java
@@ -36,9 +36,9 @@ import org.apache.iotdb.db.queryengine.plan.statement.crud.InsertRowsOfOneDevice
 import org.apache.iotdb.db.queryengine.plan.statement.crud.InsertRowsStatement;
 import org.apache.iotdb.db.queryengine.plan.statement.crud.InsertTabletStatement;
 import org.apache.iotdb.db.queryengine.plan.statement.crud.LoadTsFileStatement;
+import org.apache.iotdb.db.storageengine.load.LoadTsFileManager;
 import org.apache.iotdb.rpc.TSStatusCode;
 
-import org.apache.tsfile.external.commons.io.FileUtils;
 import org.apache.tsfile.utils.Pair;
 import org.apache.tsfile.write.record.Tablet;
 import org.slf4j.Logger;
@@ -153,7 +153,7 @@ public class PipeTreeStatementDataTypeConvertExecutionVisitor
     }
 
     if (loadTsFileStatement.isDeleteAfterLoad()) {
-      loadTsFileStatement.getTsFiles().forEach(FileUtils::deleteQuietly);
+      loadTsFileStatement.getTsFiles().forEach(LoadTsFileManager::cleanTsFile);
     }
 
     LOGGER.warn(
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/LoadTsFileManager.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/LoadTsFileManager.java
index f6203be7be3..30bb64cbd31 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/LoadTsFileManager.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/LoadTsFileManager.java
@@ -46,6 +46,7 @@ import org.apache.iotdb.db.schemaengine.table.DataNodeTableCache;
 import org.apache.iotdb.db.storageengine.dataregion.DataRegion;
 import org.apache.iotdb.db.storageengine.dataregion.flush.MemTableFlushTask;
 import org.apache.iotdb.db.storageengine.dataregion.modification.ModificationFile;
+import org.apache.iotdb.db.storageengine.dataregion.modification.v1.ModificationFileV1;
 import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
 import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResourceStatus;
 import org.apache.iotdb.db.storageengine.load.active.ActiveLoadAgent;
@@ -400,6 +401,19 @@ public class LoadTsFileManager {
     }
   }
 
+  public static void cleanTsFile(final File tsFile) {
+    try {
+      Files.deleteIfExists(tsFile.toPath());
+      Files.deleteIfExists(
+          new File(tsFile.getAbsolutePath() + TsFileResource.RESOURCE_SUFFIX).toPath());
+      Files.deleteIfExists(ModificationFile.getExclusiveMods(tsFile).toPath());
+      Files.deleteIfExists(
+          new File(tsFile.getAbsolutePath() + ModificationFileV1.FILE_SUFFIX).toPath());
+    } catch (final IOException e) {
+      LOGGER.warn("Delete After Loading {} error.", tsFile, e);
+    }
+  }
+
   private static class TsFileWriterManager {
 
     private final File taskDir;


(iotdb) 19/45: Pipe: Trimmed some of the pipe logs (#16747)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 401c5e9208e88252fd8b68bf98be2e4d781ff06e
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Thu Nov 13 14:23:43 2025 +0800

    Pipe: Trimmed some of the pipe logs (#16747)
    
    * fix
    
    * fix
    
    (cherry picked from commit e53d27c0ad096a0788ac9da2664b35ddaf1bde02)
---
 .../src/assembly/resources/conf/logback-datanode.xml      | 15 ---------------
 .../receiver/visitor/PipeStatementTSStatusVisitor.java    |  5 +++--
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/iotdb-core/datanode/src/assembly/resources/conf/logback-datanode.xml b/iotdb-core/datanode/src/assembly/resources/conf/logback-datanode.xml
index 557fd8b160f..e827a7cbef2 100644
--- a/iotdb-core/datanode/src/assembly/resources/conf/logback-datanode.xml
+++ b/iotdb-core/datanode/src/assembly/resources/conf/logback-datanode.xml
@@ -207,21 +207,6 @@
             <level>INFO</level>
         </filter>
     </appender>
-    <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="PIPE">
-        <file>${IOTDB_HOME}/logs/log_datanode_pipe.log</file>
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>${IOTDB_HOME}/logs/log-datanode-pipe-%d{yyyyMMdd}.log.gz</fileNamePattern>
-            <maxHistory>30</maxHistory>
-        </rollingPolicy>
-        <append>true</append>
-        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
-            <pattern>%d [%t] %-5p %C{25}:%L - %m %n</pattern>
-            <charset>utf-8</charset>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>INFO</level>
-        </filter>
-    </appender>
     <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="EXPLAIN_ANALYZE">
         <file>${IOTDB_HOME}/logs/log_explain_analyze.log</file>
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTSStatusVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTSStatusVisitor.java
index 31eecc7b3a9..198e8edb677 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTSStatusVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/visitor/PipeStatementTSStatusVisitor.java
@@ -98,8 +98,9 @@ public class PipeStatementTSStatusVisitor extends StatementVisitor<TSStatus, TSS
   @Override
   public TSStatus visitInsertBase(
       final InsertBaseStatement insertBaseStatement, final TSStatus context) {
-    if (context.getCode() == TSStatusCode.SYSTEM_READ_ONLY.getStatusCode()
-        || context.getCode() == TSStatusCode.WRITE_PROCESS_REJECT.getStatusCode()) {
+    // If the system is read-only, we shall not classify it into temporary unavailable exception to
+    // avoid to many logs
+    if (context.getCode() == TSStatusCode.WRITE_PROCESS_REJECT.getStatusCode()) {
       return new TSStatus(
               TSStatusCode.PIPE_RECEIVER_TEMPORARY_UNAVAILABLE_EXCEPTION.getStatusCode())
           .setMessage(context.getMessage());


(iotdb) 41/45: Fix that settle compaction may lgnore some newly incoming deletions (#16799)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 60e8c6352c325d67c15c56164405f2f76e03a193
Author: Jiang Tian <jt...@163.com>
AuthorDate: Tue Nov 25 18:12:44 2025 +0800

    Fix that settle compaction may lgnore some newly incoming deletions (#16799)
    
    * Fix that settle compaction may lgnore some newly incoming deletions
    
    * spotless
    
    * fix order
    
    (cherry picked from commit 0c23da2551fc86f726a99e6d7376b3239c4d389d)
---
 .../org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java  | 6 +++++-
 .../dataregion/compaction/execute/task/SettleCompactionTask.java    | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java
index d08e26be4f0..3d61b64e71a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java
@@ -1741,7 +1741,11 @@ public class IoTDBDeletionTableIT {
     List<TimeRange> ranges = new ArrayList<>();
     try (ResultSet set =
         statement.executeQuery(
-            "select time from table" + testNum + " where time <= " + timeUpperBound)) {
+            "select time from table"
+                + testNum
+                + " where time <= "
+                + timeUpperBound
+                + " order by time")) {
       while (set.next()) {
         long time = set.getLong(1);
         if (ranges.isEmpty()) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/SettleCompactionTask.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/SettleCompactionTask.java
index 79d6a41025b..7543d56ce80 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/SettleCompactionTask.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/task/SettleCompactionTask.java
@@ -138,8 +138,12 @@ public class SettleCompactionTask extends InnerSpaceCompactionTask {
         new File(
             allSourceFiles.get(0).getTsFile().getAbsolutePath()
                 + CompactionLogger.SETTLE_COMPACTION_LOG_NAME_SUFFIX);
+
     try (SimpleCompactionLogger compactionLogger = new SimpleCompactionLogger(logFile)) {
       calculateSourceFilesAndTargetFiles();
+      CompactionUtils.prepareCompactionModFiles(
+          filesView.targetFilesInPerformer, filesView.sourceFilesInCompactionPerformer);
+
       isHoldingWriteLock = new boolean[this.filesView.sourceFilesInLog.size()];
       Arrays.fill(isHoldingWriteLock, false);
       compactionLogger.logSourceFiles(fullyDirtyFiles);


(iotdb) 24/45: fix (#16702)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch force_ci/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 71976f5ba5eebb3e6cccf055fbedcad3501c9db9
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Mon Nov 17 11:20:16 2025 +0800

    fix (#16702)
    
    (cherry picked from commit 3a6322028cd6026df7ebc8a97020e45fc5d8bf00)
---
 .../pipe/receiver/PipeReceiverStatusHandler.java   | 134 ++++++++++-----------
 1 file changed, 64 insertions(+), 70 deletions(-)

diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/PipeReceiverStatusHandler.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/PipeReceiverStatusHandler.java
index 350746d7b8e..9fe87b22fd7 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/PipeReceiverStatusHandler.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/PipeReceiverStatusHandler.java
@@ -45,6 +45,9 @@ import java.util.concurrent.atomic.AtomicReference;
 public class PipeReceiverStatusHandler {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(PipeReceiverStatusHandler.class);
+  private static final String NO_PERMISSION = "No permission";
+  private static final String UNCLASSIFIED_EXCEPTION = "Unclassified exception";
+  private static final String NO_PERMISSION_STR = "No permissions for this operation";
 
   private static final int CONFLICT_RETRY_MAX_TIMES = 100;
 
@@ -183,83 +186,74 @@ public class PipeReceiverStatusHandler {
         if (skipIfNoPrivileges) {
           return;
         }
-
-        synchronized (this) {
-          recordExceptionStatusIfNecessary(recordMessage);
-
-          if (exceptionEventHasBeenRetried.get()
-              && System.currentTimeMillis() - exceptionFirstEncounteredTime.get()
-                  > retryMaxMillisWhenOtherExceptionsOccur) {
-            LOGGER.warn(
-                "No permission: retry timeout. will be ignored. event: {}. status: {}",
-                shouldRecordIgnoredDataWhenOtherExceptionsOccur ? recordMessage : "not recorded",
-                status);
-            resetExceptionStatus();
+        handleOtherExceptions(status, exceptionMessage, recordMessage, true);
+        break;
+      case 305:
+        handleOtherExceptions(status, exceptionMessage, recordMessage, false);
+        break;
+      default:
+        // Some auth error may be wrapped in other codes
+        if (exceptionMessage.contains(NO_PERMISSION_STR)) {
+          if (skipIfNoPrivileges) {
             return;
           }
-
-          // Reduce the log if retry forever
-          if (retryMaxMillisWhenOtherExceptionsOccur == Long.MAX_VALUE) {
-            PipeLogger.log(LOGGER::warn, "No permission: will retry forever. status: %s", status);
-          } else {
-            LOGGER.warn(
-                "No permission: will retry for at least {} seconds. status: {}",
-                (retryMaxMillisWhenOtherExceptionsOccur
-                        + exceptionFirstEncounteredTime.get()
-                        - System.currentTimeMillis())
-                    / 1000.0,
-                status);
-          }
-
-          exceptionEventHasBeenRetried.set(true);
-          throw new PipeRuntimeSinkRetryTimesConfigurableException(
-              exceptionMessage,
-              (int)
-                  Math.max(
-                      PipeSubtask.MAX_RETRY_TIMES,
-                      Math.min(
-                          CONFLICT_RETRY_MAX_TIMES, retryMaxMillisWhenOtherExceptionsOccur * 1.1)));
+          handleOtherExceptions(status, exceptionMessage, recordMessage, true);
+          break;
         }
+        // Other exceptions
+        handleOtherExceptions(status, exceptionMessage, recordMessage, false);
+        break;
+    }
+  }
 
-      default: // Other exceptions
-        synchronized (this) {
-          recordExceptionStatusIfNecessary(recordMessage);
+  private synchronized void handleOtherExceptions(
+      final TSStatus status,
+      final String exceptionMessage,
+      final String recordMessage,
+      final boolean noPermission) {
+    recordExceptionStatusIfNecessary(recordMessage);
+
+    if (exceptionEventHasBeenRetried.get()
+        && System.currentTimeMillis() - exceptionFirstEncounteredTime.get()
+            > retryMaxMillisWhenOtherExceptionsOccur) {
+      LOGGER.warn(
+          "{}: retry timeout. will be ignored. event: {}. status: {}",
+          getNoPermission(noPermission),
+          shouldRecordIgnoredDataWhenOtherExceptionsOccur ? recordMessage : "not recorded",
+          status);
+      resetExceptionStatus();
+      return;
+    }
 
-          if (exceptionEventHasBeenRetried.get()
-              && System.currentTimeMillis() - exceptionFirstEncounteredTime.get()
-                  > retryMaxMillisWhenOtherExceptionsOccur) {
-            LOGGER.warn(
-                "Unclassified exception: retry timeout. will be ignored. event: {}. status: {}",
-                shouldRecordIgnoredDataWhenOtherExceptionsOccur ? recordMessage : "not recorded",
-                status);
-            resetExceptionStatus();
-            return;
-          }
+    // Reduce the log if retry forever
+    if (retryMaxMillisWhenOtherExceptionsOccur == Long.MAX_VALUE) {
+      PipeLogger.log(
+          LOGGER::warn,
+          "%s: will retry forever. status: %s",
+          getNoPermission(noPermission),
+          status);
+    } else {
+      LOGGER.warn(
+          "{}: will retry for at least {} seconds. status: {}",
+          getNoPermission(noPermission),
+          (retryMaxMillisWhenOtherExceptionsOccur
+                  + exceptionFirstEncounteredTime.get()
+                  - System.currentTimeMillis())
+              / 1000.0,
+          status);
+    }
 
-          // Reduce the log if retry forever
-          if (retryMaxMillisWhenOtherExceptionsOccur == Long.MAX_VALUE) {
-            PipeLogger.log(
-                LOGGER::warn, "Unclassified exception: will retry forever. status: %s", status);
-          } else {
-            LOGGER.warn(
-                "Unclassified exception: will retry for at least {} seconds. status: {}",
-                (retryMaxMillisWhenOtherExceptionsOccur
-                        + exceptionFirstEncounteredTime.get()
-                        - System.currentTimeMillis())
-                    / 1000.0,
-                status);
-          }
+    exceptionEventHasBeenRetried.set(true);
+    throw new PipeRuntimeSinkRetryTimesConfigurableException(
+        exceptionMessage,
+        (int)
+            Math.max(
+                PipeSubtask.MAX_RETRY_TIMES,
+                Math.min(CONFLICT_RETRY_MAX_TIMES, retryMaxMillisWhenOtherExceptionsOccur * 1.1)));
+  }
 
-          exceptionEventHasBeenRetried.set(true);
-          throw new PipeRuntimeSinkRetryTimesConfigurableException(
-              exceptionMessage,
-              (int)
-                  Math.max(
-                      PipeSubtask.MAX_RETRY_TIMES,
-                      Math.min(
-                          CONFLICT_RETRY_MAX_TIMES, retryMaxMillisWhenOtherExceptionsOccur * 1.1)));
-        }
-    }
+  private static String getNoPermission(final boolean noPermission) {
+    return noPermission ? NO_PERMISSION : UNCLASSIFIED_EXCEPTION;
   }
 
   private void recordExceptionStatusIfNecessary(final String message) {