This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch opt_alignedTVList_column_order_check
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to
refs/heads/opt_alignedTVList_column_order_check by this push:
new 1eb692d29dd fix test
1eb692d29dd is described below
commit 1eb692d29dda5c79f253d0bf6db54c7def856fa8
Author: HTHou <[email protected]>
AuthorDate: Fri May 19 15:05:10 2023 +0800
fix test
---
.../db/utils/datastructure/AlignedTVListTest.java | 47 +++-------------------
1 file changed, 6 insertions(+), 41 deletions(-)
diff --git
a/server/src/test/java/org/apache/iotdb/db/utils/datastructure/AlignedTVListTest.java
b/server/src/test/java/org/apache/iotdb/db/utils/datastructure/AlignedTVListTest.java
index d3d41bfba95..86efdba1af0 100644
---
a/server/src/test/java/org/apache/iotdb/db/utils/datastructure/AlignedTVListTest.java
+++
b/server/src/test/java/org/apache/iotdb/db/utils/datastructure/AlignedTVListTest.java
@@ -40,18 +40,16 @@ public class AlignedTVListTest {
AlignedTVList tvList = AlignedTVList.newAlignedList(dataTypes);
for (long i = 0; i < 1000; i++) {
Object[] value = new Object[5];
- int[] columnOrder = new int[5];
for (int j = 0; j < 5; j++) {
value[j] = i;
- columnOrder[j] = j;
}
tvList.putAlignedValue(i, value);
}
for (int i = 0; i < tvList.rowCount; i++) {
StringBuilder builder = new StringBuilder("[");
- builder.append(String.valueOf(i));
+ builder.append(i);
for (int j = 1; j < 5; j++) {
- builder.append(", ").append(String.valueOf(i));
+ builder.append(", ").append(i);
}
builder.append("]");
Assert.assertEquals(builder.toString(),
tvList.getAlignedValue(i).toString());
@@ -77,10 +75,6 @@ public class AlignedTVListTest {
value[3] = 0.1f;
value[4] = 0.2d;
value[5] = new Binary("Test");
- int[] columnOrder = new int[6];
- for (int j = 0; j < 6; j++) {
- columnOrder[j] = j;
- }
tvList.putAlignedValue(i, value);
}
tvList.sort();
@@ -102,22 +96,15 @@ public class AlignedTVListTest {
AlignedTVList tvList = AlignedTVList.newAlignedList(dataTypes);
long[][] vectorArray = new long[5][1001];
List<Long> timeList = new ArrayList<>();
- int[] columnOrder = new int[5];
for (int i = 1000; i >= 0; i--) {
timeList.add((long) i);
for (int j = 0; j < 5; j++) {
vectorArray[j][i] = (long) i;
- columnOrder[j] = j;
}
}
tvList.putAlignedValues(
- ArrayUtils.toPrimitive(timeList.toArray(new Long[0])),
- vectorArray,
- null,
- columnOrder,
- 0,
- 1000);
+ ArrayUtils.toPrimitive(timeList.toArray(new Long[0])), vectorArray,
null, 0, 1000);
for (long i = 0; i < tvList.rowCount; i++) {
Assert.assertEquals(tvList.rowCount - i, tvList.getTime((int) i));
}
@@ -133,7 +120,6 @@ public class AlignedTVListTest {
}
AlignedTVList tvList = AlignedTVList.newAlignedList(dataTypes);
long[][] vectorArray = new long[5][1001];
- int[] columnOrder = new int[5];
List<Long> timeList = new ArrayList<>();
for (int i = 1000; i >= 0; i--) {
timeList.add((long) i);
@@ -142,17 +128,11 @@ public class AlignedTVListTest {
if (i % 100 == 0) {
bitMaps[j].mark(i);
}
- columnOrder[j] = j;
}
}
tvList.putAlignedValues(
- ArrayUtils.toPrimitive(timeList.toArray(new Long[0])),
- vectorArray,
- bitMaps,
- columnOrder,
- 0,
- 1000);
+ ArrayUtils.toPrimitive(timeList.toArray(new Long[0])), vectorArray,
bitMaps, 0, 1000);
for (long i = 0; i < tvList.rowCount; i++) {
Assert.assertEquals(tvList.rowCount - i, tvList.getTime((int) i));
if (i % 100 == 0) {
@@ -172,7 +152,6 @@ public class AlignedTVListTest {
}
AlignedTVList tvList = AlignedTVList.newAlignedList(dataTypes);
long[][] vectorArray = new long[5][1001];
- int[] columnOrder = new int[5];
List<Long> timeList = new ArrayList<>();
for (int i = 1000; i >= 0; i--) {
timeList.add((long) i);
@@ -181,17 +160,11 @@ public class AlignedTVListTest {
if (i % 100 == 0) {
bitMaps[j].mark(i);
}
- columnOrder[j] = j;
}
}
tvList.putAlignedValues(
- ArrayUtils.toPrimitive(timeList.toArray(new Long[0])),
- vectorArray,
- bitMaps,
- columnOrder,
- 0,
- 1000);
+ ArrayUtils.toPrimitive(timeList.toArray(new Long[0])), vectorArray,
bitMaps, 0, 1000);
AlignedTVList clonedTvList = tvList.clone();
for (long i = 0; i < tvList.rowCount; i++) {
@@ -217,9 +190,6 @@ public class AlignedTVListTest {
dataTypes.add(TSDataType.TEXT);
AlignedTVList tvList = AlignedTVList.newAlignedList(dataTypes);
- int[] columnOrder = new int[2];
- columnOrder[0] = 0;
- columnOrder[1] = 1;
for (int i = 0; i < 10; i++) {
Object[] value = new Object[2];
value[0] = i;
@@ -250,12 +220,7 @@ public class AlignedTVListTest {
}
tvList.putAlignedValues(
- ArrayUtils.toPrimitive(timeList.toArray(new Long[0])),
- vectorArray,
- bitMaps,
- columnOrder,
- 0,
- 10);
+ ArrayUtils.toPrimitive(timeList.toArray(new Long[0])), vectorArray,
bitMaps, 0, 10);
Assert.assertEquals(tvList.memoryBinaryChunkSize[1], 720);
tvList.delete(5, 15);