snleee commented on code in PR #12330:
URL: https://github.com/apache/pinot/pull/12330#discussion_r1468935569


##########
pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java:
##########
@@ -580,17 +589,26 @@ private List<Map<String, Object>> 
processValidDocIdMetadata(String tableNameWith
           LOGGER.warn(msg);
           continue;
         }
-        MutableRoaringBitmap validDocIds =
-            indexSegment.getValidDocIds() != null ? 
indexSegment.getValidDocIds().getMutableRoaringBitmap() : null;
-        if (validDocIds == null) {
+
+        // Adopt the same logic as the query execution to get the valid doc 
ids. 'FilterPlanNode.run()'
+        // If the queryableDocId is available (upsert delete is enabled), we 
read the valid doc ids from it.
+        // Otherwise, we read the valid doc ids.
+        MutableRoaringBitmap validDocIdSnapshot = null;
+        if (indexSegment.getQueryableDocIds() != null) {
+          validDocIdSnapshot = 
indexSegment.getQueryableDocIds().getMutableRoaringBitmap();
+        } else if (indexSegment.getValidDocIds() != null) {
+          validDocIdSnapshot = 
indexSegment.getValidDocIds().getMutableRoaringBitmap();
+        }
+
+        if (validDocIdSnapshot == null) {

Review Comment:
   fixed



##########
pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java:
##########
@@ -580,17 +589,26 @@ private List<Map<String, Object>> 
processValidDocIdMetadata(String tableNameWith
           LOGGER.warn(msg);
           continue;
         }
-        MutableRoaringBitmap validDocIds =
-            indexSegment.getValidDocIds() != null ? 
indexSegment.getValidDocIds().getMutableRoaringBitmap() : null;
-        if (validDocIds == null) {
+
+        // Adopt the same logic as the query execution to get the valid doc 
ids. 'FilterPlanNode.run()'
+        // If the queryableDocId is available (upsert delete is enabled), we 
read the valid doc ids from it.
+        // Otherwise, we read the valid doc ids.
+        MutableRoaringBitmap validDocIdSnapshot = null;

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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to