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 2020/10/19 23:54:15 UTC

[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #6158: do not prune segments for selection queries over upsert table

mcvsubbu commented on a change in pull request #6158:
URL: https://github.com/apache/incubator-pinot/pull/6158#discussion_r508127942



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/pruner/SelectionQuerySegmentPruner.java
##########
@@ -76,13 +76,18 @@ public void init(PinotConfiguration config) {
     }
 
     // If LIMIT is not 0, only prune segments for selection queries without filter
-    // TODO: This does not take upsert valid doc ids filter into account, which can cause less than expected records
-    //       returned for upsert table
     FilterContext filter = queryContext.getFilter();
     if (filter != null) {
       return segmentDataManagers;
     }
 
+    // Do not prune for upsert table
+    if (!segmentDataManagers.isEmpty()) {
+      if (segmentDataManagers.get(0).getSegment().getValidDocIndex() != null) {

Review comment:
       Can valid doc index be null if there are no more valid docs in that first segment? Or, is it guaranteed that this (potential optimization) will never happen




----------------------------------------------------------------
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org