You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/05/24 08:01:31 UTC

[GitHub] [pinot] richardstartin commented on a diff in pull request #8759: vectorize predicate evaluation

richardstartin commented on code in PR #8759:
URL: https://github.com/apache/pinot/pull/8759#discussion_r880185385


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/filter/predicate/PredicateEvaluator.java:
##########
@@ -72,6 +72,27 @@ public interface PredicateEvaluator {
    */
   boolean applySV(int value);
 
+  /**
+   * Apply the predicate to a batch of single-value entries.
+   * Compact matching entries into the prefix of the arrays.
+   *
+   * @param limit How much of the input to consume.
+   * @param docIds The docIds associated with the values - may be modified by invocation.
+   * @param values Batch of dictionary ids or raw values - may be modified by invocation.
+   * @return the index of the first non-matching entry.
+   */
+  default int applySV(int limit, int[] docIds, int[] values) {
+    int matches = 0;
+    for (int i = 0; i < limit; i++) {
+      int value = values[i];
+      if (applySV(value)) {
+        docIds[matches] = docIds[i];
+        values[matches++] = value;

Review Comment:
   Sure, I thought it could be useful in the future, e.g. to aggregate the matching values



-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org