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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/column/PhysicalColumnIndexContainer.java:
##########
@@ -149,7 +154,12 @@ public 
PhysicalColumnIndexContainer(SegmentDirectory.Reader segmentReader, Colum
           return;
         }
       }
-      _forwardIndex = 
indexReaderProvider.newForwardIndexReader(fwdIndexBuffer, metadata);
+      if (forwardIndexDisabled && !metadata.isSorted()) {
+        // Forward index disabled flag is a no-op for sorted columns
+        _forwardIndex = null;
+      } else {
+        _forwardIndex = 
indexReaderProvider.newForwardIndexReader(fwdIndexBuffer, metadata);
+      }

Review Comment:
   done



##########
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);

Review Comment:
   good point, done



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