Jackie-Jiang commented on a change in pull request #5137: Fix the default value
provider classes
URL: https://github.com/apache/incubator-pinot/pull/5137#discussion_r391263894
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/segment/index/readers/ConstantValueDoubleDictionary.java
##########
@@ -19,20 +19,25 @@
package org.apache.pinot.core.segment.index.readers;
/**
- * Dictionary for constant-value double
+ * Dictionary of a single double value.
*/
-
public class ConstantValueDoubleDictionary extends BaseImmutableDictionary {
- final Double _value;
+ private final double _value;
- public ConstantValueDoubleDictionary(Double value) {
+ public ConstantValueDoubleDictionary(double value) {
super(1);
_value = value;
}
@Override
public int insertionIndexOf(String stringValue) {
-
+ double doubleValue = Double.parseDouble(stringValue);
+ if (doubleValue < _value) {
+ return -1;
+ }
+ if (doubleValue > _value) {
+ return -2;
Review comment:
Discussed offline, and that is the general binary search convention.
----------------------------------------------------------------
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]