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


##########
pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/SegmentPreProcessorTest.java:
##########
@@ -1903,19 +1908,76 @@ public void 
testForwardIndexDisabledOnExistingColumnDictEncoded()
     ColumnMetadata columnMetadata = 
segmentMetadata.getColumnMetadataFor(EXISTING_STRING_COL_DICT);
     assertNotNull(columnMetadata);
 
-    SegmentDirectory segmentDirectory = 
SegmentDirectoryLoaderRegistry.getDefaultSegmentDirectoryLoader()
-        .load(_indexDir.toURI(),
-            new 
SegmentDirectoryLoaderContext.Builder().setSegmentDirectoryConfigs(_configuration).build());
-    SegmentPreProcessor v3Processor =
-        new SegmentPreProcessor(segmentDirectory, _indexLoadingConfig, 
_newColumnsSchemaWithForwardIndexDisabled);
-    expectThrows(RuntimeException.class, v3Processor::process);
+    createAndValidateIndex(ColumnIndexType.FORWARD_INDEX, 
EXISTING_STRING_COL_DICT, 9, 4,
+        _newColumnsSchemaWithForwardIndexDisabled, false, true, false, 26, 
true, 0, null, true, DataType.STRING,
+        100000);
 
     constructV1Segment(Collections.emptyList(), Collections.emptyList(), 
Collections.emptyList());
-    segmentDirectory = 
SegmentDirectoryLoaderRegistry.getDefaultSegmentDirectoryLoader().load(_indexDir.toURI(),
-        new 
SegmentDirectoryLoaderContext.Builder().setSegmentDirectoryConfigs(_configuration).build());
-    SegmentPreProcessor v1Processor =
-        new SegmentPreProcessor(segmentDirectory, _indexLoadingConfig, 
_newColumnsSchemaWithForwardIndexDisabled);
-    expectThrows(RuntimeException.class, v1Processor::process);
+
+    createAndValidateIndex(ColumnIndexType.FORWARD_INDEX, 
EXISTING_STRING_COL_DICT, 9, 4,

Review Comment:
   I guess I wasn't clear enough 😓 . I meant that we should add a test for the 
following case:
   
   T1: Column  C1 has raw forwardIndex, range index (raw)
   T2: ForwardIndex is disabled
   T3: Segment is reloaded.
   Now, during reload, the following operations should happen:
   1. Temporary dict based forward index is created.
   2. Old raw range index is deleted.
   3. Dictionary and inverted index are created 
   4. New dict based range index is created. 
   



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