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 0a2e8e2f69 fix
0a2e8e2f69 is described below
commit 0a2e8e2f6954b840f3b20bea7103f93a45609829
Author: Lei Rui <[email protected]>
AuthorDate: Tue Jun 28 15:04:18 2022 +0800
fix
---
.../groupby/GroupByWithoutValueFilterDataSet.java | 4 +-
.../dataset/groupby/LocalGroupByExecutor4CPV.java | 123 +++++++++++----------
.../iotdb/db/query/udf/builtin/UDTFM4MAC.java | 2 +-
.../org/apache/iotdb/db/service/TSServiceImpl.java | 2 +-
.../java/org/apache/iotdb/db/utils/QueryUtils.java | 22 ++--
5 files changed, 79 insertions(+), 74 deletions(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByWithoutValueFilterDataSet.java
b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByWithoutValueFilterDataSet.java
index bbc8ee7ef8..3d270cfa96 100644
---
a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByWithoutValueFilterDataSet.java
+++
b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/GroupByWithoutValueFilterDataSet.java
@@ -198,11 +198,11 @@ public class GroupByWithoutValueFilterDataSet extends
GroupByEngineDataSet {
boolean ascending)
throws StorageEngineException, QueryProcessException {
if (CONFIG.isEnableCPV()) {
-// System.out.println("====DEBUG====: use LocalGroupByExecutor4CPV for
CPV");
+ // System.out.println("====DEBUG====: use LocalGroupByExecutor4CPV
for CPV");
return new LocalGroupByExecutor4CPV(
path, allSensors, dataType, context, timeFilter, fileFilter,
ascending);
} else {
-// System.out.println("====DEBUG====: use LocalGroupByExecutor for MOC");
+ // System.out.println("====DEBUG====: use LocalGroupByExecutor for
MOC");
return new LocalGroupByExecutor(
path, allSensors, dataType, context, timeFilter, fileFilter,
ascending);
}
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 b63a84d321..eb819e5360 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
@@ -136,7 +136,8 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
public List<AggregateResult> calcResult(
long curStartTime, long curEndTime, long startTime, long endTime, long
interval)
throws IOException, QueryProcessException {
-// System.out.println("====DEBUG====: calcResult for [" + curStartTime +
"," + curEndTime + ")");
+ // System.out.println("====DEBUG====: calcResult for [" + curStartTime
+ "," + curEndTime +
+ // ")");
// clear result cache
for (AggregateResult result : results) {
@@ -145,7 +146,7 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
// empty currentChunkList
currentChunkList = new ArrayList<>();
-// System.out.println("====DEBUG====: deal with futureChunkList");
+ // System.out.println("====DEBUG====: deal with futureChunkList");
ListIterator itr = futureChunkList.listIterator();
List<ChunkSuit4CPV> tmpFutureChunkList = new ArrayList<>();
@@ -186,18 +187,18 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
chunkMetadata);
}
-// System.out.println(
-// "====DEBUG====: load the chunk because overlaps the M4 interval.
Version="
-// + chunkMetadata.getVersion()
-// + " "
-// + chunkMetadata.getOffsetOfChunkHeader());
+ // System.out.println(
+ // "====DEBUG====: load the chunk because overlaps the M4
interval. Version="
+ // + chunkMetadata.getVersion()
+ // + " "
+ // + chunkMetadata.getOffsetOfChunkHeader());
}
}
futureChunkList.addAll(tmpFutureChunkList);
tmpFutureChunkList = null;
itr = null;
-// System.out.println("====DEBUG====: deal with currentChunkList");
+ // System.out.println("====DEBUG====: deal with currentChunkList");
if (currentChunkList.size() == 0) {
return results;
@@ -216,7 +217,7 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
values[3] = null;
// find candidate points
-// System.out.println("====DEBUG====: find candidate points");
+ // System.out.println("====DEBUG====: find candidate points");
for (int j = 0; j < currentChunkList.size(); j++) {
ChunkMetadata chunkMetadata =
currentChunkList.get(j).getChunkMetadata();
@@ -269,7 +270,7 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
}
}
-// System.out.println("====DEBUG====: verify candidate points");
+ // System.out.println("====DEBUG====: verify candidate points");
// verify candidate points.
// firstPoint and lastPoint are valid for sure.
@@ -290,11 +291,12 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
}
}
if (isDeletedItself) {
-// System.out.println(
-// "====DEBUG====: load the chunk because candidate firstPoint is
actually deleted. Version="
-// + firstChunkMetadata.getVersion()
-// + " "
-// + firstChunkMetadata.getOffsetOfChunkHeader());
+ // System.out.println(
+ // "====DEBUG====: load the chunk because candidate
firstPoint is actually
+ // deleted. Version="
+ // + firstChunkMetadata.getVersion()
+ // + " "
+ // + firstChunkMetadata.getOffsetOfChunkHeader());
currentChunkList.remove(listIdx[0]);
List<IPageReader> pageReaderList =
@@ -325,7 +327,7 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
1,
Arrays.copyOfRange(values, 0, 1)); // first_value
isFinal[0] = true;
-// System.out.println("====DEBUG====: find firstPoint");
+ // System.out.println("====DEBUG====: find firstPoint");
}
}
if (!isFinal[1]) { // lastPoint
@@ -343,11 +345,12 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
}
}
if (isDeletedItself) {
-// System.out.println(
-// "====DEBUG====: load the chunk because candidate lastPoint is
actually deleted. Version="
-// + lastChunkMetadata.getVersion()
-// + " "
-// + lastChunkMetadata.getOffsetOfChunkHeader());
+ // System.out.println(
+ // "====DEBUG====: load the chunk because candidate
lastPoint is actually
+ // deleted. Version="
+ // + lastChunkMetadata.getVersion()
+ // + " "
+ // + lastChunkMetadata.getOffsetOfChunkHeader());
currentChunkList.remove(listIdx[1]);
List<IPageReader> pageReaderList =
@@ -379,7 +382,7 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
Arrays.copyOfRange(values, 1, 2)); // first_value
isFinal[1] = true;
-// System.out.println("====DEBUG====: find lastPoint");
+ // System.out.println("====DEBUG====: find lastPoint");
}
}
if (!isFinal[2]) { // bottomPoint
@@ -399,11 +402,12 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
}
}
if (isDeletedItself) {
-// System.out.println(
-// "====DEBUG====: load the chunk because candidate bottomPoint
is actually deleted. Version="
-// + bottomChunkMetadata.getVersion()
-// + " "
-// + bottomChunkMetadata.getOffsetOfChunkHeader());
+ // System.out.println(
+ // "====DEBUG====: load the chunk because candidate
bottomPoint is actually
+ // deleted. Version="
+ // + bottomChunkMetadata.getVersion()
+ // + " "
+ // + bottomChunkMetadata.getOffsetOfChunkHeader());
currentChunkList.remove(listIdx[2]);
List<IPageReader> pageReaderList =
@@ -450,7 +454,7 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
toMerge.add(i);
}
if (toMerge.isEmpty()) {
-// System.out.println("====DEBUG====: find bottomPoint");
+ // System.out.println("====DEBUG====: find
bottomPoint");
results
.get(4)
@@ -518,11 +522,11 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
currentChunkList.set(toMerge.get(o),
tmpCurrentChunkList.get(0));
chunkSuit4CPV = currentChunkList.get(toMerge.get(o));
-// System.out.println(
-// "====DEBUG====: load chunk for update merge. Version="
-// + chunkMetadata.getVersion()
-// + " "
-// + chunkMetadata.getOffsetOfChunkHeader());
+ // System.out.println(
+ // "====DEBUG====: load chunk for update
merge. Version="
+ // + chunkMetadata.getVersion()
+ // + " "
+ // +
chunkMetadata.getOffsetOfChunkHeader());
}
mergeReader.addReader(
chunkSuit4CPV.getBatchData().getBatchDataIterator(),
@@ -531,11 +535,11 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
while (mergeReader.hasNextTimeValuePair()) {
Pair<TimeValuePair, MergeReaderPriority> res =
mergeReader.nextElement();
TimeValuePair ret = res.left;
-// System.out.println(
-// "====DEBUG====: merge for bottomPoint. (t,v)="
-// + ret.getTimestamp()
-// + ","
-// + ret.getValue().getValue());
+ // System.out.println(
+ // "====DEBUG====: merge for bottomPoint.
(t,v)="
+ // + ret.getTimestamp()
+ // + ","
+ // + ret.getValue().getValue());
updateBatchDataMap
.get(res.right)
.putAnObject(ret.getTimestamp(), ret.getValue().getValue());
@@ -579,11 +583,11 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
.getChunkMetadata()
.setStatistics(statisticsMap.get(mergeReaderPriority));
}
-// System.out.println(
-// "====DEBUG====: merged chunks are : version="
-// + newMergedVersionList
-// + " offsets="
-// + newMergedOffsetList);
+ // System.out.println(
+ // "====DEBUG====: merged chunks are : version="
+ // + newMergedVersionList
+ // + " offsets="
+ // + newMergedOffsetList);
continue;
}
}
@@ -606,11 +610,12 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
}
}
if (isDeletedItself) {
-// System.out.println(
-// "====DEBUG====: load the chunk because candidate topPoint is
actually deleted. Version="
-// + topChunkMetadata.getVersion()
-// + " "
-// + topChunkMetadata.getOffsetOfChunkHeader());
+ // System.out.println(
+ // "====DEBUG====: load the chunk because candidate
topPoint is actually
+ // deleted. Version="
+ // + topChunkMetadata.getVersion()
+ // + " "
+ // + topChunkMetadata.getOffsetOfChunkHeader());
currentChunkList.remove(listIdx[3]);
List<IPageReader> pageReaderList =
@@ -663,7 +668,7 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
1,
Arrays.copyOfRange(values, 3, 4)); // max_value
isFinal[3] = true;
-// System.out.println("====DEBUG====: find topPoint");
+ // System.out.println("====DEBUG====: find topPoint");
return results;
} else {
// deal with toMerge chunks: delete updated points
@@ -724,11 +729,11 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
currentChunkList.set(toMerge.get(o),
tmpCurrentChunkList.get(0));
chunkSuit4CPV = currentChunkList.get(toMerge.get(o));
-// System.out.println(
-// "====DEBUG====: load chunk for update merge. Version="
-// + chunkMetadata.getVersion()
-// + " "
-// + chunkMetadata.getOffsetOfChunkHeader());
+ // System.out.println(
+ // "====DEBUG====: load chunk for update
merge. Version="
+ // + chunkMetadata.getVersion()
+ // + " "
+ // +
chunkMetadata.getOffsetOfChunkHeader());
}
mergeReader.addReader(
chunkSuit4CPV.getBatchData().getBatchDataIterator(),
@@ -737,11 +742,11 @@ public class LocalGroupByExecutor4CPV implements
GroupByExecutor {
while (mergeReader.hasNextTimeValuePair()) {
Pair<TimeValuePair, MergeReaderPriority> res =
mergeReader.nextElement();
TimeValuePair ret = res.left;
-// System.out.println(
-// "====DEBUG====: merge for topPoint. (t,v)="
-// + ret.getTimestamp()
-// + ","
-// + ret.getValue().getValue());
+ // System.out.println(
+ // "====DEBUG====: merge for topPoint. (t,v)="
+ // + ret.getTimestamp()
+ // + ","
+ // + ret.getValue().getValue());
updateBatchDataMap
.get(res.right)
.putAnObject(ret.getTimestamp(), ret.getValue().getValue());
diff --git
a/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFM4MAC.java
b/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFM4MAC.java
index 3d087dada8..4c3fd5b569 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFM4MAC.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFM4MAC.java
@@ -128,7 +128,7 @@ public class UDTFM4MAC implements UDTF {
for (int i = 0; i < w; i++) {
result[i] = "empty";
}
-// System.out.println("====DEBUG====: use UDTFM4MAC for MAC");
+ // System.out.println("====DEBUG====: use UDTFM4MAC for MAC");
}
@Override
diff --git
a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index ae5511987d..4b6db1bbaf 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -637,7 +637,7 @@ public class TSServiceImpl implements TSIService.Iface {
PhysicalPlan physicalPlan =
processor.parseSQLToPhysicalPlan(
statement, sessionManager.getZoneId(req.sessionId),
req.fetchSize);
-// System.out.println("====DEBUG====: fetchSize=" + req.fetchSize);
+ // System.out.println("====DEBUG====: fetchSize=" + req.fetchSize);
return physicalPlan.isQuery()
? internalExecuteQueryStatement(
statement,
diff --git a/server/src/main/java/org/apache/iotdb/db/utils/QueryUtils.java
b/server/src/main/java/org/apache/iotdb/db/utils/QueryUtils.java
index 81346ae261..8da3273068 100644
--- a/server/src/main/java/org/apache/iotdb/db/utils/QueryUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/utils/QueryUtils.java
@@ -112,17 +112,17 @@ public class QueryUtils {
private static void doModifyChunkMetaData(Modification modification,
ChunkMetadata metaData) {
if (modification instanceof Deletion) {
Deletion deletion = (Deletion) modification;
-// System.out.println(
-// "====DEBUG====: doModifyChunkMetaData/insertIntoSortedDeletions: "
-// + "chunkTime=["
-// + metaData.getStartTime()
-// + ","
-// + metaData.getEndTime()
-// + "],deleteTime=["
-// + deletion.getStartTime()
-// + ","
-// + deletion.getEndTime()
-// + "]");
+ // System.out.println(
+ // "====DEBUG====:
doModifyChunkMetaData/insertIntoSortedDeletions: "
+ // + "chunkTime=["
+ // + metaData.getStartTime()
+ // + ","
+ // + metaData.getEndTime()
+ // + "],deleteTime=["
+ // + deletion.getStartTime()
+ // + ","
+ // + deletion.getEndTime()
+ // + "]");
metaData.insertIntoSortedDeletions(deletion.getStartTime(),
deletion.getEndTime());
}
}