You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2022/08/17 02:09:52 UTC

[iotdb] branch IOTDB-4151 created (now 3196c3ff76)

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

jackietien pushed a change to branch IOTDB-4151
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 3196c3ff76 Fix IndexOutOfBound Error in last query

This branch includes the following new commits:

     new 3196c3ff76 Fix IndexOutOfBound Error in last query

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: Fix IndexOutOfBound Error in last query

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch IOTDB-4151
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 3196c3ff76523e4c5559828c1b7402d9da449f05
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Wed Aug 17 10:09:05 2022 +0800

    Fix IndexOutOfBound Error in last query
---
 .../org/apache/iotdb/db/mpp/plan/planner/OperatorTreeGenerator.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/OperatorTreeGenerator.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/OperatorTreeGenerator.java
index 5c4570a1fe..214d024741 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/OperatorTreeGenerator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/OperatorTreeGenerator.java
@@ -1586,9 +1586,11 @@ public class OperatorTreeGenerator extends PlanVisitor<Operator, LocalExecutionP
                 node.getPlanNodeId(),
                 TimeJoinOperator.class.getSimpleName());
 
-    SortItem item = node.getMergeOrderParameter().getSortItemList().get(0);
+    List<SortItem> items = node.getMergeOrderParameter().getSortItemList();
     Comparator<Binary> comparator =
-        item.getOrdering() == Ordering.ASC ? ASC_BINARY_COMPARATOR : DESC_BINARY_COMPARATOR;
+        (items.isEmpty() || items.get(0).getOrdering() == Ordering.ASC)
+            ? ASC_BINARY_COMPARATOR
+            : DESC_BINARY_COMPARATOR;
 
     context.getTimeSliceAllocator().recordExecutionWeight(operatorContext, 1);
     return new LastQueryMergeOperator(operatorContext, children, comparator);