Copilot commented on code in PR #16363:
URL: https://github.com/apache/pinot/pull/16363#discussion_r2227656560


##########
pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/ForwardIndexHandlerTest.java:
##########
@@ -2036,16 +2047,19 @@ private void validateForwardIndex(SegmentDirectory 
segmentDirectory, SegmentDire
     assertTrue(reader.hasIndexFor(columnName, StandardIndexes.forward()));
 
     // Check Compression type in header
-    ForwardIndexReader<?> fwdIndexReader = ForwardIndexType.read(reader, 
columnMetadata);
+    IndexReaderFactory<ForwardIndexReader> readerFactory = 
StandardIndexes.forward().getReaderFactory();
+    FieldIndexConfigs fieldIndexConfigs = 
createFieldIndexConfigsFromMetadata(columnMetadata);
+    ForwardIndexReader<?> fwdIndexReader = 
readerFactory.createIndexReader(reader, fieldIndexConfigs, columnMetadata);
     ChunkCompressionType fwdIndexCompressionType = 
fwdIndexReader.getCompressionType();
     if (expectedCompressionType != null) {
       assertNotNull(fwdIndexCompressionType);
       assertEquals(fwdIndexCompressionType.name(), 
expectedCompressionType.name());
     } else {
       assertNull(fwdIndexCompressionType);
     }
-
-    try (ForwardIndexReader<?> forwardIndexReader = 
ForwardIndexType.read(reader, columnMetadata)) {
+    fieldIndexConfigs = createFieldIndexConfigsFromMetadata(columnMetadata);
+    try (ForwardIndexReader<?> forwardIndexReader = 
readerFactory.createIndexReader(reader, fieldIndexConfigs,
+        columnMetadata);) {

Review Comment:
   The semicolon should be removed from the closing parenthesis of the 
try-with-resources statement. It should be ') {' instead of ');'
   ```suggestion
           columnMetadata)) {
   ```



##########
pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/SegmentPreProcessorTest.java:
##########
@@ -805,8 +807,12 @@ private void validateIndex(IndexType<?, ?, ?> indexType, 
String column, int card
       // Check if the raw forward index compressionType is correct.
       if (expectedCompressionType != null) {
         assertFalse(hasDictionary);
-
-        try (ForwardIndexReader<?> fwdIndexReader = 
ForwardIndexType.read(reader, columnMetadata)) {
+        IndexReaderFactory<ForwardIndexReader> readerFactory = 
StandardIndexes.forward().getReaderFactory();
+        FieldIndexConfigs fieldIndexConfigs = new FieldIndexConfigs.Builder()
+            .add(StandardIndexes.forward(), ForwardIndexConfig.getDefault())
+            .build();
+        try (ForwardIndexReader fwdIndexReader = 
readerFactory.createIndexReader(reader, fieldIndexConfigs,
+            columnMetadata);) {

Review Comment:
   The semicolon should be removed from the closing parenthesis of the 
try-with-resources statement. It should be ') {' instead of ');'
   ```suggestion
               columnMetadata)) {
   ```



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