Jackie-Jiang commented on a change in pull request #4622: Standardize the
Dictionary interface, ensure the BYTES support
URL: https://github.com/apache/incubator-pinot/pull/4622#discussion_r327873439
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/segment/index/readers/Dictionary.java
##########
@@ -21,18 +21,40 @@
import java.io.Closeable;
+/**
+ * Interface for the dictionary. For the read APIs, type conversion among INT,
LONG, FLOAT, DOUBLE, STRING should be
+ * supported. Type conversion between STRING and BYTES via Hex
encoding/decoding should be supported.
+ */
public interface Dictionary extends Closeable {
int NULL_VALUE_INDEX = -1;
/**
- * Returns index of the object in the dictionary.
- * Returns -1, if the object does not exist in the dictionary.
- *
- * @param rawValue Object for which to find the index.
- * @return Index of object, or -1 if not found.
+ * NOTE: Immutable dictionary is always sorted; mutable dictionary is always
unsorted.
+ */
+ boolean isSorted();
+
+ 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.
Review comment:
This value is from the query, so no concept of padding here. Added comments
for the String binary search.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]