hive-gitbox mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hive] abstractdog commented on a change in pull request #2225: HIVE-25061: PTF: Improve BoundaryCache
Date Mon, 03 May 2021 09:28:51 GMT

abstractdog commented on a change in pull request #2225:
URL: https://github.com/apache/hive/pull/2225#discussion_r624975027



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/ValueBoundaryScanner.java
##########
@@ -414,16 +423,35 @@ protected int computeStartPreceding(int rowIdx, PTFPartition p) throws
HiveExcep
       return r + 1;
     }
     else { // Use Case 5.
+      Pair<Integer, Object> start = binaryPreSearchBack(r, p, sortKey, rowVal, amt);
+      //start again with linear search from the last point where !isDistanceGreater was true
+      r = start.getLeft();
+      rowVal = start.getRight();
       while (r >= 0 && !isDistanceGreater(sortKey, rowVal, amt) ) {
         Pair<Integer, Object> stepResult = skipOrStepBack(r, p);
         r = stepResult.getLeft();
         rowVal = stepResult.getRight();
       }
-
       return r + 1;
     }
   }
 
+  private Pair<Integer, Object> binaryPreSearchBack(int r, PTFPartition p, Object sortKey,

Review comment:
       makes sense, this is a WIP patch, I'll still need to add at least binaryPreSearchForward
for forward searching




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Mime
View raw message