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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/defaultcolumn/V3DefaultColumnHandler.java:
##########
@@ -62,16 +62,28 @@ protected boolean updateDefaultColumn(String column, 
DefaultColumnAction action)
     FieldSpec fieldSpec = _schema.getFieldSpecFor(column);
     Preconditions.checkNotNull(fieldSpec);
     boolean isSingleValue = fieldSpec.isSingleValueField();
-    File forwardIndexFile;
+    boolean forwardIndexDisabled = !isSingleValue && 
isForwardIndexDisabled(column);
+    File forwardIndexFile = null;
+    File invertedIndexFile = null;
     if (isSingleValue) {
       forwardIndexFile = new File(_indexDir, column + 
V1Constants.Indexes.SORTED_SV_FORWARD_INDEX_FILE_EXTENSION);
       if (!forwardIndexFile.exists()) {
         forwardIndexFile = new File(_indexDir, column + 
V1Constants.Indexes.UNSORTED_SV_FORWARD_INDEX_FILE_EXTENSION);
       }
     } else {
-      forwardIndexFile = new File(_indexDir, column + 
V1Constants.Indexes.UNSORTED_MV_FORWARD_INDEX_FILE_EXTENSION);
+      if (forwardIndexDisabled) {
+        // An inverted index is created instead of forward index for 
multi-value columns with forward index disabled
+        invertedIndexFile = new File(_indexDir, column + 
V1Constants.Indexes.BITMAP_INVERTED_INDEX_FILE_EXTENSION);
+      } else {
+        forwardIndexFile = new File(_indexDir, column + 
V1Constants.Indexes.UNSORTED_MV_FORWARD_INDEX_FILE_EXTENSION);

Review Comment:
   This is related to the fact that we decided the following for default column 
handling:
   
   - SV columns: default column will be sorted and we will allow forward index 
to be created as a simple sorted forward index. This ensures the same behavior 
as segment creation code path where sorted columns ignore the 
`forwardIndexDisabled`
   - MV columns: cannot be sorted. We need to handle this and create an 
inverted index instead of a forward index since we mandate inverted index + 
dictionary when `forwardIndexDisabled` is true.
   
   Does that make sense?



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