snleee commented on code in PR #12330:
URL: https://github.com/apache/pinot/pull/12330#discussion_r1468935508
##########
pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java:
##########
@@ -500,15 +500,24 @@ public Response downloadValidDocIds(
String.format("Table %s segment %s is not a immutable segment",
tableNameWithType, segmentName),
Response.Status.BAD_REQUEST);
}
- 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:
changed to `final`
##########
pinot-server/src/main/java/org/apache/pinot/server/api/resources/TablesResource.java:
##########
@@ -500,15 +500,24 @@ public Response downloadValidDocIds(
String.format("Table %s segment %s is not a immutable segment",
tableNameWithType, segmentName),
Response.Status.BAD_REQUEST);
}
- 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:
good point. I updated the logic 👍
--
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]