This is an automated email from the ASF dual-hosted git repository.

leirui pushed a commit to branch research/LTS-visualization
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit fc0a6779ea1b81189a994f82cb21ccbcbd3a4303
Author: Lei Rui <[email protected]>
AuthorDate: Tue Oct 8 23:07:31 2024 +0800

    add
---
 .../groupby/LocalGroupByExecutorTri_ILTS.java      | 52 ++++++++++++----------
 1 file changed, 28 insertions(+), 24 deletions(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutorTri_ILTS.java
 
b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutorTri_ILTS.java
index 4312cfb49fa..eb35061abe8 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutorTri_ILTS.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/query/dataset/groupby/LocalGroupByExecutorTri_ILTS.java
@@ -395,26 +395,28 @@ public class LocalGroupByExecutorTri_ILTS implements 
GroupByExecutor {
                     pageReader,
                     bitSet,
                     chunkSuit4Tri.chunkMetadata.getStatistics().getCount());
-            double ch_maxDistance = -1;
-            long ch_select_t = -1;
-            double ch_select_v = -1;
-            for (QuickHullPoint point : foundPoints) {
-              IOMonitor2.DCP_D_getAllSatisfiedPageData_traversedPointNum++;
-              double distance = IOMonitor2.calculateDistance(lt, lv, point.t, 
point.v, rt, rv);
-              if (distance > ch_maxDistance) {
-                ch_maxDistance = distance;
-                ch_select_t = point.t;
-                ch_select_v = point.v;
+            if (foundPoints.size() > 0) {
+              double ch_maxDistance = -1;
+              long ch_select_t = -1;
+              double ch_select_v = -1;
+              for (QuickHullPoint point : foundPoints) {
+                IOMonitor2.DCP_D_getAllSatisfiedPageData_traversedPointNum++;
+                double distance = IOMonitor2.calculateDistance(lt, lv, 
point.t, point.v, rt, rv);
+                if (distance > ch_maxDistance) {
+                  ch_maxDistance = distance;
+                  ch_select_t = point.t;
+                  ch_select_v = point.v;
+                }
+              }
+              if (ch_maxDistance <= maxDistance) {
+                continue;
+              }
+              if (ch_select_t >= localCurStartTime && ch_select_t < 
localCurEndTime) {
+                maxDistance = ch_maxDistance;
+                select_t = ch_select_t;
+                select_v = ch_select_v;
+                continue; // note this
               }
-            }
-            if (ch_maxDistance <= maxDistance) {
-              continue;
-            }
-            if (ch_select_t >= localCurStartTime && ch_select_t < 
localCurEndTime) {
-              maxDistance = ch_maxDistance;
-              select_t = ch_select_t;
-              select_v = ch_select_v;
-              continue; // note this
             }
           }
           int count = chunkSuit4Tri.chunkMetadata.getStatistics().getCount();
@@ -479,16 +481,18 @@ public class LocalGroupByExecutorTri_ILTS implements 
GroupByExecutor {
 
   public List<QuickHullPoint> convexHullAcc(
       double lt, double lv, double rt, double rv, PageReader pageReader, 
BitSet bitSet, int count) {
-    double A = lv - rv;
-    double B = rt - lt;
-
-    BitSet reverseBitSet = IOMonitor2.reverse(bitSet);
-
     long fpt = pageReader.timeBuffer.getLong(0);
     double fpv = pageReader.valueBuffer.getDouble(pageReader.timeBufferLength);
     long lpt = pageReader.timeBuffer.getLong((count - 1) * 8);
     double lpv = pageReader.valueBuffer.getDouble(pageReader.timeBufferLength 
+ (count - 1) * 8);
 
+    // TODO 水平线?
+
+    double A = lv - rv;
+    double B = rt - lt;
+
+    BitSet reverseBitSet = IOMonitor2.reverse(bitSet);
+
     List<QuickHullPoint> LU = new ArrayList<>();
     List<QuickHullPoint> LL = new ArrayList<>();
     IOMonitor2.DCP_D_getAllSatisfiedPageData_traversedPointNum++;

Reply via email to