Skip to content

Commit 7d6fcfd

Browse files
committed
resolve conflicts
2 parents cb9ea50 + e6bc39f commit 7d6fcfd

84 files changed

Lines changed: 990 additions & 470 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

RELEASE_NOTES.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@
1919
2020
-->
2121

22+
# Apache IoTDB 2.0.4
23+
24+
## Features & Improvements
25+
- Data Query: Added user-defined table functions (UDTF) and various built-in table functions to the table model.
26+
- Data Query: Added support for ASOF INNER JOIN on time columns in the table model.
27+
- Data Query: Added the approximate aggregation function approx_count_distinct to the table model.
28+
- Stream Processing: Added support for asynchronous loading of TsFile through SQL.
29+
- System Management: Added support for disaster recovery load balancing strategy in replica selection during scaling down.
30+
- System Management: Adapted to Windows Server 2025.
31+
- Scripts and Tools: Categorized and organized script tools, and separated Windows-specific scripts.
32+
- ...
33+
34+
## Bugs
35+
- Fixed the memory leak issue in the WAL compression buffer.
36+
- Fixed the issue where the async connector gets stuck after running for a long time.
37+
- Fixed the issue where data subscription cannot be terminated after using data export scripts.
38+
- Fixed the issue where pipe restarts frequently due to insertnode and resource management memory problems under memory pressure.
39+
- Fixed the NPE issue triggered during memory statistics estimation on the data synchronization receiver end.
40+
- Fixed the error when configuring ConsumerConstant.NODE_URLS_KEY as a cluster address while using SubscriptionPullConsumer to consume data.
41+
- Fixed the deadlock issue on DN startup caused by concurrent agent pipe metadata fetching and CN metadata pushing.
42+
- ...
43+
2244
# Apache IoTDB 2.0.3
2345

2446
## Features & Improvements
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.iotdb.confignode.it;
21+
22+
import org.apache.iotdb.consensus.ConsensusFactory;
23+
import org.apache.iotdb.it.env.EnvFactory;
24+
import org.apache.iotdb.it.framework.IoTDBTestRunner;
25+
import org.apache.iotdb.itbase.category.ClusterIT;
26+
27+
import org.junit.Before;
28+
import org.junit.experimental.categories.Category;
29+
import org.junit.runner.RunWith;
30+
31+
@RunWith(IoTDBTestRunner.class)
32+
@Category({ClusterIT.class})
33+
public class IoTDBConfigNodeSnapshot2IT extends IoTDBConfigNodeSnapshotIT {
34+
@Before
35+
public void setUp() throws Exception {
36+
// set setConfigNodeRatisSnapshotTriggerThreshold to 1
37+
EnvFactory.getEnv()
38+
.getConfig()
39+
.getCommonConfig()
40+
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
41+
.setConfigNodeRatisSnapshotTriggerThreshold(1)
42+
.setTimePartitionInterval(testTimePartitionInterval);
43+
44+
// Init 2C2D cluster environment
45+
EnvFactory.getEnv().initClusterEnvironment(2, 2);
46+
}
47+
}

integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,15 @@
8383
@RunWith(IoTDBTestRunner.class)
8484
@Category({ClusterIT.class})
8585
public class IoTDBConfigNodeSnapshotIT {
86-
private static final int testRatisSnapshotTriggerThreshold = 100;
87-
private static final long testTimePartitionInterval = 86400;
86+
protected final long testTimePartitionInterval = 86400;
8887

8988
@Before
9089
public void setUp() throws Exception {
9190
EnvFactory.getEnv()
9291
.getConfig()
9392
.getCommonConfig()
9493
.setConfigNodeConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
95-
.setConfigNodeRatisSnapshotTriggerThreshold(testRatisSnapshotTriggerThreshold)
94+
.setConfigNodeRatisSnapshotTriggerThreshold(100)
9695
.setTimePartitionInterval(testTimePartitionInterval);
9796

9897
// Init 2C2D cluster environment

integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBMultiTAGsWithAttributesTableIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,12 @@ public void sortTAGWithExpressionTest() {
390390
"l3,217,null,d2,1971-01-01T00:00:00.500Z,",
391391
"l3,245,t,d1,1971-04-26T17:46:40.020Z,",
392392
"l3,245,null,d2,1971-04-26T17:46:40.020Z,",
393-
"l4,52,null,d2,1970-01-01T00:00:00.080Z,",
394393
"l4,52,null,d1,1970-01-01T00:00:00.080Z,",
395-
"l4,61,null,d2,1971-01-01T00:00:01.000Z,",
394+
"l4,52,null,d2,1970-01-01T00:00:00.080Z,",
396395
"l4,61,null,d1,1971-01-01T00:00:01.000Z,",
397-
"l4,67,null,d2,1971-04-26T18:01:40.000Z,",
396+
"l4,61,null,d2,1971-01-01T00:00:01.000Z,",
398397
"l4,67,null,d1,1971-04-26T18:01:40.000Z,",
398+
"l4,67,null,d2,1971-04-26T18:01:40.000Z,",
399399
"l5,220,null,d1,1971-01-01T00:00:10.000Z,",
400400
"l5,220,null,d2,1971-01-01T00:00:10.000Z,",
401401
"l5,250,null,d1,1971-08-20T11:33:20.000Z,",
@@ -404,7 +404,7 @@ public void sortTAGWithExpressionTest() {
404404
"l5,4662,null,d2,1970-01-01T00:00:00.100Z,",
405405
};
406406
tableResultSetEqualTest(
407-
"select level,cast(num+floatNum as int32) as sum,attr1,device,time from table0 order by level asc, cast(num+floatNum as int32) asc, attr1 desc",
407+
"select level,cast(num+floatNum as int32) as sum,attr1,device,time from table0 order by level asc, cast(num+floatNum as int32) asc, attr1 desc, device asc",
408408
expectedHeader,
409409
retArray,
410410
DATABASE_NAME);

integration-test/src/test/java/org/apache/iotdb/relational/it/query/view/recent/IoTDBNullValueTableViewIT.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,18 @@ public class IoTDBNullValueTableViewIT {
4747
"insert into root.test.table1.d1(time,s1) values(0, null), (1, 1)",
4848
"flush",
4949
"insert into root.test.table1.d1(time,s1) values(0, 0)",
50-
"flush"
50+
"flush",
51+
"create aligned timeseries root.test.table2.d1(s1 string)",
52+
"insert into root.test.table2.d1(time,s1) aligned values(0, 0)",
53+
"insert into root.test.table2.d1(time,s1) aligned values(1, 1)",
5154
};
5255

5356
private static final String[] createTableViewSqls =
5457
new String[] {
5558
"CREATE DATABASE " + DATABASE_NAME,
5659
"USE " + DATABASE_NAME,
5760
"create view table1(id1 tag, s1 string) as root.test.table1.**",
61+
"create view table2(id1 tag, s1 float) as root.test.table2.**",
5862
};
5963

6064
@BeforeClass
@@ -80,5 +84,13 @@ public void nullTest() {
8084
"1970-01-01T00:00:00.000Z,d1,0,", "1970-01-01T00:00:00.001Z,d1,1,",
8185
};
8286
tableResultSetEqualTest("select * from table1", expectedHeader, retArray, DATABASE_NAME);
87+
// case 2: For aligned series, when the data types of all series in the view are inconsistent
88+
// with the data types of the actual series, the corresponding time can be queried, and other
89+
// columns are null values.
90+
retArray =
91+
new String[] {
92+
"1970-01-01T00:00:00.000Z,d1,null,", "1970-01-01T00:00:00.001Z,d1,null,",
93+
};
94+
tableResultSetEqualTest("select * from table2", expectedHeader, retArray, DATABASE_NAME);
8395
}
8496
}

iotdb-core/ainode/ainode/core/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
AINODE_ROOT_DIR,
3939
AINODE_SYSTEM_DIR,
4040
AINODE_SYSTEM_FILE_NAME,
41+
AINODE_TARGET_CONFIG_NODE_LIST,
4142
AINODE_THRIFT_COMPRESSION_ENABLED,
4243
AINODE_VERSION_INFO,
4344
)
@@ -73,7 +74,7 @@ def __init__(self):
7374
self._ain_model_storage_cache_size = 30
7475

7576
# Target ConfigNode to be connected by AINode
76-
self._ain_target_config_node_list: TEndPoint = TEndPoint("127.0.0.1", 10710)
77+
self._ain_target_config_node_list: TEndPoint = AINODE_TARGET_CONFIG_NODE_LIST
7778

7879
# use for node management
7980
self._ainode_id = 0

iotdb-core/ainode/ainode/core/constant.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
from enum import Enum
2222
from typing import List
2323

24+
from ainode.thrift.common.ttypes import TEndPoint
25+
2426
AINODE_CONF_DIRECTORY_NAME = "conf"
2527
AINODE_ROOT_CONF_DIRECTORY_NAME = "conf"
2628
AINODE_CONF_FILE_NAME = "iotdb-ainode.properties"
@@ -49,6 +51,7 @@
4951
AINODE_CLUSTER_INGRESS_USERNAME = "root"
5052
AINODE_CLUSTER_INGRESS_PASSWORD = "root"
5153
AINODE_CLUSTER_INGRESS_TIME_ZONE = "UTC+8"
54+
AINODE_TARGET_CONFIG_NODE_LIST = TEndPoint("127.0.0.1", 10710)
5255

5356
# AINode log
5457
AINODE_LOG_FILE_NAMES = [

iotdb-core/ainode/ainode/core/exception.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ def __init__(self, msg: str):
9696
self.message = "Built-in model not support: {0}".format(msg)
9797

9898

99+
class BuiltInModelDeletionError(_BaseError):
100+
def __init__(self, model_id: str):
101+
self.message = "Cannot delete built-in model: {0}".format(model_id)
102+
103+
99104
class WrongAttributeTypeError(_BaseError):
100105
def __init__(self, attribute_name: str, expected_type: str):
101106
self.message = "Wrong type for attribute: {0}, expected: {1}".format(

iotdb-core/ainode/ainode/core/handler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
TInferenceResp,
3131
TRegisterModelReq,
3232
TRegisterModelResp,
33+
TShowModelsReq,
3334
TShowModelsResp,
3435
TTrainingReq,
3536
)
@@ -58,8 +59,8 @@ def forecast(self, req: TForecastReq) -> TSStatus:
5859
def getAIHeartbeat(self, req: TAIHeartbeatReq) -> TAIHeartbeatResp:
5960
return ClusterManager.get_heart_beat(req)
6061

61-
def showModels(self) -> TShowModelsResp:
62-
return self._model_manager.show_models()
62+
def showModels(self, req: TShowModelsReq) -> TShowModelsResp:
63+
return self._model_manager.show_models(req)
6364

6465
def createTrainingTask(self, req: TTrainingReq) -> TSStatus:
6566
pass

iotdb-core/ainode/ainode/core/manager/inference_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ def infer(self, full_data, predict_length=96, **_):
8484

8585

8686
class BuiltInStrategy(InferenceStrategy):
87-
def infer(self, full_data):
87+
def infer(self, full_data, **_):
8888
data = pd.DataFrame(full_data[1]).T
8989
output = self.model.inference(data)
9090
df = pd.DataFrame(output)
9191
return convert_to_binary(df)
9292

9393

9494
class RegisteredStrategy(InferenceStrategy):
95-
def infer(self, full_data, window_interval=None, window_step=None, **kwargs):
95+
def infer(self, full_data, window_interval=None, window_step=None, **_):
9696
_, dataset, _, length = full_data
9797
if window_interval is None or window_step is None:
9898
window_interval = length
@@ -130,7 +130,7 @@ def _get_strategy(self, model_id, model):
130130
return TimerXLStrategy(model)
131131
if isinstance(model, SundialForPrediction):
132132
return SundialStrategy(model)
133-
if self.model_manager.model_storage._is_built_in(model_id):
133+
if self.model_manager.model_storage._is_built_in_or_fine_tuned(model_id):
134134
return BuiltInStrategy(model)
135135
return RegisteredStrategy(model)
136136

@@ -159,7 +159,7 @@ def _run(
159159

160160
# inference by strategy
161161
strategy = self._get_strategy(model_id, model)
162-
outputs = strategy.infer(full_data)
162+
outputs = strategy.infer(full_data, **inference_attrs)
163163

164164
# construct response
165165
status = get_status(TSStatusCode.SUCCESS_STATUS)

0 commit comments

Comments
 (0)