Jackie-Jiang commented on a change in pull request #6877: URL: https://github.com/apache/incubator-pinot/pull/6877#discussion_r627883534
########## File path: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/json/ImmutableJsonIndexReader.java ########## @@ -151,43 +152,91 @@ private MutableRoaringBitmap getMatchingFlattenedDocIds(FilterContext filter) { */ private MutableRoaringBitmap getMatchingFlattenedDocIds(Predicate predicate) { ExpressionContext lhs = predicate.getLhs(); - Preconditions.checkState(lhs.getType() == ExpressionContext.Type.IDENTIFIER, + Preconditions.checkArgument(lhs.getType() == ExpressionContext.Type.IDENTIFIER, "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(); - // Process the array index within the key if exists - // E.g. "foo[0].bar[1].foobar"='abc' -> foo.$index=0 && foo.bar.$index=1 && foo.bar.foobar='abc' MutableRoaringBitmap matchingDocIds = null; - int leftBracketIndex; - while ((leftBracketIndex = key.indexOf('[')) > 0) { - int rightBracketIndex = key.indexOf(']'); - Preconditions.checkState(rightBracketIndex > leftBracketIndex, "Missing right bracket in key: %s", key); - - String leftPart = key.substring(0, leftBracketIndex); - int arrayIndex; - try { - arrayIndex = Integer.parseInt(key.substring(leftBracketIndex + 1, rightBracketIndex)); - } catch (Exception e) { - throw new IllegalStateException("Invalid key: " + key); + if (_version == BaseJsonIndexCreator.VERSION_2) { Review comment: Same here, we want to handle the case where both version segments exist -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org