siddharthteotia commented on code in PR #9333:
URL: https://github.com/apache/pinot/pull/9333#discussion_r971464094


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/column/PhysicalColumnIndexContainer.java:
##########
@@ -133,7 +133,12 @@ public 
PhysicalColumnIndexContainer(SegmentDirectory.Reader segmentReader, Colum
       _rangeIndex = null;
     }
 
-    PinotDataBuffer fwdIndexBuffer = segmentReader.getIndexFor(columnName, 
ColumnIndexType.FORWARD_INDEX);
+    // Setting the 'fwdIndexBuffer' to null if forward index is enabled. No-op 
index readers will be setup for the
+    // forward index disabled columns which doesn't require the 
'fwdIndexBuffer'.
+    boolean forwardIndexDisabled = !segmentReader.hasIndexFor(columnName, 
ColumnIndexType.FORWARD_INDEX);
+    PinotDataBuffer fwdIndexBuffer = forwardIndexDisabled ? null
+        : segmentReader.getIndexFor(columnName, ColumnIndexType.FORWARD_INDEX);

Review Comment:
   Can we replace the 2 calls with just 1 call to `getIndexFor` ?



-- 
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-unsubscr...@pinot.apache.org

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


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

Reply via email to