Jackie-Jiang commented on code in PR #8953:
URL: https://github.com/apache/pinot/pull/8953#discussion_r905557641
##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/reader/ForwardIndexReader.java:
##########
@@ -410,9 +421,303 @@ default byte[] getBytes(int docId, T context) {
/**
* MULTI-VALUE COLUMN RAW INDEX APIs
- * TODO: Not supported yet
*/
+ /**
+ * Fills the values
+ * @param docIds Array containing the document ids to read
+ * @param length Number of values to read
+ * @param values Values to fill
+ * @param context Reader context
+ */
+ default void readValuesMV(int[] docIds, int length, int[][] values, T
context) {
+ switch (getValueType()) {
+ case INT:
+ for (int i = 0; i < length; i++) {
+ values[i] = getIntMV(docIds[i], context);
+ }
+ break;
+ case LONG:
+ for (int i = 0; i < length; i++) {
+ long[] longValueBuffer = getLongMV(docIds[i], context);
Review Comment:
We should be able to reuse the buffer when we need to cast the values. We
can pass in the `maxNumValuesPerMVEntry` and use that to create the reusable
buffer
##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/reader/ForwardIndexReader.java:
##########
@@ -100,6 +100,17 @@ default int getDictIdMV(int docId, int[] dictIdBuffer, T
context) {
throw new UnsupportedOperationException();
}
+ /**
+ * Reads the dictionary ids for a multi-value column at the given document
id into a buffer and returns the buffer.
+ *
+ * @param docId Document id
+ * @param context Reader context
+ * @return A buffer containing the multi-value entries
+ */
Review Comment:
(minor) Suggest modifying the javadoc a little bit as the buffer is a little
bit confusing. Same for other methods
```suggestion
/**
* Reads the dictionary ids for a multi-value column at the given document
id.
*
* @param docId Document id
* @param context Reader context
* @return Dictionary ids at the given document id
*/
```
--
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]