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


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/text/LuceneTextIndexReader.java:
##########
@@ -446,9 +449,15 @@ private DocIdTranslator 
createDocIdTranslator(PinotDataBuffer docIdMappingBuffer
     }
 
     if (docIdMappingBuffer != null) {
-      return new DefaultDocIdTranslator(docIdMappingBuffer);
+      // Ensure the buffer is in little endian format as expected by 
DefaultDocIdTranslator
+      // Create a view with little endian byte order if the buffer is not 
already in little endian
+      PinotDataBuffer littleEndianBuffer = docIdMappingBuffer.order() == 
ByteOrder.LITTLE_ENDIAN
+          ? docIdMappingBuffer
+          : docIdMappingBuffer.view(0, docIdMappingBuffer.size(), 
ByteOrder.LITTLE_ENDIAN);
+      return new DefaultDocIdTranslator(littleEndianBuffer);
     }
 
+    LOGGER.info("building doc id mapping for text index column: {}", _column);

Review Comment:
   Log message lacks consistency in capitalization. Should start with capital 
letter: 'Building doc id mapping...' to match project logging conventions.
   ```suggestion
       LOGGER.info("Building doc id mapping for text index column: {}", 
_column);
   ```



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/text/LuceneTextIndexCreator.java:
##########
@@ -407,6 +421,18 @@ public void close()
     try {
       // based on the commit flag set in IndexWriterConfig, this will decide 
to commit or not
       _indexWriter.close();
+      // Build docIdMapping file if storeInSegmentFile is true
+      // This allows the mapping file to be available during read without 
building it on-the-fly
+      if (_config.isStoreInSegmentFile()) {
+        //Check if mapping file already exists

Review Comment:
   Fix spacing: comment should start with a space after '//' for consistency 
with project style.
   ```suggestion
           // Check if mapping file already exists
   ```



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