You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/03/11 20:57:59 UTC

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #5137: Fix the default value provider classes

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org