This is an automated email from the ASF dual-hosted git repository. jt2594838 pushed a commit to branch insert_numeric_row in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 76b6fbf439aafd723324df5ede65688a013ec606 Merge: d29c9c420a3 fea5bd2490a Author: Tian Jiang <[email protected]> AuthorDate: Mon Oct 12 11:38:15 2026 +0800 Merge apache/iotdb master and preserve numeric row DATE conversion .github/scripts/test-edge-ops.py | 2 - .github/workflows/client-cpp-package.yml | 38 +- .github/workflows/multi-language-client.yml | 19 +- .mvn/extensions.xml | 2 +- LICENSE | 56 + LICENSE-binary | 25 +- NOTICE | 10 +- architecture-test/pom.xml | 284 + .../db/utils/TSDataTypeSwitchArchitectureTest.java | 23 +- .../iotdb/db/utils/TSDataTypeSwitchRule.java | 182 + .../iotdb/db/utils/TSDataTypeSwitchRuleTest.java | 186 + dependencies.json | 3 - distribution/pom.xml | 15 +- distribution/src/assembly/ainode-common-files.xml | 52 + distribution/src/assembly/ainode.xml | 2 +- distribution/src/assembly/cli.xml | 74 - distribution/src/assembly/confignode.xml | 92 - distribution/src/assembly/datanode.xml | 94 - distribution/src/assembly/library-pipe.xml | 51 + docker/ReadMe.md | 21 +- docker/src/main/DockerCompose/do-docker-build.sh | 6 +- docker/src/main/Dockerfile-1.0.0-confignode | 4 +- docker/src/main/Dockerfile-1.0.0-datanode | 7 +- docker/src/main/Dockerfile-1.0.0-standalone | 2 +- docker/src/main/Dockerfile-1c1d | 2 +- .../org/apache/iotdb/TableModelJDBCExample.java | 8 +- example/pom.xml | 1 - .../org/apache/iotdb/DataMigrationExample.java | 64 +- .../main/java/org/apache/iotdb/TabletExample.java | 56 +- example/udf/pom.xml | 6 + .../java/org/apache/iotdb/udf/UDAFExample.java | 106 +- .../v1/handler/StatementConstructionHandler.java | 113 +- .../rest/protocol/utils/InsertRowDataUtils.java | 109 +- .../iotdb/rest/protocol/utils/TypeServices.java | 162 + .../v1/handler/StatementConstructionHandler.java | 113 +- .../v2/handler/StatementConstructionHandler.java | 113 +- .../protocol/v2/handler/FastLastHandlerTest.java | 5 +- integration-test/pom.xml | 7 + .../apache/iotdb/db/query/udf/example/TwoSum.java | 44 +- .../apache/iotdb/db/query/udf/example/UDAFAvg.java | 112 +- .../apache/iotdb/db/query/udf/example/UDAFSum.java | 112 +- .../org/apache/iotdb/it/env/cluster/EnvUtils.java | 12 + .../it/env/cluster/config/MppConfigNodeConfig.java | 6 + .../it/env/cluster/config/MppDataNodeConfig.java | 15 + .../iotdb/it/env/cluster/env/AbstractEnv.java | 6 +- .../env/remote/config/RemoteConfigNodeConfig.java | 5 + .../it/env/remote/config/RemoteDataNodeConfig.java | 11 + .../apache/iotdb/itbase/env/ConfigNodeConfig.java | 2 + .../apache/iotdb/itbase/env/DataNodeConfig.java | 4 + .../it/cluster/IoTDBClusterNodeErrorStartUpIT.java | 31 +- .../it/cluster/IoTDBClusterNodeShutdownHookIT.java | 60 +- .../it/cluster/IoTDBNodeStatusFailoverIT.java | 743 +++ .../it/cluster/IoTDBNodeStatusPersistenceIT.java | 379 ++ .../confignode/it/cluster/NodeStatusTestAgent.java | 203 + .../load/IoTDBRegionGroupLeaderDistributionIT.java | 3 +- .../IoTDBAutoRegionGroupExtension2IT.java | 4 +- .../it/partition/IoTDBPartitionCreationIT.java | 58 +- .../it/partition/IoTDBPartitionDurableIT.java | 49 +- .../IoTDBProactiveRegionGroupDistributionIT.java | 1471 +++++ .../IoTDBProactiveRegionGroupExtensionIT.java | 368 ++ .../commit/IoTDBMigrateMultiRegionForIoTV1IT.java | 9 +- .../IoTDBRegionGroupExpandAndShrinkForIoTV1IT.java | 123 +- .../IoTDBRemoveConfigNodeSchemaPartitionIT.java | 262 + .../org/apache/iotdb/db/it/IoTDBLoadTsFileIT.java | 27 + .../it/IoTDBRecreatedTimeseriesCompactionIT.java | 125 + .../org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java | 24 +- .../iotdb/db/it/auth/IoTDBSeriesPermissionIT.java | 68 + .../db/it/last/IoTDBLastQueryVirtualRegionIT.java | 137 + .../basic/IoTDBPipeRelationalSecurityIT.java | 162 + .../treemodel/auto/basic/IoTDBPipeAutoSplitIT.java | 19 +- .../auto/basic/IoTDBShowReceiversLifecycleIT.java | 366 ++ .../auto/enhanced/IoTDBPipeAutoDropIT.java | 6 + .../auto/enhanced/IoTDBPipeSinkCompressionIT.java | 12 +- .../iotdb/pipe/it/single/AbstractPipeSingleIT.java | 70 +- .../single/IoTDBLegacyPipeReceiverSecurityIT.java | 219 + .../iotdb/pipe/it/single/IoTDBPipeOPCUAIT.java | 17 +- .../pipe/it/single/IoTDBPipePermissionIT.java | 9 +- .../iotdb/pipe/it/single/IoTDBPipeReceiverIT.java | 631 --- .../iotdb/pipe/it/single/IoTDBShowReceiversIT.java | 719 +++ .../pipe/it/triple/IoTDBShowReceiversTripleIT.java | 287 + .../it/db/it/IoTDBDeletionTableClusterIT.java | 152 + .../relational/it/db/it/IoTDBDeletionTableIT.java | 57 + .../relational/it/db/it/IoTDBInsertTableIT.java | 117 + .../db/it/IoTDBMultiTAGsWithAttributesTableIT.java | 10 +- .../it/db/it/IoTDBOrderingPropertyIT.java | 486 ++ .../it/db/it/IoTDBSetSystemStatusTableIT.java | 70 +- .../it/db/it/IoTDBWindowFunction3IT.java | 6 +- .../relational/it/db/it/IoTDBWindowFunctionIT.java | 40 +- .../relational/it/db/it/IoTDBWindowTVFIT.java | 86 + ...AbstractIoTDBMPPDataExchangeLargeTsBlockIT.java | 98 + .../IoTDBMPPDataExchangeLargeTsBlock128KIT.java | 51 + ...ableAggregationQueryWithNetworkPartitionIT.java | 5 +- .../query/view/recent/IoTDBTableViewQueryIT.java | 9 +- .../IoTDBTableViewQueryWithCachedDeviceIT.java | 3 +- .../relational/it/schema/IoTDBDatabaseIT.java | 22 +- .../iotdb/relational/it/schema/IoTDBDeviceIT.java | 46 +- .../iotdb/session/it/IoTDBConnectionsIT.java | 53 +- .../iotdb/session/it/pool/SessionPoolIT.java | 21 +- ...TDBConsensusSubscriptionUnsubscribeTableIT.java | 253 + .../event/dml/insertion/TsFileInsertionEvent.java | 5 + .../java/org/apache/iotdb/udf/api/access/Row.java | 7 +- .../org/apache/iotdb/udf/api/utils/RowImpl.java | 30 +- .../en/org/apache/iotdb/cli/i18n/CliMessages.java | 4 + .../zh/org/apache/iotdb/cli/i18n/CliMessages.java | 4 + .../java/org/apache/iotdb/cli/AbstractCli.java | 79 +- .../apache/iotdb/tool/data/AbstractDataTool.java | 67 +- .../java/org/apache/iotdb/cli/AbstractCliTest.java | 44 + iotdb-client/client-cpp/CMakeLists.txt | 14 + iotdb-client/client-cpp/README.md | 53 +- iotdb-client/client-cpp/README_zh.md | 12 +- iotdb-client/client-cpp/cmake/FetchOpenSSL.cmake | 201 +- .../client-cpp/cmake/InstallOpenSSLRuntime.cmake | 4 +- iotdb-client/client-cpp/pom.xml | 62 +- .../package-metadata/third_party/DEPENDENCIES.md | 2 +- .../src/include/AbstractSessionBuilder.h | 15 +- iotdb-client/client-cpp/src/include/Session.h | 3 + .../client-cpp/src/include/SessionBuilder.h | 14 +- iotdb-client/client-cpp/src/include/SessionC.h | 15 + iotdb-client/client-cpp/src/include/SessionPool.h | 21 +- .../client-cpp/src/include/SslConfig.h | 19 +- iotdb-client/client-cpp/src/include/TableSession.h | 3 +- .../client-cpp/src/include/TableSessionBuilder.h | 14 +- iotdb-client/client-cpp/src/rpc/NodesSupplier.cpp | 33 +- iotdb-client/client-cpp/src/rpc/NodesSupplier.h | 13 +- .../src/rpc/RpcSslUtils.cpp} | 33 +- .../client-cpp/src/rpc/RpcSslUtils.h | 20 +- .../client-cpp/src/rpc/SessionConnection.cpp | 13 +- .../client-cpp/src/rpc/SessionConnection.h | 3 +- iotdb-client/client-cpp/src/rpc/SessionImpl.h | 3 +- .../client-cpp/src/rpc/ThriftConnection.cpp | 11 +- iotdb-client/client-cpp/src/rpc/ThriftConnection.h | 6 +- iotdb-client/client-cpp/src/session/Session.cpp | 27 +- iotdb-client/client-cpp/src/session/SessionC.cpp | 69 + .../client-cpp/src/session/SessionPool.cpp | 17 +- .../src/session/SslConfig.cpp} | 28 +- .../client-cpp/src/session/TableSession.cpp | 5 +- iotdb-client/client-cpp/test/CMakeLists.txt | 36 +- .../client-cpp/test/cpp/RpcSslIotdbE2eTest.cpp | 194 + iotdb-client/client-cpp/test/cpp/sessionIT.cpp | 3 +- .../client-cpp/test/cpp/sessionUtilsTest.cpp | 18 +- iotdb-client/client-cpp/test/fixtures/tls/ca.crt | 19 + .../client-cpp/test/fixtures/tls/client.crt | 17 + .../client-cpp/test/fixtures/tls/client.key | 28 + .../client-cpp/test/fixtures/tls/tls-server.p12 | Bin 0 -> 2608 bytes .../test/main_rpc_ssl.cpp} | 4 +- .../test/scripts/configure_iotdb_ssl_it.py | 117 + .../client-cpp/test/scripts/run_cpp_it_phases.py | 130 + iotdb-client/client-cpp/third-party/README.md | 6 +- iotdb-client/client-py/README.md | 6 +- .../client-py/iotdb/utils/SessionDataSet.py | 30 +- .../client-py/iotdb/utils/iotdb_rpc_dataset.py | 90 +- .../org/apache/iotdb/isession/SessionDataSet.java | 39 +- .../org/apache/iotdb/isession/TypeServices.java | 68 + iotdb-client/jdbc/README.md | 23 - iotdb-client/jdbc/osgi.bnd | 31 - iotdb-client/jdbc/pom.xml | 81 - iotdb-client/jdbc/src/main/feature/feature.xml | 36 - .../org/apache/iotdb/jdbc/i18n/JdbcMessages.java | 5 +- .../org/apache/iotdb/jdbc/i18n/JdbcMessages.java | 4 +- .../main/java/org/apache/iotdb/jdbc/Activator.java | 42 - .../iotdb/jdbc/GroupedLSBWatermarkEncoder.java | 56 +- .../iotdb/jdbc/IoTDBAbstractDatabaseMetadata.java | 62 +- .../apache/iotdb/jdbc/IoTDBDataSourceFactory.java | 79 - .../java/org/apache/iotdb/jdbc/IoTDBDriver.java | 2 - .../resources/META-INF/services/java.sql.Driver | 3 + .../iotdb/jdbc/DriverServiceRegistrationTest.java | 32 +- .../apache/iotdb/jdbc/IoTDBJDBCResultSetTest.java | 90 + .../org/apache/iotdb/jdbc/IoTDBStatementTest.java | 39 + .../en/org/apache/iotdb/rpc/i18n/RpcMessages.java | 16 + .../zh/org/apache/iotdb/rpc/i18n/RpcMessages.java | 11 + .../org/apache/iotdb/rpc/IoTDBJDBCDataSet.java | 177 +- .../java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java | 115 +- .../org/apache/iotdb/rpc/NonOpenTransport.java | 6 + .../rpc/TCompressedElasticFramedTransport.java | 4 + .../apache/iotdb/rpc/TElasticFramedTransport.java | 74 +- .../java/org/apache/iotdb/rpc/TSStatusCode.java | 27 + .../java/org/apache/iotdb/rpc/TypeServices.java | 162 + .../iotdb/rpc/stmt/PreparedParameterSerde.java | 41 +- .../org/apache/iotdb/rpc/IoTDBJDBCDataSetTest.java | 176 + .../iotdb/rpc/TElasticFramedTransportReadTest.java | 266 + .../iotdb/rpc/TElasticFramedTransportTest.java | 101 + .../iotdb/rpc/stmt/PreparedParameterSerdeTest.java | 12 + .../java/org/apache/iotdb/session/Session.java | 167 +- .../apache/iotdb/session/SessionConnection.java | 26 + .../iotdb/session/util/SessionTypeServices.java | 435 ++ .../apache/iotdb/session/util/SessionUtils.java | 299 +- .../iotdb/session/SessionConnectionTest.java | 19 + .../java/org/apache/iotdb/session/SessionTest.java | 43 + .../iotdb/session/util/SessionUtilsTest.java | 21 + .../subscription/i18n/SubscriptionMessages.java | 8 + .../subscription/i18n/SubscriptionMessages.java | 8 + .../rpc/subscription/config/ConsumerConfig.java | 4 + .../rpc/subscription/config/ConsumerConstant.java | 3 +- .../SubscriptionConsumerFencedException.java | 51 + .../payload/request/PipeSubscribeRequestType.java | 1 + .../payload/request/PipeSubscribeSliceReq.java | 169 + .../request/PipeSubscribeSliceReqBuilder.java | 80 + .../request/PipeSubscribeSliceReqHandler.java | 141 + .../SubscriptionSessionConnection.java | 16 + .../base/AbstractSubscriptionConsumer.java | 259 +- .../base/AbstractSubscriptionConsumerBuilder.java | 2 +- .../base/AbstractSubscriptionProvider.java | 299 +- .../base/AbstractSubscriptionProviders.java | 177 +- .../base/AbstractSubscriptionPullConsumer.java | 119 +- .../base/AbstractSubscriptionPushConsumer.java | 24 +- .../base/SubscriptionExecutorServiceManager.java | 68 + .../tree/SubscriptionTreePullConsumer.java | 2 +- .../tree/SubscriptionTreePushConsumer.java | 2 +- .../payload/SubscriptionRecordHandler.java | 76 +- .../session/subscription/payload/TypeServices.java | 115 + .../payload/request/PipeSubscribeSliceReqTest.java | 203 + .../SubscriptionSessionConnectionTimeoutTest.java | 148 + .../SubscriptionConsumerConnectionFailureTest.java | 167 + ...SubscriptionConsumerHeartbeatIsolationTest.java | 341 ++ .../base/SubscriptionConsumerLifecycleTest.java | 590 +- .../base/SubscriptionProviderSlicingTest.java | 232 + .../base/SubscriptionProviderStatusTest.java | 72 + .../subscription/payload/TypeServicesTest.java | 69 + iotdb-core/ainode/ainode.xml | 6 +- .../iotdb/ainode/core/model/chronos2/__init__.py | 2 + .../iotdb/ainode/core/model/chronos2/base.py | 3 + .../ainode/core/model/chronos2/chronos_bolt.py | 3 + .../iotdb/ainode/core/model/chronos2/config.py | 3 + .../iotdb/ainode/core/model/chronos2/dataset.py | 3 + .../iotdb/ainode/core/model/chronos2/layers.py | 3 + .../iotdb/ainode/core/model/chronos2/model.py | 3 + .../core/model/chronos2/pipeline_chronos2.py | 3 + .../iotdb/ainode/core/model/chronos2/utils.py | 3 + .../iotdb/ainode/core/model/moirai2/__init__.py | 6 +- .../ainode/core/model/moirai2/common/torch_util.py | 5 + .../ainode/core/model/moirai2/modeling_moirai2.py | 5 + .../ainode/core/model/moirai2/module/attention.py | 5 + .../iotdb/ainode/core/model/moirai2/module/ffn.py | 5 + .../iotdb/ainode/core/model/moirai2/module/norm.py | 5 + .../core/model/moirai2/module/packed_scaler.py | 5 + .../core/model/moirai2/module/position/__init__.py | 5 + .../core/model/moirai2/module/position/additive.py | 5 + .../model/moirai2/module/position/attn_bias.py | 5 + .../moirai2/module/position/attn_projection.py | 5 + .../core/model/moirai2/module/transformer.py | 5 + .../ainode/core/model/moirai2/module/ts_embed.py | 5 + .../ainode/core/model/moirai2/transform/_base.py | 5 + .../ainode/core/model/moirai2/transform/_mixin.py | 5 + .../core/model/moirai2/transform/imputation.py | 5 + .../core/model/moment/configuration_moment.py | 1 + .../ainode/core/model/moment/modeling_moment.py | 1 + .../ainode/core/model/moment/pipeline_moment.py | 1 + .../iotdb/ainode/core/model/sundial/flow_loss.py | 80 +- .../ainode/src/assembly/resources/NOTICE-binary | 65 + .../src/assembly/resources/licenses/LICENSE-GLIDE | 21 + .../src/assembly/resources/licenses/LICENSE-MOMENT | 21 + iotdb-core/ainode/tests/test_sundial_flow_loss.py | 123 + .../org/apache/iotdb/db/qp/sql/IdentifierParser.g4 | 1 + .../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 | 6 +- .../antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4 | 4 + .../org/apache/iotdb/calc/i18n/CalcMessages.java | 53 + .../org/apache/iotdb/calc/i18n/CalcMessages.java | 53 + .../aggregation/CentralMomentAccumulator.java | 35 +- .../aggregation/CorrelationAccumulator.java | 20 +- .../aggregation/CovarianceAccumulator.java | 20 +- .../aggregation/RegressionAccumulator.java | 20 +- .../execution/aggregation/VarianceAccumulator.java | 115 +- .../operator/RowReferenceTsBlockManager.java | 12 +- .../process/AbstractLinearFillOperator.java | 15 +- .../process/TableLinearFillWithGroupOperator.java | 18 +- .../process/TableNextFillWithGroupOperator.java | 5 + .../operator/process/TableStreamSortOperator.java | 4 +- .../execution/operator/process/TopKOperator.java | 95 +- .../process/join/merge/MergeSortComparator.java | 46 +- .../merge/comparator/JoinKeyComparatorFactory.java | 36 +- .../process/window/TopKRankingOperator.java | 12 +- .../process/window/function/value/LagFunction.java | 36 - .../window/function/value/LeadFunction.java | 36 - .../window/function/value/ValueWindowFunction.java | 9 + .../process/window/partition/frame/RangeFrame.java | 294 +- .../operator/process/window/utils/ColumnList.java | 9 + .../process/window/utils/RowComparator.java | 174 +- .../relational/MergeSortFullOuterJoinOperator.java | 6 +- .../AbstractApproxMostFrequentAccumulator.java | 2 +- .../AbstractApproxPercentileAccumulator.java | 64 +- .../relational/aggregation/AccumulatorFactory.java | 64 +- .../ApproxCountDistinctAccumulator.java | 54 +- .../relational/aggregation/AvgAccumulator.java | 207 +- .../relational/aggregation/ExtremeAccumulator.java | 165 +- .../relational/aggregation/FirstAccumulator.java | 248 +- .../relational/aggregation/FirstByAccumulator.java | 226 +- .../relational/aggregation/LastAccumulator.java | 282 +- .../relational/aggregation/LastByAccumulator.java | 222 +- .../relational/aggregation/MaxAccumulator.java | 193 +- .../relational/aggregation/MinAccumulator.java | 193 +- .../aggregation/PercentileAccumulator.java | 132 +- .../relational/aggregation/SumAccumulator.java | 204 +- .../aggregation/TableCentralMomentAccumulator.java | 51 +- .../aggregation/TableCorrelationAccumulator.java | 33 +- .../aggregation/TableCovarianceAccumulator.java | 33 +- .../aggregation/TableMaxMinByBaseAccumulator.java | 352 +- .../aggregation/TableModeAccumulator.java | 667 +-- .../aggregation/TableRegressionAccumulator.java | 33 +- .../aggregation/TableVarianceAccumulator.java | 226 +- .../source/relational/aggregation/Utils.java | 62 +- ...AbstractGroupedApproxPercentileAccumulator.java | 58 +- .../GroupedApproxCountDistinctAccumulator.java | 74 +- .../aggregation/grouped/GroupedAvgAccumulator.java | 133 +- .../grouped/GroupedCentralMomentAccumulator.java | 38 +- .../grouped/GroupedCorrelationAccumulator.java | 29 +- .../grouped/GroupedCovarianceAccumulator.java | 29 +- .../grouped/GroupedExtremeAccumulator.java | 337 +- .../grouped/GroupedFirstAccumulator.java | 458 +- .../grouped/GroupedFirstByAccumulator.java | 463 +- .../grouped/GroupedLastAccumulator.java | 457 +- .../grouped/GroupedLastByAccumulator.java | 463 +- .../aggregation/grouped/GroupedMaxAccumulator.java | 368 +- .../grouped/GroupedMaxMinByBaseAccumulator.java | 903 +--- .../aggregation/grouped/GroupedMinAccumulator.java | 494 +- .../grouped/GroupedModeAccumulator.java | 323 +- .../grouped/GroupedPercentileAccumulator.java | 78 +- .../grouped/GroupedRegressionAccumulator.java | 29 +- .../aggregation/grouped/GroupedSumAccumulator.java | 125 +- .../grouped/GroupedVarianceAccumulator.java | 177 +- .../aggregation/grouped/array/BinaryBigArray.java | 7 + .../aggregation/grouped/array/BooleanBigArray.java | 5 + .../aggregation/grouped/array/DoubleBigArray.java | 5 + .../aggregation/grouped/array/FloatBigArray.java | 5 + .../aggregation/grouped/array/IntBigArray.java | 5 + .../aggregation/grouped/array/LongBigArray.java | 5 + .../grouped/rate/GroupedNaiveDeltaAccumulator.java | 49 +- .../rate/GroupedNaiveIncreaseAccumulator.java | 49 +- .../grouped/rate/GroupedNaiveIrateAccumulator.java | 31 +- .../grouped/rate/GroupedNaiveRateAccumulator.java | 46 +- .../rate/GroupedOrderedDeltaAccumulator.java | 50 +- .../rate/GroupedOrderedIncreaseAccumulator.java | 50 +- .../rate/GroupedOrderedIrateAccumulator.java | 31 +- .../rate/GroupedOrderedRateAccumulator.java | 47 +- .../aggregation/rate/NaiveDeltaAccumulator.java | 47 +- .../aggregation/rate/NaiveIncreaseAccumulator.java | 47 +- .../aggregation/rate/NaiveIrateAccumulator.java | 29 +- .../aggregation/rate/NaiveRateAccumulator.java | 44 +- .../aggregation/rate/OrderedDeltaAccumulator.java | 47 +- .../rate/OrderedIncreaseAccumulator.java | 47 +- .../aggregation/rate/OrderedIrateAccumulator.java | 30 +- .../aggregation/rate/OrderedRateAccumulator.java | 44 +- .../aggregation/rate/RateFunctionValidation.java | 56 +- .../relational/ColumnTransformerBuilder.java | 123 +- .../calc/plan/planner/CommonOperatorUtils.java | 129 +- .../calc/plan/planner/TableOperatorGenerator.java | 148 +- .../AbstractGreatestLeastColumnTransformer.java | 47 +- .../multi/BinaryGreatestColumnTransformer.java | 2 +- .../column/multi/BinaryLeastColumnTransformer.java | 2 +- .../multi/BooleanGreatestColumnTransformer.java | 2 +- .../multi/BooleanLeastColumnTransformer.java | 2 +- .../multi/DoubleGreatestColumnTransformer.java | 2 +- .../column/multi/DoubleLeastColumnTransformer.java | 2 +- .../multi/FloatGreatestColumnTransformer.java | 2 +- .../column/multi/FloatLeastColumnTransformer.java | 2 +- .../multi/Int32GreatestColumnTransformer.java | 2 +- .../column/multi/Int32LeastColumnTransformer.java | 2 +- .../multi/Int64GreatestColumnTransformer.java | 2 +- .../column/multi/Int64LeastColumnTransformer.java | 2 +- .../dag/column/unary/InColumnTransformer.java | 220 +- .../AbstractCastFunctionColumnTransformer.java | 370 +- .../scalar/CastFunctionColumnTransformer.java | 56 +- .../unary/scalar/FormatColumnTransformer.java | 37 +- .../unary/scalar/RoundColumnTransformer.java | 37 +- .../scalar/RoundFunctionColumnTransformer.java | 39 +- .../scalar/TryCastFunctionColumnTransformer.java | 58 +- .../transformation/dag/util/CastFunctionUtils.java | 251 +- .../datastructure/row/SerializableRowList.java | 64 +- .../datastructure/tv/SerializableTVList.java | 40 +- .../org/apache/iotdb/calc/utils/TypeServices.java | 5675 ++++++++++++++++++++ .../aggregation/LastDescendingInputTest.java | 108 + .../aggregation/NumericBatchAggregationTest.java | 224 + .../aggregation/NumericMomentBatchTest.java | 157 + .../relational/aggregation/SumAccumulatorTest.java | 140 + .../aggregation/VarianceAccumulatorTest.java | 125 + .../GroupedApproxCountDistinctMaskTest.java | 50 + .../aggregation/rate/RateBatchInputTest.java | 253 + .../column/unary/scalar/NumericCastBatchTest.java | 184 + .../apache/iotdb/calc/utils/TypeServicesTest.java | 416 ++ .../iotdb/confignode/i18n/ConfigNodeMessages.java | 65 +- .../iotdb/confignode/i18n/ManagerMessages.java | 39 +- .../iotdb/confignode/i18n/ProcedureMessages.java | 9 + .../iotdb/confignode/i18n/ConfigNodeMessages.java | 68 +- .../iotdb/confignode/i18n/ManagerMessages.java | 39 +- .../iotdb/confignode/i18n/ProcedureMessages.java | 18 +- .../handlers/heartbeat/AINodeHeartbeatHandler.java | 4 +- .../heartbeat/ConfigNodeHeartbeatHandler.java | 4 +- .../heartbeat/DataNodeHeartbeatHandler.java | 7 +- .../iotdb/confignode/conf/ConfigNodeConfig.java | 70 +- .../consensus/request/ConfigPhysicalPlan.java | 8 + .../consensus/request/ConfigPhysicalPlanType.java | 9 + .../request/ConfigPhysicalPlanVisitor.java | 8 + .../write/confignode/UpdateNodeStatusPlan.java | 104 + .../write/table/SetTableColumnPropertiesPlan.java | 80 + .../partition/GetRegionGroupsByTimeResp.java | 25 + .../response/pipe/task/PipeTableResp.java | 8 +- .../statemachine/ConfigRegionStateMachine.java | 16 +- .../confignode/manager/ClusterQuotaManager.java | 5 +- .../iotdb/confignode/manager/ConfigManager.java | 199 +- .../apache/iotdb/confignode/manager/IManager.java | 18 +- .../iotdb/confignode/manager/ProcedureManager.java | 558 +- .../confignode/manager/RetryFailedTasksThread.java | 3 +- .../iotdb/confignode/manager/load/LoadManager.java | 76 +- .../manager/load/balancer/RegionBalancer.java | 12 +- .../partition/DataPartitionPolicyTable.java | 18 +- .../manager/load/cache/AbstractLoadCache.java | 9 +- .../confignode/manager/load/cache/LoadCache.java | 140 +- .../load/cache/consensus/ConsensusGroupCache.java | 3 +- .../load/cache/node/AINodeHeartbeatCache.java | 48 - .../manager/load/cache/node/BaseNodeCache.java | 84 +- .../load/cache/node/ConfigNodeHeartbeatCache.java | 39 +- .../load/cache/node/DataNodeHeartbeatCache.java | 57 +- .../load/cache/node/NodeHeartbeatSample.java | 7 +- .../manager/load/cache/node/NodeStatistics.java | 17 + .../manager/load/cache/region/RegionCache.java | 3 +- .../load/cache/region/RegionGroupCache.java | 2 +- .../manager/load/service/StatisticsService.java | 2 +- .../iotdb/confignode/manager/node/NodeManager.java | 25 +- .../manager/partition/PartitionManager.java | 127 +- .../partition/RegionGroupExtensionPolicy.java | 4 +- .../pipe/agent/task/PipeConfigNodeSubtask.java | 13 + .../pipe/agent/task/PipeConfigNodeTask.java | 10 + .../pipe/agent/task/PipeConfigNodeTaskStage.java | 10 + .../runtime/heartbeat/PipeHeartbeatParser.java | 20 +- .../PipeConfigNodeRemainingTimeMetrics.java | 20 +- .../PipeTemporaryMetaInCoordinatorMetrics.java | 18 +- .../metric/sink/PipeConfigRegionSinkMetrics.java | 17 +- .../source/PipeConfigRegionSourceMetrics.java | 17 +- .../receiver/protocol/IoTDBConfigNodeReceiver.java | 102 +- .../PipeConfigPhysicalPlanTSStatusVisitor.java | 7 + .../sink/protocol/IoTDBConfigRegionAirGapSink.java | 1 + .../pipe/source/ConfigRegionListeningFilter.java | 2 + .../manager/schema/ClusterSchemaManager.java | 79 +- .../runtime/SubscriptionRuntimeCoordinator.java | 7 +- .../persistence/executor/ConfigPlanExecutor.java | 82 +- .../confignode/persistence/node/NodeInfo.java | 115 +- .../partition/DatabasePartitionTable.java | 16 + .../persistence/partition/PartitionInfo.java | 12 + .../schema/CNPhysicalPlanGenerator.java | 48 +- .../persistence/schema/CNSnapshotFileType.java | 4 +- .../persistence/schema/ClusterSchemaInfo.java | 17 +- .../confignode/persistence/schema/ConfigMTree.java | 78 +- .../persistence/subscription/SubscriptionInfo.java | 8 +- .../procedure/env/ConfigNodeProcedureEnv.java | 7 +- .../procedure/env/RegionMaintainHandler.java | 24 +- .../procedure/env/RemoveDataNodeHandler.java | 71 +- .../procedure/impl/node/RemoveAINodeProcedure.java | 1 + .../impl/node/RemoveDataNodesProcedure.java | 6 +- .../procedure/impl/schema/SchemaUtils.java | 26 +- .../table/AbstractAlterOrDropTableProcedure.java | 19 + ...re.java => AbstractSetPropertiesProcedure.java} | 71 +- .../impl/schema/table/DeleteDevicesProcedure.java | 2 +- .../impl/schema/table/RenameTableProcedure.java | 2 +- .../table/SetTableColumnPropertiesProcedure.java | 107 + .../schema/table/SetTablePropertiesProcedure.java | 218 +- .../runtime/CommitProgressSyncProcedure.java | 17 +- .../procedure/store/ProcedureFactory.java | 9 + .../confignode/procedure/store/ProcedureType.java | 2 + .../confignode/service/ConfigNodeShutdownHook.java | 162 +- .../heartbeat/DataNodeHeartbeatHandlerTest.java | 100 + .../conf/RegionGroupExtensionPolicyConfigTest.java | 106 + .../request/ConfigPhysicalPlanSerDeTest.java | 67 + .../manager/ClusterSchemaManagerTest.java | 89 + .../ConfigManagerRegionGroupPolicyReloadTest.java | 150 + .../manager/ConfigManagerShutdownReportTest.java | 161 + .../ProcedureManagerRegionOperationTest.java | 401 ++ .../manager/ProcedureManagerTableTaskTest.java | 225 + .../confignode/manager/ProcedureManagerTest.java | 25 + .../manager/RetryFailedTasksThreadTest.java | 107 + .../confignode/manager/load/LoadManagerTest.java | 115 +- .../manager/load/balancer/RegionBalancerTest.java | 144 + .../DataPartitionPolicyTableProactiveTest.java | 190 + .../router/priority/GreedyPriorityTest.java | 2 +- .../priority/LeaderPriorityBalancerTest.java | 2 +- .../load/cache/ConsensusGroupCacheTest.java | 2 +- .../load/cache/LoadCacheNodeStatusTest.java | 336 ++ .../cache/LoadCachePersistedNodeStatusTest.java | 898 ++++ .../manager/load/cache/NodeCacheTest.java | 228 +- .../manager/node/NodeManagerStatusReasonTest.java | 133 + .../PartitionManagerProactiveExtensionTest.java | 811 +++ .../runtime/heartbeat/PipeHeartbeatParserTest.java | 86 + .../metric/PipeConfigNodeMetricsRestartTest.java | 184 + .../pipe/sink/PipeConfigNodeThriftRequestTest.java | 8 +- .../SubscriptionRuntimeCoordinatorTest.java | 119 + .../persistence/CNPhysicalPlanGeneratorTest.java | 20 + .../iotdb/confignode/persistence/NodeInfoTest.java | 269 + .../persistence/schema/ClusterSchemaInfoTest.java | 119 + .../persistence/schema/ConfigMTreeTest.java | 31 + .../procedure/env/ConfigNodeProcedureEnvTest.java | 93 + .../procedure/env/RegionMaintainHandlerTest.java | 303 ++ .../impl/node/RemoveDataNodePersistenceTest.java | 581 ++ .../procedure/impl/schema/SchemaUtilsTest.java | 91 + .../runtime/CommitProgressSyncProcedureTest.java | 60 +- .../service/ConfigNodeShutdownHookTest.java | 346 ++ iotdb-core/consensus/pom.xml | 5 + .../iotdb/consensus/i18n/IoTConsensusMessages.java | 4 + .../iotdb/consensus/i18n/IoTConsensusMessages.java | 4 + .../consensus/iot/IoTConsensusServerImpl.java | 7 +- .../logdispatcher/LogDispatcherThreadMetrics.java | 104 +- .../subscription/SubscriptionQueueAdmission.java | 25 + .../subscription/SubscriptionQueueRegistry.java | 60 +- .../SubscriptionQueueRejectionReason.java | 42 + .../SubscriptionWalRetentionCalculator.java | 10 +- .../consensus/pipe/IoTConsensusV2ServerImpl.java | 5 + .../pipe/metric/IoTConsensusV2ServerMetrics.java | 3 - .../consensus/ratis/metrics/CounterProxy.java | 8 +- .../ratis/metrics/IoTDBMetricRegistry.java | 34 +- .../ratis/metrics/MetricRegistryManager.java | 14 + .../consensus/ratis/metrics/RatisMetricSet.java | 8 +- .../iotdb/consensus/ratis/metrics/TimerProxy.java | 7 +- .../LogDispatcherThreadMetricsTest.java | 146 + .../metric/IoTConsensusV2ServerMetricsTest.java | 107 + .../ratis/metrics/RatisMetricSetTest.java | 134 + iotdb-core/datanode/pom.xml | 45 +- .../apache/iotdb/db/i18n/DataNodeMiscMessages.java | 24 +- .../apache/iotdb/db/i18n/DataNodePipeMessages.java | 90 +- .../iotdb/db/i18n/DataNodeQueryMessages.java | 58 + .../iotdb/db/i18n/DataNodeSchemaMessages.java | 5 +- .../apache/iotdb/db/i18n/ImportWALMessages.java | 155 + .../iotdb/db/i18n/StorageEngineMessages.java | 30 +- .../apache/iotdb/db/i18n/DataNodeMiscMessages.java | 23 +- .../apache/iotdb/db/i18n/DataNodePipeMessages.java | 87 +- .../iotdb/db/i18n/DataNodeQueryMessages.java | 57 + .../iotdb/db/i18n/DataNodeSchemaMessages.java | 5 +- .../apache/iotdb/db/i18n/ImportWALMessages.java | 154 + .../iotdb/db/i18n/StorageEngineMessages.java | 32 +- .../org/apache/iotdb/db/auth/AuthorityChecker.java | 20 +- .../apache/iotdb/db/conf/DataNodeMemoryConfig.java | 42 +- .../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 44 +- .../org/apache/iotdb/db/conf/IoTDBDescriptor.java | 124 +- .../dataregion/DataRegionStateMachine.java | 8 +- .../load/LoadAnalyzeInvalidPathException.java} | 15 +- .../iotdb/db/lbac/AllowAllLBACAccessControl.java | 47 + .../apache/iotdb/db/lbac/ILBACAccessControl.java | 74 + .../db/partition/DataPartitionTableGenerator.java | 8 +- .../dataregion/PipeDataRegionSinkConstructor.java | 3 - .../iotdb/db/pipe/agent/task/PipeDataNodeTask.java | 10 + .../agent/task/connection/PipeEventCollector.java | 10 + .../pipe/agent/task/stage/PipeTaskSinkStage.java | 12 + .../agent/task/subtask/sink/PipeSinkSubtask.java | 84 +- .../subtask/sink/PipeSinkSubtaskLifeCycle.java | 10 + .../task/subtask/sink/PipeSinkSubtaskManager.java | 32 +- .../deletion/persist/PageCacheDeletionBuffer.java | 67 +- .../event/common/row/PipeDataTypeTransformer.java | 34 +- .../iotdb/db/pipe/event/common/row/PipeRow.java | 29 +- .../common/tablet/PipeRawTabletInsertionEvent.java | 31 +- .../pipe/event/common/tablet/PipeTabletUtils.java | 35 +- .../tablet/parser/TabletInsertionEventParser.java | 209 +- .../common/tsfile/PipeTsFileInsertionEvent.java | 712 ++- .../TsFileInsertionEventParserMemoryManager.java | 14 +- .../parser/scan/SinglePageWholeChunkReader.java | 41 +- .../scan/TsFileInsertionEventScanParser.java | 128 +- ...ileInsertionEventTableParserTabletIterator.java | 68 +- .../overview/PipeDataNodeSinglePipeMetrics.java | 20 +- .../overview/PipeTsFileToTabletsMetrics.java | 16 +- .../metric/processor/PipeProcessorMetrics.java | 19 +- .../schema/PipeSchemaRegionListenerMetrics.java | 16 +- .../metric/schema/PipeSchemaRegionSinkMetrics.java | 16 +- .../schema/PipeSchemaRegionSourceMetrics.java | 16 +- .../metric/sink/PipeDataRegionSinkMetrics.java | 19 +- .../db/pipe/metric/source/PipeAssignerMetrics.java | 13 +- .../metric/source/PipeDataRegionSourceMetrics.java | 20 +- .../processor/aggregate/AggregateProcessor.java | 159 +- .../aggregate/TimeSeriesRuntimeState.java | 23 + .../CustomizedReadableIntermediateResults.java | 164 +- .../numeric/AbstractSameTypeNumericOperator.java | 119 +- .../protocol/airgap/IoTDBAirGapReceiver.java | 11 +- .../protocol/thrift/IoTDBDataNodeReceiver.java | 268 +- .../transform/converter/ValueConverter.java | 141 +- .../resource/memory/InsertNodeMemoryEstimator.java | 95 +- .../db/pipe/resource/memory/PipeMemoryManager.java | 123 +- .../pipe/resource/memory/PipeMemoryWeightUtil.java | 10 +- .../resource/tsfile/PipeTsFilePublicResource.java | 125 +- .../resource/tsfile/PipeTsFileResourceManager.java | 72 +- .../client/IoTDBDataNodeAsyncClientManager.java | 7 + .../evolvable/batch/PipeTabletEventBatch.java | 98 +- .../evolvable/batch/PipeTabletEventPlainBatch.java | 139 +- .../batch/PipeTabletEventTsFileBatch.java | 110 +- .../batch/PipeTransferBatchReqBuilder.java | 95 +- .../request/PipeTransferTabletBatchReqV2.java | 3 + .../protocol/airgap/IoTDBDataNodeAirGapSink.java | 1 + .../protocol/airgap/IoTDBDataRegionAirGapSink.java | 16 +- .../airgap/IoTDBSchemaRegionAirGapSink.java | 2 +- .../IoTConsensusV2TransferBatchReqBuilder.java | 12 +- .../sink/protocol/opcda/OpcDaServerHandle.java | 73 +- .../db/pipe/sink/protocol/opcda/OpcDaSink.java | 9 +- .../thrift/async/IoTDBDataRegionAsyncSink.java | 665 ++- .../PipeTransferTabletBatchEventHandler.java | 2 +- .../PipeTransferTabletInsertNodeEventHandler.java | 13 +- .../PipeTransferTabletInsertionEventHandler.java | 8 +- .../handler/PipeTransferTrackableHandler.java | 94 +- .../async/handler/PipeTransferTsFileHandler.java | 257 +- .../thrift/sync/IoTDBDataRegionSyncSink.java | 20 +- .../thrift/sync/IoTDBSchemaRegionSink.java | 6 +- .../sink/protocol/writeback/WriteBackSink.java | 101 +- .../sink/util/PipeTabletEventTransferUtils.java | 97 + .../pipe/sink/util/TabletStatementConverter.java | 128 +- .../util/builder/PipeTableModelTsFileBuilder.java | 41 + .../builder/PipeTableModelTsFileBuilderV2.java | 45 + .../util/builder/PipeTreeModelTsFileBuilder.java | 31 + .../util/builder/PipeTreeModelTsFileBuilderV2.java | 38 + .../pipe/sink/util/builder/PipeTsFileBuilder.java | 10 + .../db/pipe/sink/util/cacher/LeaderCacheUtils.java | 42 +- .../sink/util/sorter/PipeInsertEventSorter.java | 106 +- .../PipeRealtimeDataRegionHybridSource.java | 668 ++- .../realtime/PipeRealtimeDataRegionSource.java | 35 + .../PipeRealtimeDataRegionTsFileSource.java | 150 +- .../matcher/CachedSchemaPatternMatcher.java | 41 +- .../iotdb/db/protocol/client/ConfigNodeClient.java | 5 + .../iotdb/db/protocol/client/ConfigNodeInfo.java | 64 +- .../iotdb/db/protocol/session/ClientSession.java | 23 + .../iotdb/db/protocol/session/IClientSession.java | 3 + .../db/protocol/session/InternalClientSession.java | 5 + .../db/protocol/session/MqttClientSession.java | 5 + .../db/protocol/session/RestClientSession.java | 5 + .../handler/RPCServiceThriftHandlerMetrics.java | 37 +- .../protocol/thrift/impl/ClientRPCServiceImpl.java | 135 +- .../impl/DataNodeInternalRPCServiceImpl.java | 126 +- .../db/queryengine/common/MPPQueryContext.java | 47 +- .../common/header/DatasetHeaderFactory.java | 4 + .../execution/aggregation/AccumulatorFactory.java | 34 +- .../execution/aggregation/AvgAccumulator.java | 105 +- .../execution/aggregation/ExtremeAccumulator.java | 264 +- .../aggregation/FirstValueAccumulator.java | 336 +- .../aggregation/FirstValueDescAccumulator.java | 79 +- .../aggregation/LastValueAccumulator.java | 327 +- .../aggregation/LastValueDescAccumulator.java | 89 +- .../aggregation/MaxMinByBaseAccumulator.java | 315 +- .../execution/aggregation/MaxValueAccumulator.java | 286 +- .../execution/aggregation/MinValueAccumulator.java | 287 +- .../execution/aggregation/SumAccumulator.java | 100 +- .../db/queryengine/execution/driver/Driver.java | 6 + .../execution/exchange/MPPDataExchangeManager.java | 44 + .../execution/exchange/sink/SinkChannel.java | 49 +- .../execution/exchange/source/SourceHandle.java | 158 +- .../fragment/FakedFragmentInstanceContext.java | 84 +- .../fragment/FragmentInstanceContext.java | 181 +- .../fragment/FragmentInstanceExecution.java | 11 +- .../FragmentInstanceFinishedException.java} | 26 +- .../execution/operator/AggregationUtil.java | 34 +- .../process/InsertTabletStatementGenerator.java | 137 +- .../operator/process/TransformOperator.java | 43 +- .../process/last/LastQueryCollectOperator.java | 12 +- .../source/PipeReceiverRuntimeSnapshotFilter.java | 63 + .../execution/operator/source/SeriesScanUtil.java | 530 +- .../operator/source/ShowReceiversOperator.java | 177 + .../InformationSchemaContentSupplierFactory.java | 121 +- .../relational/LastQueryAggTableScanOperator.java | 28 +- .../operator/window/WindowManagerFactory.java | 62 +- .../execution/schedule/DriverScheduler.java | 9 +- .../metric/SeriesScanCostMetricSet.java | 18 +- .../iotdb/db/queryengine/plan/Coordinator.java | 2 + .../db/queryengine/plan/analyze/Analysis.java | 2 + .../queryengine/plan/analyze/AnalyzeVisitor.java | 29 + .../analyze/cache/partition/PartitionCache.java | 2 +- .../plan/analyze/load/LoadTsFileAnalyzer.java | 24 +- .../load/TreeSchemaAutoCreatorAndVerifier.java | 20 +- .../plan/analyze/schema/SchemaValidator.java | 56 +- .../execution/config/TableConfigTaskVisitor.java | 69 + .../config/executor/ClusterConfigTaskExecutor.java | 87 +- .../config/executor/IConfigTaskExecutor.java | 9 + .../config/metadata/ShowClusterDetailsTask.java | 63 +- .../execution/config/metadata/ShowClusterTask.java | 40 +- .../config/metadata/ShowConfigNodesTask.java | 28 +- .../config/metadata/ShowDataNodesTask.java | 30 +- .../AlterTableSetColumnPropertiesTask.java | 55 + .../metadata/relational/ShowCreatePipeTask.java | 7 +- .../visitor/ExistUnknownTypeInExpression.java | 2 +- .../visitor/GetMeasurementExpressionVisitor.java | 6 + .../predicate/ConvertPredicateToFilterVisitor.java | 47 +- .../db/queryengine/plan/parser/ASTVisitor.java | 6 + .../plan/planner/LocalExecutionPlanner.java | 10 +- .../plan/planner/LogicalPlanBuilder.java | 39 + .../plan/planner/LogicalPlanVisitor.java | 7 + .../plan/planner/OperatorGeneratorUtil.java | 28 +- .../plan/planner/OperatorTreeGenerator.java | 77 +- .../SimpleFragmentParallelPlanner.java | 2 + .../memory/OperatorMemoryNotEnoughException.java} | 45 +- .../plan/node/DataNodePlanNodeDeserializer.java | 3 + .../plan/planner/plan/node/PlanVisitor.java | 5 + .../plan/node/source/ShowReceiversNode.java | 115 + .../planner/plan/node/write/InsertRowNode.java | 218 +- .../planner/plan/node/write/InsertTabletNode.java | 352 +- .../relational/analyzer/StatementAnalyzer.java | 162 +- .../predicate/ConvertPredicateToFilterVisitor.java | 85 +- .../AdditionalInformationSchemaProvider.java | 59 + ...dditionalInformationSchemaProviderRegistry.java | 25 +- .../relational/metadata/TableMetadataImpl.java | 11 +- .../metadata/fetcher/TableDeviceSchemaFetcher.java | 3 +- .../distribute/TableDistributedPlanGenerator.java | 604 ++- ...ithUncorrelatedScalarSubqueryReconstructor.java | 40 +- .../DataNodeLocationSupplierFactory.java | 10 + .../planner/optimizations/SortElimination.java | 65 +- .../optimizations/TableFunctionOrdering.java | 79 + .../TransformAggregationToStreamable.java | 5 +- .../optimizations/TransformSortToStreamSort.java | 45 +- .../security/TreeAccessCheckVisitor.java | 13 +- .../plan/relational/sql/ast/AstVisitor.java | 4 + .../sql/ast/DefaultTraversalVisitor.java | 9 + .../relational/sql/ast/SetColumnProperties.java | 140 + .../plan/relational/sql/parser/AstBuilder.java | 27 +- .../relational/sql/util/DataNodeSqlFormatter.java | 25 + .../scheduler/load/LoadTsFileDispatcherImpl.java | 169 +- .../queryengine/plan/statement/StatementType.java | 1 + .../plan/statement/StatementVisitor.java | 5 + .../plan/statement/crud/InsertBaseStatement.java | 46 + .../plan/statement/crud/InsertRowStatement.java | 29 +- .../plan/statement/crud/InsertRowsStatement.java | 17 + .../plan/statement/crud/InsertTabletStatement.java | 69 +- .../plan/statement/sys/ShowReceiversStatement.java | 61 + ...ializableRowRecordListBackedMultiColumnRow.java | 2 +- .../dag/input/ConstantInputReader.java | 63 +- .../unary/ArithmeticNegationTransformer.java | 41 +- .../dag/transformer/unary/InTransformer.java | 131 +- .../unary/scalar/CastFunctionTransformer.java | 530 +- .../unary/scalar/DiffFunctionTransformer.java | 42 +- .../unary/scalar/RoundFunctionTransformer.java | 45 +- .../transformation/dag/util/TransformUtils.java | 119 +- .../transformation/dag/util/TypeUtils.java | 61 +- .../apache/iotdb/db/schemaengine/SchemaEngine.java | 23 +- .../schemaengine/metric/SchemaEngineMemMetric.java | 7 +- .../schemaengine/metric/SchemaRegionMemMetric.java | 7 +- .../rescon/MemSchemaEngineStatistics.java | 4 + .../schemaregion/impl/SchemaRegionMemoryImpl.java | 91 +- .../schemaregion/impl/SchemaRegionPBTreeImpl.java | 32 +- .../schemaengine/schemaregion/tag/TagManager.java | 55 +- .../db/schemaengine/table/DataNodeTableCache.java | 35 +- .../iotdb/db/schemaengine/table/ITableCache.java | 2 + .../java/org/apache/iotdb/db/service/DataNode.java | 6 +- .../iotdb/db/service/DataNodeShutdownHook.java | 6 +- .../iotdb/db/service/metrics/CacheMetrics.java | 17 + .../db/service/metrics/DataNodeMetricsHelper.java | 1 + .../metrics/IoTDBInternalLocalReporter.java | 1 + .../iotdb/db/service/metrics/WritingMetrics.java | 80 +- .../db/service/metrics/file/TsFileMetrics.java | 22 + .../iotdb/db/storageengine/StorageEngine.java | 38 +- .../db/storageengine/dataregion/DataRegion.java | 39 +- .../dataregion/DataRegionMetrics.java | 49 +- .../execute/utils/CompactionPathUtils.java | 2 +- .../ReadChunkAlignedSeriesCompactionExecutor.java | 42 +- .../readchunk/SingleSeriesCompactionExecutor.java | 32 +- .../utils/writer/AbstractCompactionWriter.java | 92 +- .../schedule/CompactionScheduleTaskManager.java | 10 +- .../selector/impl/SettleSelectorImpl.java | 5 +- .../dataregion/memtable/AbstractMemTable.java | 32 +- .../memtable/AlignedReadOnlyMemChunk.java | 126 +- .../memtable/AlignedWritableMemChunk.java | 398 +- .../dataregion/memtable/IMemTable.java | 10 + .../dataregion/memtable/ReadOnlyMemChunk.java | 92 +- .../dataregion/memtable/TsFileProcessor.java | 102 +- .../memtable/TsFileProcessorInfoMetrics.java | 55 +- .../dataregion/memtable/WritableMemChunk.java | 124 +- .../dataregion/modification/TagPredicate.java | 24 + .../dataregion/read/control/FileReaderManager.java | 698 ++- .../read/reader/chunk/MemAlignedPageReader.java | 52 +- .../read/reader/chunk/MemPageReader.java | 84 +- .../dataregion/snapshot/SnapshotTaker.java | 6 +- .../dataregion/tsfile/TsFileLock.java | 27 +- .../dataregion/utils/DiskUsageStatisticUtil.java | 12 +- .../dataregion/utils/TsFileResourceUtils.java | 11 +- .../dataregion/wal/buffer/AbstractWALBuffer.java | 39 +- .../dataregion/wal/buffer/WALBuffer.java | 117 +- .../wal/checkpoint/CheckpointManager.java | 4 +- .../storageengine/dataregion/wal/io/LogWriter.java | 39 +- .../dataregion/wal/io/WALByteBufReader.java | 24 +- .../dataregion/wal/io/WALFileVersion.java | 19 + .../dataregion/wal/io/WALInputStream.java | 82 +- .../dataregion/wal/io/WALMetaData.java | 98 +- .../storageengine/dataregion/wal/io/WALReader.java | 21 +- .../storageengine/dataregion/wal/io/WALWriter.java | 22 +- .../storageengine/dataregion/wal/node/WALNode.java | 12 +- .../dataregion/wal/recover/WALNodeRecoverTask.java | 54 +- .../dataregion/wal/recover/WALRepairWriter.java | 125 +- .../db/storageengine/load/LoadTsFileManager.java | 78 +- .../db/storageengine/load/LoadTsFilePathUtils.java | 47 + .../load/LoadTsFilePieceNodeAssembler.java | 170 + .../converter/LoadTreeTsFileTabletIterator.java | 26 +- .../load/memory/LoadTsFileMemoryBlock.java | 20 +- .../load/metrics/ActiveLoadingFilesMetricsSet.java | 6 + .../ActiveLoadingFilesNumberMetricsSet.java | 16 +- .../load/metrics/LoadTsFileMemMetricSet.java | 19 +- .../load/splitter/AlignedChunkData.java | 94 +- .../splitter/BatchedAlignedValueChunkData.java | 81 +- .../load/splitter/NonAlignedChunkData.java | 71 +- .../rescon/memory/PrimitiveArrayManager.java | 89 +- .../agent/SubscriptionBrokerAgent.java | 8 + .../agent/SubscriptionConsumerAgent.java | 147 +- .../agent/SubscriptionReceiverAgent.java | 98 +- .../broker/ConsensusSubscriptionBroker.java | 229 +- .../subscription/broker/ISubscriptionBroker.java | 3 + .../db/subscription/broker/SubscriptionBroker.java | 14 +- .../broker/SubscriptionPrefetchingQueue.java | 107 +- .../broker/SubscriptionPrefetchingQueueStates.java | 28 +- .../TsFileDeduplicationBlockingPendingQueue.java | 11 +- .../consensus/ConsensusLogToTabletConverter.java | 86 +- .../consensus/ConsensusPrefetchingQueue.java | 689 ++- .../broker/consensus/ProgressWALIterator.java | 301 +- .../batch/SubscriptionPipeTabletEventBatch.java | 21 +- .../event/cache/SubscriptionPollResponseCache.java | 24 +- ...nsensusSubscriptionPrefetchingQueueMetrics.java | 122 +- .../SubscriptionPrefetchingQueueMetrics.java | 55 +- .../receiver/SubscriptionReceiver.java | 13 + .../receiver/SubscriptionReceiverV1.java | 160 +- .../resource/SubscriptionMemoryManager.java | 335 +- .../ConsensusSubscriptionPrefetchExecutor.java | 10 + .../task/stage/SubscriptionTaskSinkStage.java | 10 + .../task/subtask/ConsensusPrefetchSubtask.java | 1 + .../task/subtask/SubscriptionSinkSubtask.java | 5 +- .../java/org/apache/iotdb/db/tools/ImportWAL.java | 1728 ++++++ .../iotdb/db/tools/TableWALDeleteConverter.java | 226 + .../iotdb/db/tools/TsFileSplitByPartitionTool.java | 45 +- .../org/apache/iotdb/db/tools/TsFileSplitTool.java | 33 +- .../org/apache/iotdb/db/utils/CommonUtils.java | 157 +- .../iotdb/db/utils/EncodingInferenceUtils.java | 30 +- .../apache/iotdb/db/utils/ErrorHandlingUtils.java | 9 + .../apache/iotdb/db/utils/QueryDataSetUtils.java | 446 +- .../org/apache/iotdb/db/utils/SchemaUtils.java | 166 +- .../org/apache/iotdb/db/utils/TabletDecoder.java | 80 +- .../apache/iotdb/db/utils/TimeValuePairUtils.java | 67 +- .../apache/iotdb/db/utils/TypeInferenceUtils.java | 31 +- .../org/apache/iotdb/db/utils/TypeServices.java | 4457 +++++++++++++++ .../db/utils/datastructure/AlignedTVList.java | 687 +-- .../iotdb/db/utils/datastructure/BinaryTVList.java | 7 +- .../db/utils/datastructure/BooleanTVList.java | 7 +- .../iotdb/db/utils/datastructure/DoubleTVList.java | 8 +- .../iotdb/db/utils/datastructure/FloatTVList.java | 6 +- .../iotdb/db/utils/datastructure/IntTVList.java | 7 +- .../iotdb/db/utils/datastructure/LongTVList.java | 7 +- .../MergeSortMultiAlignedTVListIterator.java | 62 +- .../MergeSortMultiTVListIterator.java | 49 +- .../datastructure/MultiAlignedTVListIterator.java | 71 +- .../utils/datastructure/MultiTVListIterator.java | 129 +- .../iotdb/db/utils/datastructure/TVList.java | 340 +- .../db/utils/windowing/window/WindowImpl.java | 75 +- .../org/apache/iotdb/db/auth/entity/RoleTest.java | 84 - .../org/apache/iotdb/db/auth/entity/UserTest.java | 53 - .../org/apache/iotdb/db/conf/PropertiesTest.java | 43 +- .../dataregion/DataRegionStateMachineTest.java | 53 +- .../schemaRegion/SchemaRegionManagementTest.java | 38 +- .../SchemaRegionSimpleRecoverTest.java | 76 + .../subtask/sink/PipeSinkSubtaskLifeCycleTest.java | 58 + .../subtask/sink/PipeSinkSubtaskManagerTest.java | 3 +- .../task/subtask/sink/PipeSinkSubtaskTest.java | 123 +- .../persist/PageCacheDeletionBufferTest.java | 88 + .../pipe/event/TsFileInsertionEventParserTest.java | 62 + .../db/pipe/event/common/row/PipeRowTest.java | 115 + .../db/pipe/metric/PipeMetricsRestartTest.java | 426 ++ .../PipeSchemaRegionListenerMetricsTest.java | 116 + .../metric/sink/PipeDataRegionSinkMetricsTest.java | 98 + .../pattern/CachedSchemaPatternMatcherTest.java | 83 + .../aggregate/TimeSeriesRuntimeStateTest.java | 76 + .../protocol/airgap/IoTDBAirGapReceiverTest.java | 201 + .../protocol/thrift/IoTDBDataNodeReceiverTest.java | 225 + .../memory/PipeMemoryManagerResizeTest.java | 54 + .../pipe/sink/PipeDataNodeThriftRequestTest.java | 8 +- .../iotdb/db/pipe/sink/PipeReceiverTest.java | 12 +- .../apache/iotdb/db/pipe/sink/PipeSinkTest.java | 153 +- .../batch/PipeTabletEventTsFileBatchTest.java | 1 + .../batch/PipeTransferBatchReqBuilderTest.java | 135 + .../thrift/async/IoTDBDataRegionAsyncSinkTest.java | 49 + ...peTransferTabletInsertNodeEventHandlerTest.java | 105 + .../handler/PipeTransferTrackableHandlerTest.java | 140 + .../PipeTransferTsFileHandlerCleanupTest.java | 79 +- .../sink/util/cacher/LeaderCacheUtilsTest.java | 89 + .../db/pipe/source/PipeRealtimeExtractTest.java | 1277 ++++- .../db/protocol/client/ConfigNodeInfoTest.java | 75 + .../db/protocol/session/QueryOwnershipTest.java | 343 ++ .../DataNodeInternalRPCServiceImplDiskTest.java | 43 +- .../DataNodeInternalRPCServiceImplLoadTest.java | 94 + ...eInternalRPCServiceImplSetSystemStatusTest.java | 91 + .../db/queryengine/common/MPPQueryContextTest.java | 58 + .../queryengine/execution/ConfigExecutionTest.java | 27 + .../SinkChannelFailurePropagationTest.java | 12 +- .../execution/exchange/SinkChannelTest.java | 16 +- .../execution/exchange/SourceHandleTest.java | 265 +- .../db/queryengine/execution/exchange/Utils.java | 7 + .../fragment/FileReaderReferenceLifecycleTest.java | 189 + .../RegionQueryInitializationLockTest.java | 280 + .../fragment/RegionScanTimeSliceTest.java | 96 + .../operator/LastQueryCollectOperatorTest.java | 140 + .../process/TableStreamSortOperatorTest.java | 63 + .../process/fill/GroupedFillOperatorTest.java | 174 + .../process/window/TopKRankingOperatorTest.java | 75 +- .../source/SeriesScanUtilCancellationTest.java | 557 ++ .../operator/source/ShowReceiversOperatorTest.java | 571 ++ .../InformationSchemaReceiversSupplierTest.java | 406 ++ .../schedule/DefaultDriverSchedulerTest.java | 81 + .../plan/analyze/load/LoadTsFileAnalyzerTest.java | 16 +- .../metadata/ShowClusterDetailsTaskTest.java | 172 + .../config/metadata/ShowClusterTaskTest.java | 168 + .../config/metadata/ShowConfigNodesTaskTest.java | 121 + .../config/metadata/ShowDataNodesTaskTest.java | 114 + .../metadata/relational/ShowCreateTaskTest.java | 46 +- .../ConvertPredicateToFilterVisitorTest.java | 104 + .../plan/parser/StatementGeneratorTest.java | 28 + .../plan/planner/LastQueryCacheTest.java | 236 + .../planner/node/source/SourceNodeSerdeTest.java | 11 + .../node/write/InsertTabletNodeSerdeTest.java | 71 + .../plan/relational/analyzer/AnalyzerTest.java | 138 + .../plan/relational/analyzer/AuthTest.java | 51 + .../plan/relational/planner/PlanTester.java | 6 +- .../planner/WindowFunctionOptimizationTest.java | 12 +- .../informationschema/ShowReceiversTest.java | 128 + .../OrderingPropertyPropagationTest.java | 481 ++ .../optimizations/TableFunctionSortTest.java | 263 + .../load/LoadTsFileDispatcherImplTest.java | 225 + .../crud/InsertStatementPartialInsertTest.java | 28 + .../dag/adapter/RowGetDoubleTest.java | 98 + .../dag/input/ConstantInputReaderTest.java | 78 + .../dag/util/TransformUtilsTest.java | 117 + .../iotdb/db/schemaengine/SchemaEngineTest.java | 57 + .../metric/SchemaMemMetricTableTest.java | 133 + .../tag/TagManagerPerformanceTest.java | 258 + .../schemaregion/tag/TagManagerTest.java | 64 + .../schemaengine/table/DataNodeTableCacheTest.java | 114 + .../metrics/DataNodeMetricsRestartTest.java | 290 + .../db/service/metrics/file/TsFileMetricsTest.java | 148 + .../buffer/TimeSeriesMetadataCacheTest.java | 4 +- .../storageengine/dataregion/DataRegionTest.java | 43 + .../dataregion/DatabaseMemMetricsTest.java | 144 + .../utils/writer/AbstractCompactionWriterTest.java | 125 +- .../compaction/utils/CompactionCheckerUtils.java | 9 +- .../compaction/utils/CompactionUtilsTest.java | 43 +- ...gnedFlushDuplicateTimeCheckPerformanceTest.java | 238 + .../memtable/AlignedTVListIteratorTest.java | 86 + .../dataregion/memtable/MemTableFlushTaskTest.java | 157 + .../memtable/NonAlignedTVListIteratorTest.java | 72 + .../dataregion/memtable/PrimitiveMemTableTest.java | 23 +- .../TabletDeviceRangeReusePerformanceTest.java | 283 + .../dataregion/memtable/TsFileProcessorTest.java | 110 + ...FileTableSchemaRegistrationPerformanceTest.java | 230 + .../control/FileReaderManagerConcurrencyTest.java | 871 +++ .../read/reader/common/AscFakedSeriesReader.java | 8 +- .../read/reader/common/DescFakedSeriesReader.java | 8 +- .../dataregion/snapshot/IoTDBSnapshotTest.java | 10 +- .../dataregion/tsfile/TsFileLockTest.java | 108 + .../dataregion/utils/TableDiskUsageTest.java | 8 + .../dataregion/wal/buffer/WALBufferCommonTest.java | 27 + .../wal/buffer/WALBufferRollRecoveryTest.java | 300 ++ .../dataregion/wal/io/WALFileTest.java | 289 +- .../wal/recover/WALRepairWriterTest.java | 140 +- .../load/LoadTsFilePieceNodeAssemblerTest.java | 215 + .../load/converter/LoadTsFileInvalidPathTest.java | 195 + .../rescon/disk/FolderManagerTest.java | 57 +- .../agent/SubscriptionConsumerAgentTest.java | 114 + .../agent/SubscriptionReceiverAgentTest.java | 412 +- .../ConsensusSubscriptionBrokerOwnershipTest.java | 192 + ...onsensusSubscriptionBrokerPayloadLimitTest.java | 67 + .../SubscriptionBrokerAgentPayloadLimitTest.java | 14 + ...sFileDeduplicationBlockingPendingQueueTest.java | 68 + .../ConsensusLogToTabletConverterTest.java | 10 + ...onsensusPrefetchingQueueDataNodeMemoryTest.java | 249 +- .../ConsensusPrefetchingQueueSeekTest.java | 241 + .../consensus/ConsensusPrefetchingQueueTest.java | 1228 ++++- ...nsensusPrefetchingQueueWalBackpressureTest.java | 19 +- .../broker/consensus/ProgressWALIteratorTest.java | 375 +- .../SubscriptionPipeTabletEventBatchTest.java | 256 + .../cache/SubscriptionPollResponseCacheTest.java | 60 + ...susSubscriptionPrefetchingQueueMetricsTest.java | 88 + .../metric/SubscriptionMetricsRestartTest.java | 188 + .../receiver/SubscriptionReceiverV1Test.java | 196 +- .../resource/SubscriptionMemoryManagerTest.java | 108 + .../org/apache/iotdb/db/tools/ImportWALTest.java | 2070 +++++++ .../db/tools/TableWALDeleteConverterTest.java | 318 ++ .../iotdb/db/utils/QueryDataSetUtilsTest.java | 109 +- .../apache/iotdb/db/utils/SerializeUtilsTest.java | 132 +- .../utils/TSDataTypeSwitchArchitectureTest.java} | 24 +- .../iotdb/db/utils/TSDataTypeSwitchRule.java | 182 + .../iotdb/db/utils/TSDataTypeSwitchRuleTest.java | 186 + .../apache/iotdb/db/utils/TypeServicesTest.java | 305 ++ .../db/utils/datastructure/AlignedTVListTest.java | 90 + .../src/test/resources/iotdb-system.properties | 3 + iotdb-core/metrics/core/pom.xml | 5 + .../metrics/core/reporter/IoTDBJmxReporter.java | 115 +- .../iotdb/metrics/core/type/IoTDBAutoGauge.java | 5 +- .../core/utils/IoTDBMetricObjNameFactory.java | 38 +- .../metrics/core/utils/ObjectNameFactory.java | 45 + .../metrics/core/MetricManagerLifecycleTest.java | 339 ++ .../core/reporter/IoTDBJmxReporterTest.java | 205 + .../metrics/core/type/IoTDBAutoGaugeTest.java | 68 + .../core/utils/IoTDBMetricObjNameFactoryTest.java | 123 + .../iotdb/metrics/AbstractMetricManager.java | 215 +- .../iotdb/metrics/metricsets/jvm/JvmGcMetrics.java | 86 +- .../metrics/metricsets/system/SystemMetrics.java | 13 +- .../reporter/iotdb/IoTDBSessionReporter.java | 1 + .../resources/conf/edge/iotdb-system.properties | 1 + .../conf/iotdb-system.properties.template | 119 +- .../apache/iotdb/commons/i18n/ClientMessages.java | 3 + .../apache/iotdb/commons/i18n/CommonMessages.java | 6 + .../apache/iotdb/commons/i18n/LBACMessages.java | 32 + .../apache/iotdb/commons/i18n/PipeMessages.java | 2 - .../apache/iotdb/commons/i18n/ServiceMessages.java | 2 + .../apache/iotdb/commons/i18n/ClientMessages.java | 3 + .../apache/iotdb/commons/i18n/CommonMessages.java | 6 + .../apache/iotdb/commons/i18n/LBACMessages.java | 32 + .../apache/iotdb/commons/i18n/PipeMessages.java | 2 - .../apache/iotdb/commons/i18n/ServiceMessages.java | 2 + .../commons/audit/UserDataTransferErrorCode.java | 3 +- .../org/apache/iotdb/commons/auth/entity/Role.java | 64 - .../org/apache/iotdb/commons/auth/entity/User.java | 64 - .../commons/auth/role/LocalFileRoleAccessor.java | 69 +- .../commons/auth/user/LocalFileUserAccessor.java | 6 +- .../apache/iotdb/commons/client/ClientManager.java | 19 +- .../iotdb/commons/client/ClientManagerMetrics.java | 200 +- .../apache/iotdb/commons/cluster/NodeStatus.java | 102 +- .../apache/iotdb/commons/cluster/RegionStatus.java | 5 + .../commons/concurrent/ThreadPoolMetrics.java | 74 +- .../WrappedScheduledExecutorService.java | 4 +- .../WrappedSingleThreadExecutorService.java | 4 +- .../WrappedSingleThreadScheduledExecutor.java | 4 +- .../threadpool/WrappedThreadPoolExecutor.java | 4 +- .../apache/iotdb/commons/conf/CommonConfig.java | 63 +- .../iotdb/commons/conf/CommonDescriptor.java | 16 +- .../apache/iotdb/commons/disk/FolderManager.java | 14 +- .../commons/disk/strategy/DirectoryStrategy.java | 4 +- .../commons/enums/HandleSystemErrorStrategy.java | 6 +- .../exception/table/TableInDeletionException.java | 47 +- .../commons/lbac/LBACAccessDeniedException.java | 56 + .../iotdb/commons/lbac/LBACRuntimeException.java | 26 +- .../apache/iotdb/commons/lbac/RequiredLabels.java | 79 + .../commons/lbac/operation/LabelAccessType.java | 9 +- .../apache/iotdb/commons/path/PathPatternNode.java | 31 +- .../apache/iotdb/commons/path/PathPatternUtil.java | 6 +- .../agent/plugin/builtin/BuiltinPipePlugin.java | 36 +- .../iotdb/commons/pipe/agent/task/PipeTask.java | 8 + .../commons/pipe/agent/task/PipeTaskAgent.java | 24 +- .../pipe/agent/task/stage/PipeTaskStage.java | 8 + .../task/subtask/PipeAbstractSinkSubtask.java | 3 +- .../pipe/config/constant/PipeSinkConstant.java | 7 +- .../pipe/config/constant/PipeSourceConstant.java | 5 + .../pipe/metric/PipeEventCommitMetrics.java | 20 +- .../commons/pipe/receiver/IoTDBFileReceiver.java | 95 + .../runtime/PipeReceiverRuntimeRegistry.java | 355 ++ .../runtime/PipeReceiverRuntimeSnapshot.java | 115 + .../pipe/sink/client/IoTDBClientManager.java | 25 + .../pipe/sink/client/IoTDBSyncClientManager.java | 110 +- .../common/PipeTransferHandshakeConstant.java | 2 + .../payload/thrift/request/PipeRequestType.java | 3 + .../thrift/request/PipeTransferHandshakeV1Req.java | 3 +- .../thrift/request/PipeTransferHandshakeV2Req.java | 8 +- ...eTransferPipeReceiverRuntimeInfoCleanupReq.java | 103 + .../commons/pipe/sink/protocol/IoTDBSink.java | 27 + .../pipe/sink/protocol/IoTDBSslSyncSink.java | 22 + .../execution/MemoryEstimationHelper.java | 13 + .../plan/planner/plan/node/PlanNodeType.java | 1 + .../function/TableBuiltinTableFunction.java | 34 +- .../plan/relational/metadata/ColumnSchema.java | 13 +- .../plan/relational/type/InternalTypeManager.java | 67 +- .../schema/column/ColumnHeaderConstant.java | 44 + .../table/AlterOrDropTableOperationType.java | 5 +- .../commons/schema/table/InformationSchema.java | 75 + .../apache/iotdb/commons/schema/table/TsTable.java | 2 + .../service/metric/JvmGcMonitorMetrics.java | 38 +- .../commons/service/metric/MetricService.java | 13 +- .../iotdb/commons/service/metric/enums/Metric.java | 13 + .../iotdb/commons/service/metric/enums/Tag.java | 1 + .../meta/consumer/ConsumerGroupMeta.java | 31 +- .../iotdb/commons/udf/builtin/TypeServices.java | 671 +++ .../apache/iotdb/commons/udf/builtin/UDTFAbs.java | 106 +- .../iotdb/commons/udf/builtin/UDTFBottomK.java | 105 +- .../commons/udf/builtin/UDTFChangePoints.java | 178 +- .../commons/udf/builtin/UDTFCommonDerivative.java | 41 +- .../udf/builtin/UDTFCommonValueDifference.java | 42 +- .../iotdb/commons/udf/builtin/UDTFConst.java | 267 +- .../udf/builtin/UDTFContinuouslySatisfy.java | 79 +- .../iotdb/commons/udf/builtin/UDTFDerivative.java | 11 + .../udf/builtin/UDTFEqualSizeBucketAggSample.java | 53 +- .../udf/builtin/UDTFEqualSizeBucketM4Sample.java | 39 +- .../builtin/UDTFEqualSizeBucketOutlierSample.java | 53 +- .../builtin/UDTFEqualSizeBucketRandomSample.java | 40 +- .../iotdb/commons/udf/builtin/UDTFInRange.java | 162 +- .../apache/iotdb/commons/udf/builtin/UDTFM4.java | 36 +- .../apache/iotdb/commons/udf/builtin/UDTFMath.java | 149 +- .../udf/builtin/UDTFNonNegativeDerivative.java | 48 +- .../builtin/UDTFNonNegativeValueDifference.java | 49 +- .../iotdb/commons/udf/builtin/UDTFOnOff.java | 153 +- .../iotdb/commons/udf/builtin/UDTFSelectK.java | 136 +- .../apache/iotdb/commons/udf/builtin/UDTFTopK.java | 65 +- .../commons/udf/builtin/UDTFValueDifference.java | 12 + .../iotdb/commons/udf/builtin/UDTFValueTrend.java | 42 +- .../iotdb/commons/udf/utils/MasterRepairUtil.java | 32 +- .../commons/udf/utils/UDFDataTypeTransformer.java | 107 +- .../apache/iotdb/commons/utils/SerializeUtils.java | 371 +- .../commons/client/ClientManagerMetricsTest.java | 580 ++ .../iotdb/commons/cluster/NodeStatusTest.java | 91 + .../commons/concurrent/ThreadPoolMetricsTest.java | 157 + .../iotdb/commons/conf/CommonConfigTest.java | 230 +- ...ubscriptionCacheMemoryUsagePercentageTest.java} | 30 +- .../iotdb/commons/path/PathPatternNodeTest.java | 71 + .../pipe/metric/PipeEventCommitMetricsTest.java | 99 + .../runtime/PipeReceiverRuntimeRegistryTest.java | 947 ++++ .../thrift/request/PipeRequestTypeTest.java | 25 + .../commons/pipe/task/PipeSleepIntervalTest.java | 17 + .../relational/type/InternalTypeManagerTest.java | 61 + .../service/metric/JvmGcMonitorMetricsTest.java | 72 + .../service/metric/MetricReporterSwitchTest.java | 166 + .../service/metric/MetricServiceRestartTest.java | 218 + .../consumer/ConsumerGroupDeSerTest.java | 26 + .../commons/udf/utils/MasterRepairUtilTest.java | 94 + .../udf/utils/UDFDataTypeTransformerTest.java | 71 + .../db/relational/grammar/sql/RelationalSql.g4 | 8 +- .../src/main/thrift/confignode.thrift | 21 +- .../src/main/thrift/datanode.thrift | 11 + .../opc-ua-sink-example}/pom.xml | 21 +- .../java/org/apache/iotdb/opcua/ClientExample.java | 0 .../apache/iotdb/opcua/ClientExampleRunner.java | 0 .../java/org/apache/iotdb/opcua/ClientTest.java | 0 .../iotdb/opcua/IoTDBKeyStoreLoaderClient.java | 0 library-pipe/opc-ua-sink/README.md | 82 + .../consensus => library-pipe/opc-ua-sink}/pom.xml | 169 +- .../iotdb/pipe/plugin/sink}/opcua/OpcUaSink.java | 91 +- .../plugin/sink}/opcua/client/ClientRunner.java | 2 +- .../opcua/client/IoTDBKeyStoreLoaderClient.java | 2 +- .../sink}/opcua/client/IoTDBOpcUaClient.java | 10 +- .../sink}/opcua/server/OpcUaKeyStoreLoader.java | 2 +- .../plugin/sink}/opcua/server/OpcUaNameSpace.java | 143 +- .../sink}/opcua/server/OpcUaServerBuilder.java | 2 +- .../sink/opcua/server/OpcUaTypeServices.java | 145 + .../pipe/plugin/sink/opcua/OpcUaSinkTest.java | 242 + .../sink}/opcua/OpcUaSinkTsFileMetadataTest.java | 2 +- .../opcua/OpcUaSinkTsFilePerformanceTest.java | 6 +- .../sink}/opcua/client/ClientRunnerTest.java | 2 +- .../sink}/opcua/client/IoTDBOpcUaClientTest.java | 9 +- .../opcua/server/OpcUaNameSpaceMetadataTest.java | 9 +- .../sink}/opcua/server/OpcUaServerBuilderTest.java | 2 +- .../server/OpcUaTcpNoneCompatibilityTest.java | 2 +- .../sink/opcua/server/OpcUaTypeServicesTest.java | 29 +- library-pipe/pom.xml | 68 + library-udf/pom.xml | 5 + .../iotdb/library/i18n/LibraryUdfMessages.java | 15 + .../iotdb/library/i18n/LibraryUdfMessages.java | 12 + .../apache/iotdb/library/anomaly/UDTFKSigma.java | 62 +- .../apache/iotdb/library/anomaly/UDTFRange.java | 53 +- .../iotdb/library/anomaly/UDTFTwoSidedFilter.java | 38 +- .../iotdb/library/dprofile/UDAFPercentile.java | 218 +- .../iotdb/library/dprofile/UDAFQuantile.java | 137 +- .../apache/iotdb/library/dprofile/UDAFSpread.java | 99 +- .../iotdb/library/dprofile/UDTFDistinct.java | 299 +- .../apache/iotdb/library/dprofile/UDTFSample.java | 50 +- .../dprofile/util/ExactOrderStatistics.java | 210 +- .../iotdb/library/drepair/UDTFTimestampRepair.java | 36 +- .../iotdb/library/drepair/UDTFValueFill.java | 36 +- .../iotdb/library/drepair/UDTFValueRepair.java | 37 +- .../library/frequency/UDFEnvelopeAnalysis.java | 45 +- .../apache/iotdb/library/match/UDAFDTWMatch.java | 26 +- .../iotdb/library/match/UDAFPatternMatch.java | 25 +- .../apache/iotdb/library/util/TypeServices.java | 317 ++ .../java/org/apache/iotdb/library/util/Util.java | 79 +- .../org/apache/iotdb/library/UDFEnvelopeTest.java | 23 + licenses/Bouncy Castle Licence | 17 + pom.xml | 75 +- scripts/sbin/windows/start-confignode.bat | 4 +- scripts/sbin/windows/start-datanode.bat | 4 +- scripts/sbin/windows/start-standalone.bat | 7 +- scripts/tools/README.md | 156 + .../__init__.py => scripts/tools/import-wal.sh | 60 +- scripts/tools/windows/import-wal.bat | 43 + 1156 files changed, 86686 insertions(+), 30035 deletions(-) diff --cc iotdb-client/session/src/main/java/org/apache/iotdb/session/util/SessionUtils.java index 3c316824334,d6ff4d735ae..1f6c6a3d0aa --- a/iotdb-client/session/src/main/java/org/apache/iotdb/session/util/SessionUtils.java +++ b/iotdb-client/session/src/main/java/org/apache/iotdb/session/util/SessionUtils.java @@@ -163,33 -123,10 +123,37 @@@ public class SessionUtils return buffer; } + public static void validateNumericRowNullBitmap(BitMap nullBitmap, int fieldCount) { + if (nullBitmap != null && nullBitmap.getSize() != fieldCount) { + throw new IllegalArgumentException( + String.format( + SessionMessages + .EXCEPTION_NUMERIC_ROW_NULL_BITMAP_SIZE_MISMATCH_EXPECTED_ARG_FIELDS_BUT_GOT_ARG_8D30F6A0, + fieldCount, + nullBitmap.getSize())); + } + } + + /** Encodes FIELD bits LSB first with zero padding, including when BitMap.markAll() was used. */ + public static ByteBuffer encodeNumericRowNullBitmap(BitMap nullBitmap, ByteBuffer buffer) { + int fieldCount = nullBitmap.getSize(); + int length = (fieldCount + 7) / 8; + if (buffer == null) { + buffer = ByteBuffer.allocate(length); + } + buffer.clear(); + buffer.put(nullBitmap.getByteArray(), 0, length); + if (fieldCount % 8 != 0) { + buffer.put(length - 1, (byte) (buffer.get(length - 1) & ((1 << (fieldCount % 8)) - 1))); + } + buffer.flip(); + return buffer; + } + + public static Object sortValueList(Object valueList, TSDataType dataType, int[] index) { + return SessionTypeServices.valueListSorter(dataType).sort(valueList, index); + } + public static int calculateLength(List<TSDataType> types, List<? extends Object> values) throws IoTDBConnectionException { int res = 0; diff --cc iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeMiscMessages.java index d7e2081e760,fc241312e51..1a7a5996fc5 --- a/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeMiscMessages.java +++ b/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeMiscMessages.java @@@ -1488,29 -1497,14 +1497,38 @@@ public final class DataNodeMiscMessage public static final String LOG_TABLE_QUERY_DEVICE_ENTRY_BATCH_SIZE_IN_BYTES_ARG_EXCEEDS_DN_THRIFT_MAX_FRAME_SIZE_ARG_USING_ARG_AS_THE_EFFECTIVE_VALUE_2AE1BEDA = "table_query_device_entry_batch_size_in_bytes (%d) exceeds the maximum RPC payload (dn_thrift_max_frame_size %d minus 1024 bytes); using %d as the effective value"; + public static final String + LOG_MPP_DATA_EXCHANGE_MAX_PAYLOAD_SIZE_ARG_IS_NOT_POSITIVE_USING_DEFAULT_VALUE_ARG_1AA821B2 = + "mpp_data_exchange_max_payload_size_in_bytes (%d) is not positive, using default value %d"; + public static final String + LOG_MPP_DATA_EXCHANGE_MAX_PAYLOAD_SIZE_ARG_EXCEEDS_MAXIMUM_ALLOWED_VALUE_ARG_USING_ARG_D9BF0BBC = + "mpp_data_exchange_max_payload_size_in_bytes (%d) exceeds the maximum allowed value %d, using %d"; + public static final String + LOG_MPP_DATA_EXCHANGE_MAX_PAYLOAD_SIZE_ARG_IS_BELOW_MINIMUM_ALLOWED_VALUE_ARG_USING_ARG_794ABC76 = + "mpp_data_exchange_max_payload_size_in_bytes (%d) is below the minimum allowed value %d, using %d"; + public static final String EXCEPTION_INVALID_PREPARED_NUMERIC_ROW_METADATA_OR_PAYLOAD_AECCCEAA = "Invalid prepared numeric row metadata or payload."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_REQUEST_IS_NULL_5A9F9BA9 = "Prepared numeric row request is null."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_DATABASE_IS_NULL_F2A2E0AC = "Prepared numeric row database is null."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_TABLE_NAME_IS_NULL_OR_EMPTY_F2D38BE5 = "Prepared numeric row table name is null or empty."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_MEASUREMENTS_ARE_NULL_830DE646 = "Prepared numeric row measurements are null."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_DATA_TYPES_ARE_NULL_7C15F477 = "Prepared numeric row data types are null."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_CATEGORIES_ARE_NULL_6F2EE1BE = "Prepared numeric row column categories are null."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_HAS_NO_COLUMNS_D4E40365 = "Prepared numeric row has no columns."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_METADATA_SIZE_MISMATCH_MEASUREMENTS_ARG_DATA_TYPES_ARG_CATEGORIES_ARG_23DAB34B = "Prepared numeric row column metadata size mismatch: measurements %d, data types %d, categories %d."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_NAME_IS_NULL_OR_EMPTY_AT_INDEX_ARG_DEBDCFF8 = "Prepared numeric row column name is null or empty at index %d."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_NAME_IS_DUPLICATED_AT_INDEX_ARG_ARG_73AAFECC = "Prepared numeric row column name is duplicated at index %d: %s."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_DATA_TYPE_IS_NULL_AT_INDEX_ARG_FB2A1FD6 = "Prepared numeric row data type is null at index %d."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_DATA_TYPE_ORDINAL_IS_INVALID_AT_INDEX_ARG_ARG_BB5059BB = "Prepared numeric row data type ordinal is invalid at index %d: %d."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_CATEGORY_IS_NULL_AT_INDEX_ARG_3ED8315E = "Prepared numeric row column category is null at index %d."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_IS_INVALID_AT_INDEX_ARG_CATEGORY_ARG_AND_TYPE_ARG_9DAEEA10 = "Prepared numeric row column is invalid at index %d: category %d and type %s."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_HAS_NO_FIELD_COLUMNS_A76209AE = "Prepared numeric row has no FIELD columns."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_TAG_BUFFER_IS_NULL_3FF27BF7 = "Prepared numeric row tag buffer is null."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_VALUE_BUFFER_IS_NULL_A928F919 = "Prepared numeric row value buffer is null."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_VALUE_BUFFER_SIZE_MISMATCH_EXPECTED_ARG_BYTES_BUT_GOT_ARG_B75D48C8 = "Prepared numeric row value buffer size mismatch: expected %d bytes but got %d."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_TAG_LENGTH_PREFIX_IS_INCOMPLETE_AT_INDEX_ARG_ARG_BYTES_REMAINING_6D342F3A = "Prepared numeric row tag length prefix is incomplete at index %d: %d bytes remaining."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_TAG_LENGTH_IS_INVALID_AT_INDEX_ARG_LENGTH_ARG_ARG_BYTES_REMAINING_DEDD1E8F = "Prepared numeric row tag length is invalid at index %d: length %d, %d bytes remaining."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_TAG_BUFFER_HAS_ARG_TRAILING_BYTES_042CF4D2 = "Prepared numeric row tag buffer has %d trailing bytes."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_PAYLOAD_DECODING_FAILED_ARG_F87689DD = "Prepared numeric row payload decoding failed: %s."; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_IS_CLOSED_OR_DOES_NOT_BELONG_TO_THIS_SESSION_5CC5C50A = "Prepared numeric row is closed or does not belong to this session."; } diff --cc iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java index 63de7dbb603,1672c9024f5..fbc9fae8b17 --- a/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java +++ b/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java @@@ -20,13 -20,15 +20,21 @@@ package org.apache.iotdb.db.i18n; public final class DataNodeQueryMessages { + public static final String EXCEPTION_NUMERIC_ROW_NULL_BITMAP_LENGTH_MISMATCH_EXPECTED_ARG_BYTES_FOR_ARG_FIELDS_BUT_GOT_ARG_31F1DB42 = + "Numeric row null bitmap length mismatch: expected %d bytes for %d FIELDs but got %d"; + public static final String EXCEPTION_NUMERIC_ROW_NULL_BITMAP_HAS_SET_BITS_OUTSIDE_ARG_FIELDS_AD6066D1 = + "Numeric row null bitmap has set bits outside %d FIELDs"; + public static final String EXCEPTION_NUMERIC_ROW_PAYLOAD_HAS_ARG_TRAILING_BYTES_89E46A34 = + "Numeric row payload has %d trailing bytes"; + public static final String EXCEPTION_FRAGMENT_INSTANCE_ARG_IS_ALREADY_ARG_B44984B4 = + "Fragment instance %s is already %s"; + + public static final String EXCEPTION_INVALID_THRIFT_MAXIMUM_FRAME_SIZE_ARG_FROM_ARG_A639588B = + "Invalid Thrift maximum frame size %d from %s"; + public static final String MESSAGE_FAILED_TO_DISPATCH_LOAD_COMMAND_ARG_TO_NODE_ARG_BECAUSE_OF_EXCEPTION_ARG_2D8A483D = + "failed to dispatch load command %s to node %s because of exception: %s"; + // --- Common --- public static final String NO_MATCHED_DATABASE_PLEASE_CHECK_THE_PATH = diff --cc iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeMiscMessages.java index c8ecb24f9e8,b0266763747..a671ebe2243 --- a/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeMiscMessages.java +++ b/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeMiscMessages.java @@@ -1468,31 -1478,14 +1478,40 @@@ public final class DataNodeMiscMessage public static final String LOG_TABLE_QUERY_DEVICE_ENTRY_BATCH_SIZE_IN_BYTES_ARG_EXCEEDS_DN_THRIFT_MAX_FRAME_SIZE_ARG_USING_ARG_AS_THE_EFFECTIVE_VALUE_2AE1BEDA = "table_query_device_entry_batch_size_in_bytes(%d)超过最大 RPC payload(dn_thrift_max_frame_size %d 减去 1024 字节),将使用 %d 作为生效值"; + public static final String + LOG_MPP_DATA_EXCHANGE_MAX_PAYLOAD_SIZE_ARG_IS_NOT_POSITIVE_USING_DEFAULT_VALUE_ARG_1AA821B2 = + "mpp_data_exchange_max_payload_size_in_bytes(%d)不是正数,将使用默认值 %d"; + public static final String + LOG_MPP_DATA_EXCHANGE_MAX_PAYLOAD_SIZE_ARG_EXCEEDS_MAXIMUM_ALLOWED_VALUE_ARG_USING_ARG_D9BF0BBC = + "mpp_data_exchange_max_payload_size_in_bytes(%d)超过允许的最大值 %d,将使用 %d"; + public static final String + LOG_MPP_DATA_EXCHANGE_MAX_PAYLOAD_SIZE_ARG_IS_BELOW_MINIMUM_ALLOWED_VALUE_ARG_USING_ARG_794ABC76 = + "mpp_data_exchange_max_payload_size_in_bytes(%d)低于允许的最小值 %d,将使用 %d"; + public static final String EXCEPTION_INVALID_PREPARED_NUMERIC_ROW_METADATA_OR_PAYLOAD_AECCCEAA = + "预备数值行元数据或数据载荷无效"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_REQUEST_IS_NULL_5A9F9BA9 = "预备数值行请求为 null"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_DATABASE_IS_NULL_F2A2E0AC = "预备数值行数据库为 null"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_TABLE_NAME_IS_NULL_OR_EMPTY_F2D38BE5 = "预备数值行表名为 null 或为空"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_MEASUREMENTS_ARE_NULL_830DE646 = "预备数值行 measurements 为 null"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_DATA_TYPES_ARE_NULL_7C15F477 = "预备数值行数据类型为 null"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_CATEGORIES_ARE_NULL_6F2EE1BE = "预备数值行列类别为 null"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_HAS_NO_COLUMNS_D4E40365 = "预备数值行没有列"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_METADATA_SIZE_MISMATCH_MEASUREMENTS_ARG_DATA_TYPES_ARG_CATEGORIES_ARG_23DAB34B = "预备数值行列元数据数量不匹配:measurements %d,数据类型 %d,列类别 %d"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_NAME_IS_NULL_OR_EMPTY_AT_INDEX_ARG_DEBDCFF8 = "预备数值行列名在下标 %d 处为 null 或为空"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_NAME_IS_DUPLICATED_AT_INDEX_ARG_ARG_73AAFECC = "预备数值行列名在下标 %d 处重复:%s"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_DATA_TYPE_IS_NULL_AT_INDEX_ARG_FB2A1FD6 = "预备数值行数据类型在下标 %d 处为 null"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_DATA_TYPE_ORDINAL_IS_INVALID_AT_INDEX_ARG_ARG_BB5059BB = "预备数值行数据类型序号在下标 %d 处无效:%d"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_CATEGORY_IS_NULL_AT_INDEX_ARG_3ED8315E = "预备数值行列类别在下标 %d 处为 null"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_COLUMN_IS_INVALID_AT_INDEX_ARG_CATEGORY_ARG_AND_TYPE_ARG_9DAEEA10 = "预备数值行列在下标 %d 处无效:类别 %d,类型 %s"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_HAS_NO_FIELD_COLUMNS_A76209AE = "预备数值行没有 FIELD 列"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_TAG_BUFFER_IS_NULL_3FF27BF7 = "预备数值行 TAG 缓冲区为 null"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_VALUE_BUFFER_IS_NULL_A928F919 = "预备数值行 FIELD 缓冲区为 null"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_VALUE_BUFFER_SIZE_MISMATCH_EXPECTED_ARG_BYTES_BUT_GOT_ARG_B75D48C8 = "预备数值行 FIELD 缓冲区大小不匹配:期望 %d 字节,实际 %d 字节"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_TAG_LENGTH_PREFIX_IS_INCOMPLETE_AT_INDEX_ARG_ARG_BYTES_REMAINING_6D342F3A = "预备数值行 TAG 长度前缀在下标 %d 处不完整:剩余 %d 字节"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_TAG_LENGTH_IS_INVALID_AT_INDEX_ARG_LENGTH_ARG_ARG_BYTES_REMAINING_DEDD1E8F = "预备数值行 TAG 长度在下标 %d 处无效:长度 %d,剩余 %d 字节"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_TAG_BUFFER_HAS_ARG_TRAILING_BYTES_042CF4D2 = "预备数值行 TAG 缓冲区有 %d 个尾随字节"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_PAYLOAD_DECODING_FAILED_ARG_F87689DD = "预备数值行数据载荷解码失败:%s"; + public static final String EXCEPTION_PREPARED_NUMERIC_ROW_IS_CLOSED_OR_DOES_NOT_BELONG_TO_THIS_SESSION_5CC5C50A = + "预备数值行已关闭或不属于当前会话"; } diff --cc iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java index 12e61875802,114fc1240ff..4066f965203 --- a/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java +++ b/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java @@@ -20,13 -20,15 +20,21 @@@ package org.apache.iotdb.db.i18n; public final class DataNodeQueryMessages { + public static final String EXCEPTION_NUMERIC_ROW_NULL_BITMAP_LENGTH_MISMATCH_EXPECTED_ARG_BYTES_FOR_ARG_FIELDS_BUT_GOT_ARG_31F1DB42 = + "Numeric row 的 null bitmap 长度不匹配:预期 %d 字节(对应 %d 个 FIELD),实际为 %d"; + public static final String EXCEPTION_NUMERIC_ROW_NULL_BITMAP_HAS_SET_BITS_OUTSIDE_ARG_FIELDS_AD6066D1 = + "Numeric row 的 null bitmap 在 %d 个 FIELD 范围外存在置位"; + public static final String EXCEPTION_NUMERIC_ROW_PAYLOAD_HAS_ARG_TRAILING_BYTES_89E46A34 = + "Numeric row 数据存在 %d 个多余的尾随字节"; + public static final String EXCEPTION_FRAGMENT_INSTANCE_ARG_IS_ALREADY_ARG_B44984B4 = + "Fragment instance %s 已处于 %s 状态"; + + public static final String EXCEPTION_INVALID_THRIFT_MAXIMUM_FRAME_SIZE_ARG_FROM_ARG_A639588B = + "Thrift 最大帧大小 %d 无效,来源:%s"; + public static final String MESSAGE_FAILED_TO_DISPATCH_LOAD_COMMAND_ARG_TO_NODE_ARG_BECAUSE_OF_EXCEPTION_ARG_2D8A483D = + "向节点派发 Load 命令失败,命令:%s,节点:%s,异常:%s"; + // --- Common --- public static final String NO_MATCHED_DATABASE_PLEASE_CHECK_THE_PATH = diff --cc iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventParser.java index 886b070a84d,7a60e99678a..08f1ce24332 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventParser.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tablet/parser/TabletInsertionEventParser.java @@@ -25,8 -25,9 +25,9 @@@ import org.apache.iotdb.commons.pipe.ev import org.apache.iotdb.commons.schema.table.column.TsTableColumnCategory; import org.apache.iotdb.db.i18n.DataNodePipeMessages; import org.apache.iotdb.db.pipe.event.common.tablet.PipeTabletUtils; -import org.apache.iotdb.db.queryengine.plan.planner.plan.node.write.InsertRowNode; +import org.apache.iotdb.db.queryengine.plan.planner.plan.node.write.AbstractInsertRowNode; import org.apache.iotdb.db.queryengine.plan.planner.plan.node.write.InsertTabletNode; + import org.apache.iotdb.db.utils.TypeServices; import org.apache.iotdb.pipe.api.access.Row; import org.apache.iotdb.pipe.api.collector.RowCollector; import org.apache.iotdb.pipe.api.collector.TabletCollector; diff --cc iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowNode.java index bb46eaf6ac1,ecf76892e4c..ba3f285d7f3 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowNode.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertRowNode.java @@@ -37,8 -38,10 +37,9 @@@ import org.apache.iotdb.db.queryengine. import org.apache.iotdb.db.storageengine.dataregion.memtable.AbstractMemTable; import org.apache.iotdb.db.storageengine.dataregion.memtable.IWritableMemChunkGroup; import org.apache.iotdb.db.storageengine.dataregion.wal.buffer.IWALByteBufferView; -import org.apache.iotdb.db.storageengine.dataregion.wal.buffer.WALEntryValue; import org.apache.iotdb.db.storageengine.dataregion.wal.utils.WALWriteUtils; import org.apache.iotdb.db.utils.TypeInferenceUtils; + import org.apache.iotdb.db.utils.TypeServices; import org.apache.tsfile.enums.TSDataType; import org.apache.tsfile.exception.NotImplementedException; diff --cc iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementType.java index 6488f76f56d,a4eca4ba7ae..a66cdcfb695 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementType.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementType.java @@@ -203,5 -203,5 +203,6 @@@ public enum StatementType SHOW_EXTERNAL_SERVICE, SHOW_DISK_USAGE, + SHOW_RECEIVERS, + INSERT_NUMERIC_ROW, } diff --cc iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java index 6800feb7a45,ebdc024aac8..4f3b54e5ca5 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java @@@ -27,7 -27,7 +27,8 @@@ import org.apache.iotdb.db.i18n.DataNod import org.apache.iotdb.db.queryengine.plan.planner.plan.node.write.InsertNode; import org.apache.iotdb.db.storageengine.dataregion.wal.buffer.IWALByteBufferView; import org.apache.iotdb.db.storageengine.dataregion.wal.utils.WALWriteUtils; +import org.apache.iotdb.db.utils.NumericRowValues; + import org.apache.iotdb.db.utils.TypeServices; import org.apache.iotdb.db.utils.datastructure.AlignedTVList; import org.apache.iotdb.db.utils.datastructure.BatchEncodeInfo; import org.apache.iotdb.db.utils.datastructure.MemPointIterator; diff --cc iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusLogToTabletConverter.java index df4a12881be,abd4c5cc381..51bec7a5320 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusLogToTabletConverter.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusLogToTabletConverter.java @@@ -711,38 -718,7 +715,12 @@@ public class ConsensusLogToTabletConver final int columnIndex, final TSDataType dataType, final Object value) { - switch (dataType) { - case BOOLEAN: - ((boolean[]) tablet.getValues()[columnIndex])[rowIndex] = (boolean) value; - break; - case INT32: - ((int[]) tablet.getValues()[columnIndex])[rowIndex] = (int) value; - break; - case DATE: - ((LocalDate[]) tablet.getValues()[columnIndex])[rowIndex] = - value instanceof LocalDate - ? (LocalDate) value - : DateUtils.parseIntToLocalDate((int) value); - break; - case INT64: - case TIMESTAMP: - ((long[]) tablet.getValues()[columnIndex])[rowIndex] = (long) value; - break; - case FLOAT: - ((float[]) tablet.getValues()[columnIndex])[rowIndex] = (float) value; - break; - case DOUBLE: - ((double[]) tablet.getValues()[columnIndex])[rowIndex] = (double) value; - break; - case TEXT: - case BLOB: - case STRING: - ((Binary[]) tablet.getValues()[columnIndex])[rowIndex] = (Binary) value; - break; - default: - LOGGER.warn(DataNodePipeMessages.PIPE_LOG_UNSUPPORTED_DATA_TYPE_C8929F11, dataType); - return; - } - Type.fromTsDataType(dataType).addValue(rowIndex, value, tablet.getValues()[columnIndex]); ++ // Row plans encode DATE as yyyyMMdd integers; Tablet stores DATE columns as LocalDate arrays. ++ final Object tabletValue = ++ dataType == TSDataType.DATE && value instanceof Integer date ++ ? DateUtils.parseIntToLocalDate(date) ++ : value; ++ Type.fromTsDataType(dataType).addValue(rowIndex, tabletValue, tablet.getValues()[columnIndex]); // Unmark the bitmap position to indicate this value is NOT null. // addTimestamp() triggers initBitMapsWithApiUsage() which marks all positions as null. final BitMap[] bitMaps = tablet.getBitMaps(); diff --cc iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java index 88c8409cf7a,e677db79339..f766d295246 --- 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 @@@ -30,8 -29,7 +29,8 @@@ import org.apache.iotdb.db.queryengine. import org.apache.iotdb.db.storageengine.dataregion.wal.buffer.IWALByteBufferView; import org.apache.iotdb.db.storageengine.dataregion.wal.utils.WALWriteUtils; import org.apache.iotdb.db.storageengine.rescon.memory.PrimitiveArrayManager; - import org.apache.iotdb.db.utils.MathUtils; +import org.apache.iotdb.db.utils.NumericRowValues; + import org.apache.iotdb.db.utils.TypeServices; import org.apache.iotdb.rpc.TSStatusCode; import org.apache.tsfile.block.column.Column; diff --cc iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/datastructure/AlignedTVListTest.java index 22626984637,8be064d0192..e324b00555f --- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/datastructure/AlignedTVListTest.java +++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/datastructure/AlignedTVListTest.java @@@ -49,49 -47,22 +49,65 @@@ import static org.junit.Assert.assertEq public class AlignedTVListTest { + @Test + public void testNumericRowsMatchObjectRowsAcrossBlocksAndSorting() { + // Reordered columns, nulls and descending timestamps must match the existing write path + // across a primitive-array block boundary and after sorting. + List<TSDataType> types = + Arrays.asList( + TSDataType.BOOLEAN, + TSDataType.INT32, + TSDataType.FLOAT, + TSDataType.DOUBLE, + TSDataType.INT64, + TSDataType.STRING); + AlignedTVList numeric = AlignedTVList.newAlignedList(types); + AlignedTVList boxed = AlignedTVList.newAlignedList(types); + try { + for (int i = ARRAY_SIZE + 3; i >= 0; i--) { + NumericRowValues row = new NumericRowValues(0, 5); + row.getValues()[0] = i; + row.getValues()[1] = i % 2; + row.getValues()[2] = -i; + row.getValues()[3] = Float.floatToRawIntBits(-0.0f); + row.getValues()[4] = Double.doubleToRawLongBits(-i * 0.25); + if (i % 3 == 0) { + row.setNull(2); + } + // Also exercise a missing STRING column in an existing memtable. + numeric.putAlignedNumericValue(i, row, new int[] {1, 2, 3, 4, 0, -1}); + boxed.putAlignedValue( + i, new Object[] {i % 2 != 0, i % 3 == 0 ? null : -i, -0.0f, -i * 0.25, (long) i, null}); + } + numeric.sort(); + boxed.sort(); + assertEquals(boxed.rowCount(), numeric.rowCount()); + for (int i = 0; i < numeric.rowCount(); i++) { + assertEquals(boxed.getTime(i), numeric.getTime(i)); + assertEquals(boxed.getAlignedValue(i), numeric.getAlignedValue(i)); + } + } finally { + numeric.clear(); + boxed.clear(); + } + } + + @Test + public void testExtendColumnRetainsImplicitNullsOnFirstWrite() { + AlignedTVList list = + AlignedTVList.newAlignedList(new ArrayList<>(Collections.singletonList(TSDataType.INT64))); + list.putAlignedValue(0, new Object[] {null}); + list.putAlignedValue(1, new Object[] {1L}); + list.extendColumn(TSDataType.INT32); + Assert.assertNull(list.getValues().get(1).get(0)); + list.putAlignedValue(2, new Object[] {2L, 7}); + Assert.assertTrue(list.isNullValue(0, 0)); + Assert.assertTrue(list.isNullValue(0, 1)); + Assert.assertTrue(list.isNullValue(1, 1)); + Assert.assertEquals(7, list.getIntByValueIndex(2, 1)); + list.clear(); + } + @Test public void testValueListArrayMemCostExcludesLazyBitmapAndNullPlaceholder() { long expected = (long) ARRAY_SIZE * Long.BYTES + NUM_BYTES_ARRAY_HEADER + NUM_BYTES_OBJECT_REF;
