lancelly commented on code in PR #14148:
URL: https://github.com/apache/iotdb/pull/14148#discussion_r1867098972


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/TableInnerJoinOperator.java:
##########
@@ -148,38 +153,40 @@ public TsBlock next() throws Exception {
     }
 
     // all the rightTsBlock is less than leftTsBlock, just skip right
-    if (comparator.lessThan(getRightEndTime(), getCurrentLeftTime())) {
-      // releaseMemory();
+    if (allRightLessThanLeft()) {
+      // release memory;
       resetRightBlockList();
       return null;
     }
 
     // all the leftTsBlock is less than rightTsBlock, just skip left
-    else if (comparator.lessThan(getLeftEndTime(), 
getRightTime(rightBlockListIdx, rightIndex))) {
+    else if (allLeftLessThanRight()) {
       leftBlock = null;
       leftIndex = 0;
       return null;
     }
 
-    long leftProbeTime = getCurrentLeftTime();
     while (!resultBuilder.isFull()) {
-
-      // all right block time is not matched
-      if (!comparator.canContinueInclusive(leftProbeTime, getRightEndTime())) {
-        // releaseMemory();
+      TsBlock lastRightTsBlock = rightBlockList.get(rightBlockList.size() - 1);
+      // all right block value is not matched
+      if (!comparator.lessThanOrEqual(
+          leftBlock,
+          leftJoinKeyPosition,
+          leftIndex,
+          lastRightTsBlock,
+          rightJoinKeyPosition,
+          lastRightTsBlock.getPositionCount() - 1)) {

Review Comment:
   Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to