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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/ForwardIndexHandler.java:
##########
@@ -147,11 +187,48 @@ Map<String, Operation> 
computeOperation(SegmentDirectory.Reader segmentReader)
       }
     }
 
+    // Get list of columns with forward index and those without forward index
+    Set<String> existingForwardIndexColumns =
+        
segmentReader.toSegmentDirectory().getColumnsWithIndex(ColumnIndexType.FORWARD_INDEX);
+    Set<String> existingForwardIndexDisabledColumns = new HashSet<>();
+    for (String column : existingAllColumns) {
+      if (!existingForwardIndexColumns.contains(column)) {
+        existingForwardIndexDisabledColumns.add(column);
+      }
+    }
+
     // From new column config.
     Set<String> newNoDictColumns = 
_indexLoadingConfig.getNoDictionaryColumns();
+    Set<String> newForwardIndexDisabledColumns = 
_indexLoadingConfig.getForwardIndexDisabledColumns();
 
     for (String column : existingAllColumns) {
-      if (existingNoDictColumns.contains(column) && 
!newNoDictColumns.contains(column)) {
+      if (existingForwardIndexColumns.contains(column) && 
newForwardIndexDisabledColumns.contains(column)) {
+        ColumnMetadata columnMetadata = 
_segmentMetadata.getColumnMetadataFor(column);
+        if (columnMetadata != null && columnMetadata.isSorted()) {

Review Comment:
   this is not necessary but I just think it's a bit cleaner to check for null 
before access. don't have a strong opinion and can remove this check if you 
want me to.



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