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


##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/reader/JsonIndexReader.java:
##########
@@ -35,16 +35,35 @@ public interface JsonIndexReader extends IndexReader {
   MutableRoaringBitmap getMatchingDocIds(String filterString);
 
   /**
-   * For an array of docIds and context specific to a JSON key, returns the 
corresponding values for each docId. The
-   * context should be created from the getMatchingDocsMap method.
-   *
-   * @return String[] where String[i] is the value for docIds[i]
+   * For an array of docIds and context specific to a JSON key, returns the 
corresponding sv value for each docId.
+   * @param docIds array of docIds
+   * @param length length of the array
+   * @param matchingValueToDocs Map from each unique value for the jsonPathKey 
value to the flattened docId
+   *                                     posting list
+   * @param isFlattenedDocIds whether the docIds are flattened or unflattened
+   * @return String[] where String[i] is the sv value for docIds[i]
    */
-  String[] getValuesForKeyAndDocs(int[] docIds, Map<String, RoaringBitmap> 
context);
+  String[] getValuesSv(int[] docIds, int length, Map<String, RoaringBitmap> 
matchingValueToDocs,
+      boolean isFlattenedDocIds);
 
   /**
-   * For a JSON key, returns a Map from each value to the docId posting list. 
This map should be  used to avoid reading
-   * and converting the posting list of flattened docIds to real docIds
+   * For an array of docIds and context specific to a JSON key, returns the 
corresponding mv array for each docId.
+   * @param docIds array of docIds
+   * @param length length of the array
+   * @param matchingValueToFlattenedDocs Map from each unique value for the 
jsonPathKey value to the flattened docId
+   *                                     posting list
+   * @return String[][] where String[i] is the mv array for docIds[i]
    */
-  Map<String, RoaringBitmap> getMatchingDocsMap(String key);
+  String[][] getValuesMv(int[] docIds, int length, Map<String, RoaringBitmap> 
matchingValueToFlattenedDocs);

Review Comment:
   ```suggestion
     String[][] getValuesMV(int[] docIds, int length, Map<String, 
RoaringBitmap> matchingValueToFlattenedDocs);
   ```



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/json/ImmutableJsonIndexReader.java:
##########
@@ -396,7 +459,7 @@ private int[] getDictIdRangeForKey(String key) {
    *  Else, return the json path that is generated by replacing array index 
with . on the original key
    *  and the associated flattenDocId bitmap
    */
-  private Pair<String, MutableRoaringBitmap> getKeyAndFlattenDocId(String key) 
{
+  private Pair<String, MutableRoaringBitmap> getKeyAndFlattenedDocId(String 
key) {

Review Comment:
   ```suggestion
     private Pair<String, MutableRoaringBitmap> getKeyAndFlattenedDocIds(String 
key) {
   ```



##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/reader/JsonIndexReader.java:
##########
@@ -35,16 +35,35 @@ public interface JsonIndexReader extends IndexReader {
   MutableRoaringBitmap getMatchingDocIds(String filterString);
 
   /**
-   * For an array of docIds and context specific to a JSON key, returns the 
corresponding values for each docId. The
-   * context should be created from the getMatchingDocsMap method.
-   *
-   * @return String[] where String[i] is the value for docIds[i]
+   * For an array of docIds and context specific to a JSON key, returns the 
corresponding sv value for each docId.
+   * @param docIds array of docIds
+   * @param length length of the array
+   * @param matchingValueToDocs Map from each unique value for the jsonPathKey 
value to the flattened docId
+   *                                     posting list
+   * @param isFlattenedDocIds whether the docIds are flattened or unflattened
+   * @return String[] where String[i] is the sv value for docIds[i]
    */
-  String[] getValuesForKeyAndDocs(int[] docIds, Map<String, RoaringBitmap> 
context);
+  String[] getValuesSv(int[] docIds, int length, Map<String, RoaringBitmap> 
matchingValueToDocs,

Review Comment:
   ```suggestion
     String[] getValuesSV(int[] docIds, int length, Map<String, RoaringBitmap> 
matchingValueToDocs,
   ```



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/json/ImmutableJsonIndexReader.java:
##########
@@ -396,7 +459,7 @@ private int[] getDictIdRangeForKey(String key) {
    *  Else, return the json path that is generated by replacing array index 
with . on the original key
    *  and the associated flattenDocId bitmap
    */
-  private Pair<String, MutableRoaringBitmap> getKeyAndFlattenDocId(String key) 
{
+  private Pair<String, MutableRoaringBitmap> getKeyAndFlattenedDocId(String 
key) {

Review Comment:
   In the new syntax, I think we want to pass in the real json path, e.g. 
`$.foo`, or do we want to keep the current way of no dollar sign?



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

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


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

Reply via email to