deepthi912 commented on code in PR #18020:
URL: https://github.com/apache/pinot/pull/18020#discussion_r3010877242


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/upsert/BasePartitionUpsertMetadataManager.java:
##########
@@ -962,24 +966,18 @@ protected void doTakeSnapshot() {
           continue;
         }
         ThreadSafeMutableRoaringBitmap queryableDocIdsBitMap = null;
-        ThreadSafeMutableRoaringBitmap validDocIdsBitMap =
-            immutableSegment.getValidDocIds() == null ? new 
ThreadSafeMutableRoaringBitmap()
-                : immutableSegment.getValidDocIds();
-        
immutableSegment.persistDocIdsSnapshot(V1Constants.VALID_DOC_IDS_SNAPSHOT_FILE_NAME,
-            validDocIdsBitMap);
+        ThreadSafeMutableRoaringBitmap validDocIdsBitMap = 
immutableSegment.getValidDocIds();

Review Comment:
   The reason the null check has been removed is because, null bitmap is 
possible only in 2 cases:
   1. When the table is not an upsert table - Then it will not even hit this 
flow
   2. When the segment is out of TTL and has no snapshots taken, file doesn't 
exist. In such cases, we are not hitting this code path anyway. So only added 
null check below.



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