Jackie-Jiang commented on a change in pull request #6176: URL: https://github.com/apache/incubator-pinot/pull/6176#discussion_r510445906
########## File path: pinot-core/src/main/java/org/apache/pinot/core/segment/index/readers/Dictionary.java ########## @@ -40,14 +42,52 @@ */ DataType getValueType(); + /** + * Returns the number of values in the dictionary. + */ int length(); /** * Returns the index of the string representation of the value in the dictionary, or {@link #NULL_VALUE_INDEX} (-1) if - * the value does not exist. This API is for cross-type predicate evaluation. + * the value does not exist. This method is for the cross-type predicate evaluation. */ int indexOf(String stringValue); + /** + * Returns the insertion index of the string representation of the value in the dictionary. This method follows the + * same behavior as in {@link Arrays#binarySearch(Object[], Object)}. All sorted dictionary should support this + * method. This method is for the range predicate evaluation. + */ + int insertionIndexOf(String stringValue); + + /** + * Returns a set of dictIds in the given value range, where lower/upper bound can be "*" which indicates unbounded + * range. All unsorted dictionary should support this method. This method is for the range predicate evaluation. + */ + IntSet getDictIdsInRange(String lower, String upper, boolean includeLower, boolean includeUpper); + + /** + * Returns the comparison result of value for dictId 1 and dictId 2, i.e. {@code value1.compareTo(value2)}. + */ + int compare(int dictId1, int dictId2); + + /** + * Returns the minimum value in the dictionary. Note that for type BYTES, {@code ByteArray} will be returned. Review comment: Good question. It is undefined, and should not be called when the dictionary is empty. Updated the javadoc. ---------------------------------------------------------------- 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