mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Pass filters down to Percentile correctly
When pushing an expression down to PQL Percentile, if we have a filter, it has to be passed as the argument "filter", not as an additional child argument. We don't need to pass in `All()` as a filter if there's no filter, Percentile works fine with no filter provided.
This commit is contained in:
parent
2bdc30c4f0
commit
1602a0ff06
1 changed files with 3 additions and 5 deletions
|
|
@ -230,17 +230,15 @@ func (i *pqlAggregateRowIter) Next(ctx context.Context) (types.Row, error) {
|
|||
return nil, sql3.NewErrInternalf("unexpected aggregate nth arg type '%T'", coercedNthValue)
|
||||
}
|
||||
|
||||
if cond == nil {
|
||||
cond = &pql.Call{Name: "All"}
|
||||
}
|
||||
|
||||
call = &pql.Call{
|
||||
Name: "Percentile",
|
||||
Args: map[string]interface{}{
|
||||
"field": expr.columnName,
|
||||
"nth": nth,
|
||||
},
|
||||
Children: []*pql.Call{cond},
|
||||
}
|
||||
if cond != nil {
|
||||
call.Args["filter"] = cond
|
||||
}
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue