You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Jackie-Jiang (via GitHub)" <gi...@apache.org> on 2023/06/30 07:48:01 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #11000: wip: add support for mv cols with realtime lucene index

Jackie-Jiang commented on code in PR #11000:
URL: https://github.com/apache/pinot/pull/11000#discussion_r1247542426


##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/mutable/MutableTextIndex.java:
##########
@@ -31,12 +31,18 @@ default void add(@Nonnull Object value, int dictId, int docId) {
 
   @Override
   default void add(@Nonnull Object[] values, @Nullable int[] dictIds, int docId) {
-    throw new UnsupportedOperationException("Mutable text indexes are not supported for multi-valued columns");
+    add((String[]) values);
   }
 
   /**
    * Index the document
    * @param document the document as a string
    */
   void add(String document);
+
+  /**
+   * Index the multi-value document
+   * @param document the document as an array of Strings
+   */
+  void add(String[] document);

Review Comment:
   (minor) Same for other signatures
   ```suggestion
     void add(String[] documents);
   ```



##########
pinot-segment-local/src/test/java/org/apache/pinot/segment/local/realtime/impl/invertedindex/LuceneMutableTextIndexTest.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.segment.local.realtime.impl.invertedindex;
+
+import java.io.File;
+import org.apache.commons.io.FileUtils;
+import org.apache.lucene.search.SearcherManager;
+import org.roaringbitmap.buffer.ImmutableRoaringBitmap;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+
+public class LuceneMutableTextIndexTest {

Review Comment:
   Please reformat this class with [Pinot Style](https://docs.pinot.apache.org/developers/developers-and-contributors/code-setup#setup-ide)



-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org