wirybeaver commented on code in PR #12466:
URL: https://github.com/apache/pinot/pull/12466#discussion_r1502008766


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/json/ImmutableJsonIndexReader.java:
##########
@@ -160,94 +161,26 @@ private MutableRoaringBitmap 
getMatchingFlattenedDocIds(Predicate predicate) {
         "Left-hand side of the predicate must be an identifier, got: %s (%s). 
Put double quotes around the identifier"
             + " if needed.", lhs, lhs.getType());
     String key = lhs.getIdentifier();
-
-    MutableRoaringBitmap matchingDocIds = null;
+    // Support 2 formats:
+    // - JSONPath format (e.g. "$.a[1].b"='abc', "$[0]"=1, "$"='abc')
+    // - Legacy format (e.g. "a[1].b"='abc')
     if (_version == BaseJsonIndexCreator.VERSION_2) {
-      // Support 2 formats:
-      // - JSONPath format (e.g. "$.a[1].b"='abc', "$[0]"=1, "$"='abc')
-      // - Legacy format (e.g. "a[1].b"='abc')
-      if (key.charAt(0) == '$') {
+      if (key.startsWith("$")) {
         key = key.substring(1);
       } else {
         key = JsonUtils.KEY_SEPARATOR + key;
       }
-
-      // Process the array index within the key if exists

Review Comment:
   Keep the key preprocessing but move the generation of matchingDocIds over 
array index json path to the static function processArrayIndex.



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