This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch ty/InnerTimeJoin
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/ty/InnerTimeJoin by this push:
new 9887e0fa9a1 add more uts for SplitTimePartition
9887e0fa9a1 is described below
commit 9887e0fa9a1c2f494d24a4032f034932739e5916
Author: JackieTien97 <[email protected]>
AuthorDate: Fri Jan 5 15:33:13 2024 +0800
add more uts for SplitTimePartition
---
.../distribution/SplitTimePartitionTest.java | 71 ++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/SplitTimePartitionTest.java
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/SplitTimePartitionTest.java
index 5f63df62ece..7d97477b01b 100644
---
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/SplitTimePartitionTest.java
+++
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/SplitTimePartitionTest.java
@@ -202,4 +202,75 @@ public class SplitTimePartitionTest {
assertEquals(1, res.get(3).size());
assertEquals(31, res.get(3).get(0).startTime);
}
+
+ @Test
+ public void testSplitTimePartition4() {
+ // timepartition-1 timepartition-2 timepartition-3
timepartition-4
+ // SeriesSlot-1 region-2 region-2
+ // SeriesSlot-2 region-1 region-1 region-1
region-1
+ // SeriesSlot-3 region-3
region-3
+ // SeriesSlot-4 region-4 region-4 region-4
region-4
+ List<List<List<TTimePartitionSlot>>> sourceTimeRangeList = new
ArrayList<>();
+ sourceTimeRangeList.add(new ArrayList<>());
+ sourceTimeRangeList
+ .get(0)
+ .add(Arrays.asList(new TTimePartitionSlot(11), new
TTimePartitionSlot(21)));
+
+ sourceTimeRangeList.add(new ArrayList<>());
+ sourceTimeRangeList
+ .get(1)
+ .add(
+ Arrays.asList(
+ new TTimePartitionSlot(1),
+ new TTimePartitionSlot(11),
+ new TTimePartitionSlot(21),
+ new TTimePartitionSlot(31)));
+
+ sourceTimeRangeList.add(new ArrayList<>());
+ sourceTimeRangeList
+ .get(2)
+ .add(Arrays.asList(new TTimePartitionSlot(21), new
TTimePartitionSlot(31)));
+
+ sourceTimeRangeList.add(new ArrayList<>());
+ sourceTimeRangeList
+ .get(3)
+ .add(
+ Arrays.asList(
+ new TTimePartitionSlot(1),
+ new TTimePartitionSlot(11),
+ new TTimePartitionSlot(21),
+ new TTimePartitionSlot(31)));
+
+ List<List<TTimePartitionSlot>> res =
splitTimePartition(sourceTimeRangeList);
+ assertEquals(1, res.size());
+ assertEquals(1, res.get(0).size());
+ assertEquals(21, res.get(0).get(0).startTime);
+ }
+
+ @Test
+ public void testSplitTimePartition5() {
+ // timepartition-1 timepartition-2 timepartition-3
timepartition-4
+ // SeriesSlot-1 region-2 region-2
+ // SeriesSlot-2 region-1 region-1 region-2
region-2
+ List<List<List<TTimePartitionSlot>>> sourceTimeRangeList = new
ArrayList<>();
+ sourceTimeRangeList.add(new ArrayList<>());
+ sourceTimeRangeList
+ .get(0)
+ .add(Arrays.asList(new TTimePartitionSlot(11), new
TTimePartitionSlot(21)));
+
+ sourceTimeRangeList.add(new ArrayList<>());
+ sourceTimeRangeList
+ .get(1)
+ .add(Arrays.asList(new TTimePartitionSlot(1), new
TTimePartitionSlot(11)));
+ sourceTimeRangeList
+ .get(1)
+ .add(Arrays.asList(new TTimePartitionSlot(21), new
TTimePartitionSlot(31)));
+
+ List<List<TTimePartitionSlot>> res =
splitTimePartition(sourceTimeRangeList);
+ assertEquals(2, res.size());
+ assertEquals(1, res.get(0).size());
+ assertEquals(11, res.get(0).get(0).startTime);
+ assertEquals(1, res.get(1).size());
+ assertEquals(21, res.get(1).get(0).startTime);
+ }
}