siddharthteotia commented on a change in pull request #5625:
URL: https://github.com/apache/incubator-pinot/pull/5625#discussion_r448681175



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/segment/creator/ForwardIndexCreator.java
##########
@@ -19,7 +19,105 @@
 package org.apache.pinot.core.segment.creator;
 
 import java.io.Closeable;
+import org.apache.pinot.spi.data.FieldSpec;
 
 
+/**
+ * Interface for forward index creator.
+ */
 public interface ForwardIndexCreator extends Closeable {
+
+  /**
+   * Returns the data type of the values in the forward index.
+   * <p>NOTE: Dictionary id is handled as INT type.
+   */
+  FieldSpec.DataType getValueType();
+
+  /**
+   * Returns {@code true} if the forward index is for a single-value column, 
{@code false} otherwise.
+   */
+  boolean isSingleValue();
+
+  /**
+   * SINGLE-VALUE COLUMN APIs
+   */
+
+  /**
+   * Indexes the next INT type single-value into the forward index.
+   * <p>NOTE: Dictionary id is handled as INT type.
+   *
+   * @param value Value to index
+   */
+  default void index(int value) {
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * Indexes the next LONG type single-value into the forward index.
+   *
+   * @param value Value to index
+   */
+  default void index(long value) {
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * Indexes the next FLOAT type single-value into the forward index.
+   *
+   * @param value Value to index
+   */
+  default void index(float value) {
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * Indexes the next DOUBLE type single-value into the forward index.
+   *
+   * @param value Value to index
+   */
+  default void index(double value) {
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * Indexes the next STRING type single-value into the forward index.
+   *
+   * @param value Value to index
+   */
+  default void index(String value) {
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * Indexes the next BYTES type single-value into the forward index.
+   *
+   * @param value Value to index
+   */
+  default void index(byte[] value) {
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * Indexes the next raw single-value (not dictionary id) into the forward 
index. The given value should be of the
+   * forward index value type.
+   *
+   * @param value Value to index
+   */
+  default void index(Object value) {
+    throw new UnsupportedOperationException();
+  }
+
+  /**
+   * MULTI-VALUE COLUMN APIs

Review comment:
       Add a comment stating only dictionary encoded MV columns are supported

##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/segment/index/readers/InvertedIndexReader.java
##########
@@ -24,13 +24,14 @@
 public interface InvertedIndexReader<T> extends Closeable {
 
   /**
-   * Get the document ids for the given dictionary id.
-   * @param dictId dictionary ID
+   * Returns the document ids for the given dictionary id.
    */
   T getDocIds(int dictId);
 
   /**
-   * Get the document ids for a given value
+   * Returns the document ids for the given string representation of the value.

Review comment:
       Can we add APIs for each raw value type so that this interface can also 
be used for non dictionary based inverted indexes? With the current change, we 
can probably still do but the raw value has to be converted to string?




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

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