mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-10 21:07:53 +00:00
move 0.0 check up to right after Min is queried
This commit is contained in:
parent
1e4cc12bd0
commit
f81c0cab6b
1 changed files with 3 additions and 4 deletions
|
|
@ -1336,6 +1336,9 @@ func (e *executor) executePercentile(ctx context.Context, qcx *Qcx, index string
|
|||
if err != nil {
|
||||
return ValCount{}, errors.Wrap(err, "executing Min call for Percentile")
|
||||
}
|
||||
if nth == 0.0 {
|
||||
return ValCount{Val: minVal.Val, Count: minVal.Count}, nil
|
||||
}
|
||||
|
||||
// get max
|
||||
q, _ = pql.ParseString(fmt.Sprintf(`Max(field="%s")`, fieldName))
|
||||
|
|
@ -1361,10 +1364,6 @@ func (e *executor) executePercentile(ctx context.Context, qcx *Qcx, index string
|
|||
rangeCall = intersectCall.Children[0]
|
||||
}
|
||||
|
||||
if nth == 0.0 {
|
||||
return ValCount{Val: minVal.Val, Count: minVal.Count}, nil
|
||||
}
|
||||
|
||||
k := (1 - nth) / nth
|
||||
|
||||
min, max := minVal.Val, maxVal.Val
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue