public static double lessThanSelectivity(KllFloatsSketch kll, float value) {
    float min = kll.getMinItem();
    if (value < min) {
      return 0;
    }
    if (Double.compare(value, min) == 0 || Double.compare(Math.nextUp(value), min) == 0) {
      return 0;
    }
    return kll.getCDF(new float[] { value }, QuantileSearchCriteria.EXCLUSIVE)[0];
  }
Returns the selectivity of a predicate "column &lt; value" in the range [0, 1]
@param kll the KLL sketch for the involved column
@param value the literal used in the comparison
@return the selectivity of a predicate "column &lt; value" in the range [0, 1]
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/stats/FilterSelectivityEstimator.java