You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by le...@apache.org on 2022/10/11 14:14:45 UTC
[iotdb] branch research/M4-visualization updated: 50%
This is an automated email from the ASF dual-hosted git repository.
leirui pushed a commit to branch research/M4-visualization
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/research/M4-visualization by this push:
new 42d2f20ac2 50%
42d2f20ac2 is described below
commit 42d2f20ac2eeeb0c299aec5b8d536adbe6cfd08e
Author: Lei Rui <10...@qq.com>
AuthorDate: Tue Oct 11 22:14:51 2022 +0800
50%
---
.../dataset/groupby/LocalGroupByExecutor4CPV.java | 1 -
.../iotdb/session/MySmallRealDataWriteQueryTest.java | 4 ++--
.../iotdb/tsfile/read/reader/page/PageReader.java | 18 +++++++++++-------
3 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor4CPV.java b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor4CPV.java
index b29a0b63d8..a04ae0c6d1 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor4CPV.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutor4CPV.java
@@ -621,7 +621,6 @@ public class LocalGroupByExecutor4CPV implements GroupByExecutor {
List<IPageReader> pageReaderList =
FileLoaderUtils.loadPageReaderList(
chunkSuit4CPV.getChunkMetadata(), this.timeFilter);
- List<ChunkSuit4CPV> tmpCurrentChunkList = new ArrayList<>();
for (IPageReader pageReader : pageReaderList) { // assume only one page in a chunk
isUpdate =
((PageReader) pageReader).partialScan4CPV(candidateTimestamp); // TODO check
diff --git a/session/src/test/java/org/apache/iotdb/session/MySmallRealDataWriteQueryTest.java b/session/src/test/java/org/apache/iotdb/session/MySmallRealDataWriteQueryTest.java
index c4c49598a2..46239c8655 100644
--- a/session/src/test/java/org/apache/iotdb/session/MySmallRealDataWriteQueryTest.java
+++ b/session/src/test/java/org/apache/iotdb/session/MySmallRealDataWriteQueryTest.java
@@ -56,8 +56,8 @@ public class MySmallRealDataWriteQueryTest {
total_time_length / Math.ceil(total_point_number * 1.0 / iotdb_chunk_point_size));
private static String filePath =
"D:\\github\\m4-lsm\\iotdb\\session\\src\\test\\java\\org\\apache\\iotdb\\session\\BallSpeedSmallData.csv";
- private static int deletePercentage = 1; // 0 means no deletes. 0-100
- private static int deleteLenPercentage = 30; // 0-100 每次删除的时间长度,用chunkAvgTimeLen的百分比表示
+ private static int deletePercentage = 5; // 0 means no deletes. 0-100
+ private static int deleteLenPercentage = 20; // 0-100 每次删除的时间长度,用chunkAvgTimeLen的百分比表示
private static int timeIdx = 0; // 时间戳idx,从0开始
private static int valueIdx = 1; // 值idx,从0开始
private static int w = 3;
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/page/PageReader.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/page/PageReader.java
index 71fec969c0..2d825da0dc 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/page/PageReader.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/page/PageReader.java
@@ -267,8 +267,8 @@ public class PageReader implements IPageReader {
throws IOException { // note: [startTime,endTime), [curStartTime,curEndTime)
Map<Integer, BatchData> splitBatchDataMap = new HashMap<>();
Map<Integer, ChunkMetadata> splitChunkMetadataMap = new HashMap<>();
- while (timeDecoder.hasNext(timeBuffer)) {
- long timestamp = timeDecoder.readLong(timeBuffer);
+ long[] timeData = ((LongDeltaDecoder) timeDecoder).getDataArray4CPV(timeBuffer);
+ for (long timestamp : timeData) {
// prepare corresponding batchData
if (timestamp < curStartTime) {
valueDecoder.readLong(valueBuffer); // hard-coded, assuming value is long data type
@@ -282,7 +282,7 @@ public class PageReader implements IPageReader {
// create batchData
BatchData batch1 = BatchDataFactory.createBatchData(dataType, true, false);
splitBatchDataMap.put(idx, batch1);
- Statistics statistics = new LongStatistics(); // hard-coded, assuming value is long data type
+ LongStatistics statistics = new LongStatistics(); // hard-coded, assuming value is long data type
// create chunkMetaData
ChunkMetadata chunkMetadata1 =
new ChunkMetadata(
@@ -295,9 +295,14 @@ public class PageReader implements IPageReader {
}
BatchData batchData1 = splitBatchDataMap.get(idx);
ChunkMetadata chunkMetadata1 = splitChunkMetadataMap.get(idx);
- long aLong = valueDecoder.readLong(
- valueBuffer); // hard-coded, assuming value is long data type
- if (!isDeleted(timestamp) && (filter == null || filter.satisfy(timestamp, aLong))) {
+
+ // TODO delay the decode of value until the timestamp is valid, skip to the next point when t is invalid
+ // hard-coded, assuming value is long data type
+ long aLong = valueDecoder.readLong(valueBuffer);
+
+ if (!isDeleted(timestamp)) {
+ // remove filter, only check delete, because groupByFilter is handled in this function's own logic
+
// update batchData1
batchData1.putLong(timestamp, aLong);
// update statistics of chunkMetadata1
@@ -341,7 +346,6 @@ public class PageReader implements IPageReader {
// }
public boolean partialScan4CPV(long candidateTimestamp) {
-// System.out.println("here here here");
long[] timeData = ((LongDeltaDecoder) timeDecoder).getDataArray4CPV(timeBuffer);
for (long t : timeData) {
if (t > candidateTimestamp) {